Chapter 13 Generating a Database from a PDM


Executing SQL queries

You can send SQL queries to a connected data source and display the results.

In the Execute SQL Query dialog box, you can use the following tools and keyboard shortcuts from the Edit/Run Script editor toolbar:

Tool Description Keyboard shortcut

Open Editor Contextual menu
Note: When you use the Find feature, the parameter "Regular expression" allows the use of wildcards in the search expression. For more information, see Visual Basic documentation
shift + F11

Edit With. Opens the previously defined default editor or allows you to select another editor if you click the down arrow beside this tool ctrl + E

Run. Executes the current script F5

For more information on defining a default editor, see section Defining a text editor in chapter Using the PowerDesigner Interface in the General Features Guide .

Script bookmarks

In the Edit/Run Script editor window, you can add and remove bookmarks at specific points in the code and then navigate forwards or backwards from bookmark to bookmark:

Keyboard shortcut Description
ctrl + F2 Adds a new bookmark. A blue bookmark box is displayed. If you repeat this action from the same position, the bookmark is deleted and the blue marker disappears
F2 Jumps to bookmark
shift + F2 Jumps to previous bookmark

Steps To execute SQL queries:

  1. Select Database→Execute SQL.

    A dialog box asks you to identify a data source and connection parameters.
  2. Select the Machine data source radio button.

    Select a data source from the list.

    or

    Select the File data source radio button.

    Browse to the directory containing the .DSN file.

    Select the .DSN file.
  3. Type your user ID and password.
  4. Click Connect and, if prompted by your data source, type additional connection parameters.

    The Execute Query dialog box is displayed.
  5. Type one or more SQL queries in the window.

    The syntax of some SQL queries may be DBMS dependent.
  6. Click the Run button.

    A list displays the results of your queries.
  7. Click Close to quit the Execute Query dialog box.

 


Copyright (C) 2006. Sybase Inc. All rights reserved.