Use the SQL Statement wizard

Creating an SQL statement

You can create an SQL statement using either the SQL Builder or the Create A New SQL Statement wizard. Both tools support the creation of SELECT, UPDATE, INSERT and DELETE statements. The SQL Builder also supports WITH (DB2 only) and FULLSELECT statements. Any statement that you create is stored in a file with the extension .sqx.

Prerequisite: Before you create your SQL statement, you must do one of the following actions:

To create an SQL statement using the Create A New SQL Statement wizard:

  1. Click File > New > Other.

  2. In the New window, expand the Data folder, click SQL Statement, and then click Next.

  3. Use the pages in the wizard to define your SQL statement.

    When you create a statement using the wizard, you are prompted to specify:

    Create A New SQL Statement

    • The kind of statement that you want to create.

    • How you want to create that statement (for example, typing it in manually or being guided by the wizard).

    • Whether to use an existing database model or create a new database connection.

      By default, you are prompted to create a new database connection. To use an existing database model, clear the Create a new database connection check box.

      If you select to use an existing database model for your statement, your SQL statement is saved in the same folder as the database model. You must select the database model in order to be able to use it, but no further information is required.

      If you select to connect to a database and import a new database model, you are prompted to specify information required to connect to the database you want to work with. You are asked to specify a project or folder for the new database and the statement.

  4. What database model you want to specify (you can work with one that is already in the workbench or specify a new one).

    Database model

  5. Specify the name of your statement:

    Name of the statement

  6. In the Tables tab, select the table into which to insert data.

    Tables tab

  7. In the Insert tab, click the Value cell and type the value you want to insert.

    Insert tab

  8. Click Finish

    Insert statement

Professional hosting     Belorussian informational portal         Free SCBCD 1.3 Study Guide     Free SCDJWS 1.4 Study Guide     SCDJWS 1.4 Quiz     Free IBM Certified Associate Developer Study Guide     Free SCJP 5.0 (Tiger) Study Guide     Free Mock Exam Engine     Free SCWCD 1.4 Study Guide     IBM Test 000-287. Enterprise Application Development with IBM WebSphere Studio, V5.0 Study Guide