|
D SQLStatement s 100a D Field1 s 5p 0 D Field2 s 10a /free SQLStatement = 'SELECT * FROM MYFILE WHERE MYFIELD = ? + and MYFIELD2 = ''?'''; Field1 = 10; Field2 = 'TEST'; exec sql declare MYFILE_CURSOR cursor for MYSELECT; exec sql prepare MYSELECT from :SQLStatement; if SQLSTATE <> '00000'; // Error recovery. endif; exec sql open MYFILE_CURSOR using :Field1, :Field2; if SQLSTATE <> '00000'; // Error recovery. endif; // etc... /end-free Hope this helps. Jeff Young wrote:
Does anyone have an example of using parameter markers in a SQL RPGLE program?Thanks,Jeff Young jyoung@xxxxxxxxxxxx Sr. Programmer Analyst Dynax Solutions, Inc. A wholly owned subsidiary of enherent Corp. IBM e(logo)server Certified Systems Expert - iSeries Technical Solutions V5R2 IBM Certified Specialist- eServer i5Series Technical Solutions Designer V5R3 IBM Certified Specialist- eServer i5Series Technical Solutions Implementer V5R3 IBM Certified Systems Expert -- eServer i5 iSeries Technical Solutions V5R3IBM e(logo) Certified Specialist - p5 and pSeries Technical Sales Support
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.