Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating Stored Procedure on z/OS DB2

Status
Not open for further replies.

pmking

IS-IT--Management
Mar 1, 2006
59
US
I am trying to create a stored procedure on z/OS DB2. After the create runs successfully, what is the next step so that DB2 knows it's there? When I run a program with sqlexec invoking a the stored procedure, it says it can't be found.

Here is the stored procedure.

create procedure sysproc.CCEXAM

(

in keyin char(16),

out hexout char(8)

)

language sql

modifies sql data

wlm environment ctenv

external name CCEXAM

result sets 1

select hex(substr(guid,1,8)) from guid_cust_assoc

where guid = keyin
 
pmking,
Have you granted execution to public? eg.
GRANT EXECUTE ON PROCEDURE SYSPROC.CCEXAM TO PUBLIC

You might also need to stop and start the proc. I only think this would be necessary if you are updating it, rather than creating a new one, but it's something to think about if you need to change it. You'd do it in DB2I option 7 (run commands) with the commands:
-STO PROC(SYSPROC.CCEXAM) ACTION(REJECT)
-STA PROC(SYSPROC.CCEXAM)
-DIS PROC(*)

Hope this helps,

Marc

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top