Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQLRPG dynamic SQL

Status
Not open for further replies.

WP

Programmer
Nov 30, 1999
463
CH
Is this possible ... I want to purge a load of files and have their names in a table.

I have to use SQL because some are selective purges.

Anyway I want I have ...

0129.01 C PRGALL BegSR
0136.00
0138.00 C Eval SQLstm='DELETE FROM ' + FileNM
0144.00 *--------------------------------------------------------------------*
0145.00 * Prepare STMT as initialized in declare section *
0146.00 *--------------------------------------------------------------------*
0147.00 C/EXEC SQL
0147.01 C+ PREPARE S1 FROM :SQLstm
0149.00 C/END-EXEC

But how do I run it ? All examples I see use actual statements and not dynamically built ones i.e.

C/EXEC SQL
C+ DELETE FROM actualFILE
C/END-EXEC

How do I execute my prepared statement?

WP

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top