|
>
> 3. ask if there is a way to put the SQL statements in a string and then
> pass that string to the SQL engine (like MySQL or postgres does). Maybe
> like:
>
> C eval string = 'EXEC SQL DECLARE C1 CURSOR FOR blah ...'
> C<somehow tell the SQL machine to run the contents of string <string> >
>
> So how about it? Is there a way to do option 3?
>
Yes you can do #3. Here's an example that creates an index.
D SQLStmt s 1024 varying
D
C eval SQLStmt = 'CREATE INDEX ' + %trim(lN) +
C '/' + %trim(idxN) + ' ON ' +
C %trim(lN) + '/' + %trim(fN) +
C ' (' + %trim(idx) + ')'
C
C/exec sql
C+ PREPARE DYNSQLSTMT FROM :SQLstmt
C/end-exec
C
C/exec sql
C+ EXECUTE DYNSQLSTMT
C/end-exec
Phil
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.