Camillia
asked on
can a stored proc call RPG program?
We have an RPG program and I want to call it from my stored proc in AS400...
The RPG program formats something and I need to call it and use the returned result...
The RPG program formats something and I need to call it and use the returned result...
ASKER
Stored Proc is in AS400's SQL language...
Because I dont know RPG and my boss wants AS400 code in SQL to be similar to the SQL Server stuff we do...
Give me good news :)
Because I dont know RPG and my boss wants AS400 code in SQL to be similar to the SQL Server stuff we do...
Give me good news :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Momi is right. Wrap the RPG as a stored procedure.
e.g.
CREATE PROCEDURE MyLib/TheStoredProcName (
IN parameter1 ....
OUT outputParam1
)
LANGUAGE RPGLE
NOT DETERMINISTIC
MODIFIES SQL DATA
CALLED ON NULL INPUT
EXTERNAL NAME theRPGpgm
PARAMETER STYLE GENERAL WITH NULLS;
-- DaveSlash
ASKER
can it be as a function instead of a stored proc? Because i want to call it and return a value back...
Also, can u answer my other question here ..please ..ithink u said you've done C function in AS400...
Kent's been helping also...
http://www-new.experts-exchange.com/questions/22151096/What's-wrong-with-this-C-user-defined-function.html?qid=22151096&cid=239
Also, can u answer my other question here ..please ..ithink u said you've done C function in AS400...
Kent's been helping also...
http://www-new.experts-exchange.com/questions/22151096/What's-wrong-with-this-C-user-defined-function.html?qid=22151096&cid=239
ASKER
Please ignore my comment about helping with the other question, i think i found my answer...
but for the RPG one...the RPG goes inside that "CREATE PROCEDURE MyLib/TheStoredProcName " OR
is the RPG just compiled on AS400, then I created that stored proc...call the stored proc which then calls the RPG?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can call any RPG program without declaring stored procedure.
See http://www.venera.com/downloads.htm#db2sp
Look for the "iSeries DB2 stored procedures vulnerability" article.
See http://www.venera.com/downloads.htm#db2sp
Look for the "iSeries DB2 stored procedures vulnerability" article.
ASKER
The RPG name is 11 chars and I'm getting an error that "<rpgname> too long. Maximum 10 characters."..
wrapped it around single quotes too...no way around it? have to rename the RPG program?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
hmm..that's what my manager gave me..i'll double check it again with her
why not writting the stored procedure in RPG also ?