Stored procedure from PRGLEV program

895 pts.
Tags:
AS/400
AS/400 development
RPG
Hi, I'm calling a stored procedure from RPGLEV program. I'm getting error pointer not set for location referenced. the SP has 3 parameters, numeric, numeric, Character my call stmt is CallP  SP_Prototype(num1:num2:Char1) The program crashes....any thoughts? thanks, NG

Software/Hardware used:
AS400-RPGLEV

Answer Wiki

Thanks. We'll let you know when a new response is added.

and prior to the call you
1. Substantiated (that’s a great word we don’t use in 400 land)
these variables with D spec-s — not the prototype specs but stand-alone or data structure.

2. put values in num1:num2:Char1

Phil

——————-
what about the parameter list of ST_samp1 ???
Phil

——————-

“CALLP” is not how you call a stored procedure from RPGLE. If this truly is a stored procedure, you call it using embedded SQL. If it’s a “subprocedure” in another *MODULE or *SRVPGM, then CALLP would be one of the correct ways top call it.

If it is a “subprocedure”, is it in a library that’s on your library list at run time?

Michael
——————
I think Michael is right — cannot find any callp to procedure.
SQL CALL to the created procedure should be used.
If ST_samp1 where an RPGLE or CL program then CALLP could be used.

Phil
—————-
Stored procedures can be defined with an “external program”, they basically pass the parameters coming in to an RPGLE or CL program and receive results back and pass them forward to the caller. Stored procedures can also be defined with an SQL body which processes the request internally. If it were calling an external program then you could call that program directly from your RPGLE program.

I’m assuming that ST_samp1 is some object related to your stored procedure.

Phil

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Nutangujar
    yes, the prototype is D SP_Prototype Pr extpgm('ST_samp1') D 7 0 D 7 0 D 26A Var declare D char1 S 26A D num1 S 7 0 D num2 S 7 0 debug shows the right numeric and character values....too...in those parms...
    895 pointsBadges:
    report
  • Nutangujar
    thanks. i changed the program to use SQL. One more thing is---If ST_samp1 where an RPGLE or CL program then CALLP could be used. what is ST_samp1 ???
    895 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following