Every program object on the iSeries can be called using the SQL call
command.

The only reason to go through the trouble of doing the CREATE PROCEDURE is
to let SQL know how to handle parameters.  Without an SQL procedure
definition it makes some assumptions about the parameters that may not be
correct.

Here's the relevant portion of the manual:

If the procedure-name identifies a procedure that was defined by a DECLARE
PROCEDURE statement, and the current server is a DB2 UDB for iSeries
server, then:
v The DECLARE PROCEDURE statement determines the name of the external
program, language, and calling convention.
v The attributes of the parameters of the procedure are defined by the
DECLARE PROCEDURE statement.

Otherwise:
v The current server determines the name of the external program, language,
and calling convention.
v If the current server is DB2 UDB for iSeries:
- The external program name is assumed to be the same as the external
procedure name.
- If the program attribute information associated with the program
identifies a recognizable language, then that language is used. Otherwise,
the language is assumed to be C.
- The calling convention is assumed to be GENERAL.
v The application requester assumes all parameters that are host variables
or
parameter markers are INOUT. All parameters that are not host variables are
assumed to be IN.
v The actual attributes of the parameters are determined by the current
server.
If the current server is a DB2 UDB for iSeries, the attributes of the
parameters will be the same as the attributes of the arguments specified on
the CALL statement. 45

HTH,
Charles


> -----Original Message-----
> From: Shaheen Ahmed [mailto:Syed.Ahmed@xxxxxxxx]
> Sent: Friday, June 25, 2004 9:46 AM
> To: MIDRANGE-L@xxxxxxxxxxxx
> Cc: Shaheen Ahmed
> Subject: SQL CALL Statement
> 
> 
> I wrote my first external stored procedure (calling an RPG 
> program) and used interactive SQL CALL statement to call the 
> stored procedure....It runs fine. Then I used CALL statement 
> in SQL to call the RPG program (not the external stored 
> procedure) and it run in the same way. I thought SQL CALL 
> statement is only to call a procedure. Does anybody knows why 
> I am able to call an RPG program using SQL CALL statement?. 
> Does all program objects are also stored as a procedure in 
> some database? 
> --
> This is the Midrange Systems Technical Discussion 
> (MIDRANGE-L) mailing list
> To post a message email: MIDRANGE-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/midrange-l
> or email: MIDRANGE-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/midrange-l.
> 

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.