Difference between revisions of "EXECUTE"
From Recital Documentation Wiki
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
Line 11: | Line 11: | ||
==Syntax== | ==Syntax== | ||
− | EXECUTE <statement> USING :<variable>[,<variable2>[, | + | EXECUTE <statement> USING :<variable>[,<variable2>[,...]] |
Line 33: | Line 33: | ||
|- | |- | ||
|} | |} | ||
+ | |||
==Example== | ==Example== |
Revision as of 16:02, 19 March 2009
Contents
EXECUTE
Class
SQL Applications
Purpose
Executes an SQL statement previously set up using the PREPARE command
Syntax
EXECUTE <statement> USING :<variable>[,<variable2>[,...]]
See Also
Description
The EXECUTE command is used to execute an SQL statement previously set up using the PREPARE command. Variables used as parameters in the SQL statement must be declared before execution.
Keywords | Description |
---|---|
statement | An identifier for the SQL statement previously set up using PREPARE |
variable | The name of a variable to be used as the first parameter to the SQL statement |
variable2… | The names of variables to be used as the subsequent parameters to the SQL statement |
Example
stmtbuf = 'SELECT * FROM customers WHERE contactnam = ?' exec sql prepare mystmt from :stmtbuf; gcAuthor = 'Ann Devon' exec sql execute mystmt using :gcAuthor; gcAuthor = 'Yang Wang' exec sql execute mystmt using :gcAuthor; stmtbuf = 'INSERT INTO customers (customerid, companynam, contactnam) VALUES (?,?,?)' exec sql prepare mystmt from :stmtbuf; buf1 = '00101' buf2 = 'Recital' buf3 = 'US' exec sql execute mystmt using :buf1, :buf2, :buf3;
Products
Recital Database Server, Recital Mirage Server, Recital Terminal Developer