× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Darrell,

The syntax you have below looks okay but have you defined the stored procedure yet? In this case, you are using an external stored procedure so all you are doing is providing parameter definitions and a pointer to the actual program.

The SQL books in the InfoCenter have this information in them. I think you want to look in the SQL programming book but it's been so long since I needed to look that up that I don't recall if that is the correct one or not.

You can also prompt the CREATE PROCEDURE command from STRSQL and work through the screens. Make sure you read the provided help for the various options if you choose to skip the documentation in the InfoCenter.

Matt

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of DLee@xxxxxxxx
Sent: Wednesday, March 25, 2009 10:49 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re:Stored Procedure

Thanks Charles;

<You can't call a stored procedure with the RPG CALL/CALLP op-code.>
<You must use the SQL CALL statement.>
<exec SQL CALL STR004SP (....);>

I guess I don't know what you mean, or how to do it.
Here is what I did, but I just get invalid token errors on PSCOCD parm.
Probably because I'm still not calling the program correct?
I've never called a rpg program using sqlrpgle before, only done selects
and updates.
Have looked thru the internet, but nothing comees up.

Can you be more specific on the call, or point me to a manual on how this
works.

D GetPgm PR EXTPGM('STR004SP')
D COCD 2
D AGNT 10
D POLM 10
D POLS 3 0
D COVC 3 0
D CANDT 8 0
D REF 9 2
D RTNCD 2

C/EXEC SQL
C+ CALL STR004SP(PSCOCD:PSAGNT:PSPOLM:PSPOLS
C+ :PSCOVC:$CANDT:PRMREF:RNCODE)
C/END-EXEC

Appreciate your help.


Darrell Lee
Information Technology
Extension 17127

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.