You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a wide-supported way to execute something that has no bind parameters (only the statement if not given by literal) and no result set (The SQLCA structure would still be set, so checkingSQLCODE and friends still would be possible). :stmt should be a "plain" pic x item, but it would be nice to optional be able to use a varlength group, too.
Workaround
use prepared statements, as this currently works only correct with varlength groups (tracked under #64) you need to change the statement definition first:
- 77 SQL-COMMAND PIC X(50)- VALUE "DELETE FROM TESTTABLE WHERE I > ?".+ 01 SQL-COMMAND.+ 03 SQL-COMMAND-LEN PIC 9(9) VALUE 50.+ 03 SQL-COMMAND-ARR PIC X(50)+ VALUE "DELETE FROM TESTTABLE WHERE I > ?".
and then use that in COBOL
* place statement to execute into SQL-COMMAND-ARR, thenMOVEFUNCTIONLENGTH(FUNCTIONTRIM(SQL-COMMAND-ARR))
TO SQL-COMMAND-LEN.
EXEC SQL AT:DBS PREPARE P1 FROM:SQL-COMMAND END-EXEC.
*IF SQLCODE NOT=0DISPLAY"PREPARE ERROR"STOP RUNEND-IF.
*EXEC SQL AT:DBSEXECUTE P1 END-EXEC.
The text was updated successfully, but these errors were encountered:
Feature Request
https://docs.oracle.com/cd/A97630_01/appdev.920/a96109/pco09dyn.htm#774
https://www.postgresql.org/docs/14/ecpg-dynamic.html
As a wide-supported way to execute something that has no bind parameters (only the statement if not given by literal) and no result set (The
SQLCA
structure would still be set, so checkingSQLCODE
and friends still would be possible).:stmt
should be a "plain" pic x item, but it would be nice to optional be able to use a varlength group, too.Workaround
use prepared statements, as this currently works only correct with varlength groups (tracked under #64) you need to change the statement definition first:
and then use that in COBOL
The text was updated successfully, but these errors were encountered: