|
You can't have a parameter as a data structure subfield. Hence the SQL preprocessor is crapping out when tries to pass the input parm in the data structure it generates. Put the field in the program like this: D myString S D inString S Like(myString) *ENTRY PLIST myString PARM InString Everything else leave the same, and it should work. -Bob Cozzi www.RPGxTools.com RPG xTools - Enjoy programming again. -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Mike Cunningham Sent: Thursday, April 06, 2006 8:52 AM To: rpg400-l@xxxxxxxxxxxx Subject: RPG Stored Procedure returning a BLOB I want to return a BLOB field from an RPG program that is being used as a stored procedure. I can create the BLOB field and get the data in it that I want but when I add the BLOB field to the *ENTRY parameter list to pass it back I get a compiler error that the BLOB field can be initialized. I defined a large string and a BLOB like this MyString S 20000 MyBlob S SQLTYPE(BLOB:20000) I put the data I want to return in MyString and then use this SQL command to put in the BLOB field C/EXEC SQL C+ SET :MYBLOB = BLOB(:MYSTRING) C/END-EXEC Doing this compiles OK and I can run the app and see the data in both MyString and MyBlob in debug. When I add this line of code I get the compiler error C *ENTRY PLIST C PARM MyBlob *RNF7306 20 1 The initial value for a pointer field is not valid. The initial value for pointer field SQL_00006 is not valid. DS SQL_00000 1 2B 0 INZ(128) SQL_00001 3 4B 0 INZ(1) SQL_00002 5 8B 0 INZ(0) SQL_00003 9 9A INZ('0') SQL_00004 10 128A SQL_00005 129 20128A SQL_00006 * INZ(%ADDR(MYBLOB))
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.