View Full Version : SQL CALL with INOUT
Guest.Visitor
01-01-1995, 02:00 AM
Does anybody have an example of an SQL CALL from a REXX program using INOUT parameters defined on the CREATE PROCEDURE statement? It seems this may not be possible, though I can not find anything specific that suggests it; in fact just the opposite. There is doc from which I infer there is the possibility to pass the parms via an SQLDA -- my inference that if not allowed via a simple EXECUTE on a PREPAREd "CALL CRP/TEST ( ? )" then EXECUTE USING DESCRIPTOR should work since the REXX is supposed to automatically reserve storage in the SQLDA. Since I can get CL to return via &VAR_NAME, I would expect the ability similarly via SQL; rather daft otherwise IMO. Regards, Chuck Comments provided "as is" with no warranties of any kind whatsoever.
Guest.Visitor
11-17-1998, 12:38 AM
Does the ADDRESS command allow you to 'Address' SQL; Otherwise aren'tCommands passed to the 400 CL processor? <HR>...... <pre> <H4>Bob Hamilton TEXAS BUSINESS SYSTEMS 736 Pinehurst Richardson, Texas 75080 <h4> </pre></h4></h4>
Guest.Visitor
11-17-1998, 06:43 AM
<pre> address "*EXECSQL" execsql "set transaction isolation level no commit" execsql "drop procedure crp/tstrtn" execsql "CREATE PROCEDURE CRP/TSTRTN", " ( INOUT rcv CHAR (2000), INOUT rcvlen CHAR ( 4))", "LANGUAGE CL NOT DETERMINISTIC NO SQL ", "EXTERNAL NAME CRP/TSTRTN PARAMETER STYLE GENERAL " rv=COPIES(X2C('01'),2000) rl=X2C('000007D0') call rqssql; say sqlcode '::' sqlstate; say left(c2x(rv),35); say x2d(left(c2x(rl),8)) call rqsclp; say sqlcode '::' sqlstate; say left(c2x(rv),35); say x2d(left(c2x(rl),8)) exit rqssql: procedure expose rv rl RqsRtv="CALL CRP/TSTRTN ( ? , ? )" execsql "PREPARE Rtv FROM :RqsRtv" execsql "EXECUTE Rtv USING :RV, :RL" return rqsclp: procedure expose rv rl address command "CALL CRP/TSTRTN ( &RV &RL )" return </pre> The CLP CRP/TSTRTN sets the data addressed by the first parameter as all X/C1 characters for the %BIN(&P1 1 4) of the second parameter, and return %BIN(&P1 1 4) as 4095. The function is not of interest and obviously can be accomplished in other ways... the point is only to get the INOUT on the CREATE PROCEDURE working; or to find documentation which clearly states this should not be possible. Then on to determine why, since the REXX/CL CALL interface obviously can accomplish effectively what is desired; why not REXX/SQL CALL interface. The output from STRREXPRC of the above: <pre> 0 :: 00000 01010101010101010101010101010101010 2000 0 :: 00000 C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C1C 4095 </pre> Regards, Chuck Comments provided "as is" with no warranties of any kind whatsoever.
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.