Re: Stored Procedure calling RPGLE



A common problem using the given procedure definition, would be the use of CHAR versus VARCHAR. Unless the type is defined by a field or bound in a program, the VARCHAR must be used because the SQL will type the parameter as VARCHAR. If not, then SQL0204 would be the result. Review of the joblog for the failed call request would probably show an error message. If that does not resolve, some thoughts:
Specifically in each case, how was the procedure invoked. What is meant by 'send me a message'? A message sent to an external message queue would seem to be the best method to verify. What was the SQLcode for the SQL CALL? Was the CALL from RPG actually an SQL CALL from SQLRPG? If not, then probably best to work from there. The Run SQL Scripts where a request to CALL MYLIB.SP_WEBAUTH ('A', 'A', ?) is both functional and somewhat simplified as compared with embedded.

Regards, Chuck
--
All comments provided "as is" with no warranties of any kind whatsoever and may not represent positions, strategies, nor views of my employer

Matt wrote:
I am having a problem with a stored procedure that calls an RPGLE
program. When calling the stored procedure from a PHP or an ODBC
connection, the RPG program never executes. When I calling it from
IBM iSeries Access or another RPG program, it executes fine. I know
this because I have the program send me a message with the job
information when it executes. I don't receive those messages when I
execute it via PHP or an ODBC connection.

Below is the code for the stored procedure. I assume the problem is
in this code or is related to how something is configured. Any help
(or tips) would be appreciated, because I am pretty much stuck.

DROP PROCEDURE MYLIB.SP_WEBAUTH;
CREATE PROCEDURE MYLIB.SP_WEBAUTH (IN var1 CHAR(15),
IN var2 CHAR(6),
OUT valid CHAR(1))
LANGUAGE RPGLE
PARAMETER STYLE GENERAL
DYNAMIC RESULT SETS 0
EXTERNAL NAME 'MYLIB/WEBAUTH'

.



Relevant Pages

  • Re: Db2dclgn Indicator variables
    ... It is true that "49-levels" are used by most SQL products for holding ... I'd love to see a COBOL that supports the ANY LENGTH PREFIXED ... clause for a much more natural VARCHAR. ... I'd also love to see some kind of COBOL support for "null" values. ...
    (comp.lang.cobol)
  • Re: how to insert xml into sql 2005
    ... For right now I just know I have to get this into the sql database. ... to XML processing no matter how big the XML document is. ... ,captionnohtml varchar 'CaptionNoHTML' ...
    (microsoft.public.sqlserver.xml)
  • Re: Append to SQL Server
    ... IF it is varChar then perhaps you can use the Trim or RTrim function on the memo field in the query. ... It is possible that the Access memo field does contain trailing spaces depending on how the data got into the memo field. ... It works fine except if the field has 10 characters, 245 blank spaces are put at the end in SQL Server. ...
    (microsoft.public.access.queries)
  • Re: Inserting an Email Address fails.
    ... 'Position' VARCHAR NOT NULL, ... "You have an error in your SQL syntax. ... corresponds to your MySQL server version for the right syntax to use ...
    (perl.dbi.users)