|
We are using more and more SQL and particularly the SQL Stored Procedures. They are quick and easy. I find them very handy and a great way to BLACK BOX database transactions. I once created a program using the ODBC part in VARPG to access DB2 data defined by the Client Access/400 ODBC driver, supplying the SQL statement "Select * from lib/file". Now I wanted to try calling a procedure "CALL lib/procedure ('12345678','1234567890', RSLT)". First I did one without parameters and it works great. Next I tried to include a parameter in the call, both with and without a colon (:) preceding the variable that should return a result parm. I get SQL0312 error message - variable RSLT not defined or not usable. I think I need to define/bind the 3rd parameter to variable RSLT but I'm not sure how. My code looks like the excerpt below. Any of you VARPG gurus who've used ODBC know how to accomplish this? Thank you very much. RF Rick Flagler Manager, Information Technology Projects Timken Super Precision (MPB) Keene, NH 03431 (603) 352-0310 +++++++++++++++++++++++++++++++++++++++++++++++ begin code +++++++++++ DQuote S 1A inz('''') DRSLT S 1A inz(' ') C PSB00011C0 BEGACT PRESS MAIN C If %Getatr('Main':'ODBC':'Connected')=1 C movel *blanks selall 50 C eval Selall = C* 'call ricklib/hjprc01(' + C* quote + '12345678' + quote + C* ',' + quote + '211TA88888' + quote + C* ',' + quote + 'X' + quote +')' C 'call ricklib/hjprc01(' + C quote + '12345678' + quote + C ',' + quote + '211TA88888' + quote + C ',' + ':RSLT' +')' C C* eval Selall = 'call ricklib/hjprc02()' C 'ODBC' Setatr SelAll 'SQLQuery' C 'ODBC' Setatr 1 'ExecuteSQL' C endif C ENDACT ++++++++++++++++++++++++++++++++++++++++++++ end code ++++++++++++++++++
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.