RE: Mainframe DB2 - Creating Stored Procedure

RE: Mainframe DB2 - Creating Stored Procedure

 

  

Hi Ramon,
Put BEGIN and END before SELECT & after SELECT respectively and build.

Cheers

-----Original Message-----
From: Ramon Santiago
[mailto:db2udbdba-ezmlmshield-x95780221.[Email address protected]
Sent: Thursday, July 27, 2006 11:56 PM
To: LazyDBA Discussion
Subject: Mainframe DB2 - Creating Stored Procedure
Importance: Low

Question....

I created the following stored procedure, I don't know if it is
accurately coded. Any assistance is appreciated.

CREATE PROCEDURE SPACCT_SID
( IN ACCT_CLIENT CHAR(02)
, IN ACCT_SUB_CLIENT SMALLINT
, IN ACCT_NM DEC(15)
, OUT SID INTEGER)
LANGUAGE SQL
WLM ENVIRONMENT DBT1WLM
ASUTIME LIMIT 3000
EXTERNAL NAME 'SPACCT'
RESULT SETS 1
READS SQL DATA
SELECT ACCT_SID
FROM DB2P6210.ACCT
WHERE CLIENT = ACCT_CLIENT
AND SUB_CLIENT = ACCT_SUB_CLIENT
AND ACCT_NUM = ACCT_NM ;

When I run the following call to run the query, I get errors..

CALL DB2P6210.SPACCT_SID('YG',0,106) ;


Errors....

CALL DB2P6210.SPACCT_SID('YG',0,106) ;

---------+---------+---------+---------+---------+---------+---------+--
DSNT408I SQLCODE = -84, ERROR: UNACCEPTABLE SQL STATEMENT
DSNT418I SQLSTATE = 42612 SQLSTATE RETURN CODE
DSNT415I SQLERRP = DSNHAPLY SQL PROCEDURE DETECTING ERROR
DSNT416I SQLERRD = 101 0 0 -1 3 0 SQL DIAGNOSTIC INFORMATION
DSNT416I SQLERRD = X'00000065' X'00000000' X'00000000' X'FFFFFFFF'
X'00000003' X'00000000' SQL DIAGNOSTIC INFORMATION


---------------------------------------------------------------------
PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
website: http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html



DISCLAIMER:
This message contains privileged and confidential information and is intended only for the individual named.If you are not the intended recipient you should not disseminate,distribute,store,print, copy or deliver this message.Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted,corrupted,lost,destroyed,arrive late or incomplete or contain viruses.The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version.

DB2 & UDB email list listserv db2-l LazyDBA home page