Entering content frame

 Static SQL Statement Without Parameters 

Use

One example of static SQL statements without parameters are DDL statements such as the CREATE TABLE statement. However, you can also formulate INSERTs, UPDATEs, DELETEs, and other statements.

Syntax

EXEC SQL [<session_spec>] <statement>;

Specify <session_spec> , when you are working with multiple database sessions.

 

EXEC SQL CREATE TABLE hotel
(hno FIXED (4,0) KEY CONSTRAINT hno BETWEEN 1 AND 9999,
name CHAR(15) NOT NULL, zip FIXED (5,0) NOT NULL, loc CHAR(20), price FIXED(6,2));

EXEC SQL INSERT INTO hotel VALUES (10,'Excelsior', 79000,'Atlanta', 135.00);

EXEC SQL INSERT INTO hotel VALUES (20,'Flora', 44000,'Philadelphia', 45.00);

EXEC SQL COMMIT WORK;

 

Leaving content frame