Sun
ONE Active Server Pages Product Home Page Developer Site Version
 

ContentsPreviousNextIndex



Adding SQL Statements


Use the following procedure to add a new SQL statement. (You can also create a new SQL statement by saving an existing statement with a new name. For more information, see Editing SQL Statements.)

To add a new SQL statement

  1. Open DBMS using the URL provided by your Sun ONE ASP administrator.

  2. Click a database connection node in the left pane to expand the node if necessary, and then expand the SQL Statements node.

  3. SQL statement information displays in the right pane.

  4. Click Add new SQL in the left pane, or in the table in the right pane.

  5. The Add New SQL Statement page displays.

    The page is divided into two panes. The top pane contains a form for entering the SQL statement. The lower pane displays a message box where query results and execution or error messages are displayed.

  6. In the Name box, type the name of the SQL statement.

  7. Do one of the following:

    • Type the SQL statement in the SQL statement box. Only SQL statements permitted in MySQL can be entered, such as a conventional SELECT statement, or statements specific to MySQL such as DESCRIBE <Table Name>.

    • - or -

    • Use the Reference boxes to create a SELECT statement or view the data structure of a particular table (the top reference box displays tables, the lower box displays columns).

  8. Do one of the following:

    • Click Execute to run the query and return results to the Query result box in the right pane. Results are returned as either a recordset or a message. If the query returns a recordset, the result is listed by pages. Otherwise, a message of some type displays. If the query is unsuccessful, an error message displays.

    • - or -

    • Click Add to add and save the new statement. If the SQL statement is successfully added, a message to that effect displays. Click OK, and the new SQL statement appears in the DBMS interface.

    • Note icon Note The #shown box displayed with query results specifies how many records should be displayed. This number is set to 20 by default. To see a different number of records, change the number in the box and then click Refresh. If the total number of records exceeds the number shown, use the navigation buttons (< > symbols) in the lower right corner to navigate through the records. Clicking << or >> takes you to the first or last set of records. Records are displayed in increments of the number in the #shown box.

See also:

Working with SQL Statements



ContentsPreviousNextIndex