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:
Define a database directly in the Data Definition view
Connect to a database and copy the data definitions to a project
To create an SQL statement using the Create A New SQL Statement wizard:
Click File > New > Other.
In the New window, expand the Data folder, click SQL Statement, and then click Next.
Use the pages in the wizard to define your SQL statement.
When you create a statement using the wizard, you are prompted to specify:
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.
What database model you want to specify (you can work with one that is already in the workbench or specify a new one).
Specify the name of your statement:
In the Tables tab, select the table into which to insert data.
In the Insert tab, click the Value cell and type the value you want to insert.
Click Finish
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |