SQL/MX 2.x Database and Application Migration Guide (G06.23+, H06.04+, J06.03+)

Converting SQL/MP Applications to SQL/MX
Applications
HP NonStop SQL/MX Database and Application Migration Guide540435-005
10-46
Embedded SQL Statements
EXECUTE Statement
In NonStop SQL/MX, input data is supplied by the USING clause that specifies either a
list of host variables or an SQL descriptor area. Output data is provided by the INTO
clause that specifies either a list of host variables or an SQL descriptor area. See
Descriptor Area
.
NonStop SQL/MP implements the RETURNING clause for output data. NonStop
SQL/MX does not provide a RETURNING clause.
If you perform a PREPARE and an EXECUTE of an SQL UPDATE, INSERT or
DELETE statement on a nonaudited table, NonStop SQL/MX does not close the table
and will not release record and table locks. You can use FUP LISTLOCKS to check if
your MXCI session keeps locks on the table after completion of the EXECUTE
statement. Then you can manually execute an UNLOCK command or exit the MXCI
session. You can also use standalone UPDATE, INSERT or DELETE statements
instead of using PREPARE and EXECUTE. Only SQL/MP tables can be nonaudited.
Updatable Cursors
In NonStop SQL/MP, delete operations using a cursor do not require the FOR UPDATE
OF clause of the DECLARE CURSOR statement. You must use this clause when you
update rows, but it is optional when you delete rows. In NonStop SQL/MX, both update
and delete operations require an updatable cursor.
OPEN Changed NonStop SQL/MX uses an SQL descriptor
area, as defined by ANSI SQL:1999. See
Descriptor Area on page 10-48.
Positioned DELETE Yes
Positioned UPDATE Changed NonStop SQL/MX allows this statement to be
dynamic.
PREPARE Yes SQL/MX FROM clause does not allow
quoted strings.
RELEASE No
SELECT INTO Changed See SELECT Statements
on page 10-23.
WHENEVER Changed Usage changes. See WHENEVER
Declarative on page 10-52.
Positioned DELETE Yes
Table 10-12. Embedded SQL Statements (page 2 of 2)
Embedded SQL/MP
Statements and Directives
Implemented
in SQL/MX? Comments