Lesson 1: Creating a baseline procedure

This tutorial assumes you have created the test database. If you have not, see Lesson 1: Creating the test database.

Tip

You can copy and paste the SQL statements in this tutorial into Interactive SQL.

To create a baseline procedure
  1. Start Sybase Central and connect to the test database app_profiling - DBA with the user ID DBA and the password sql.

    If you are unfamiliar with starting Sybase Central and connecting to a database, see Connect to a local database.

  2. In the left pane, select the app_profiling - DBA database, and then choose File » Open Interactive SQL.

    Interactive SQL starts and connects to the app_profiling - DBA database.

  3. In Interactive SQL, run the following SQL statements:

    1. Create a table:

      CREATE TABLE table1 (
      Count INT );
    2. Create a baseline procedure:

      CREATE PROCEDURE baseline( )
         BEGIN
            INSERT table1 
               SELECT COUNT (*)
                  FROM rowgenerator r1, rowgenerator r2, 
                       rowgenerator r3 
               WHERE r3.row_num < 5;
         END;
    3. Commit the changes you made to the database:

      COMMIT;
  4. Close Interactive SQL.