Solved

calling DB2 stored procedure from query tool

Posted on 2012-03-26
2
1,575 Views
Last Modified: 2012-03-30
Hello Experts,

i am trying to call DB2 stored procedure from a query tool - sqldbx...

1 input parameter and all others are output parameters..

i am getting some error:

here is my code:


DECLARE @AD_USR_ID VARCHAR(64)
DECLARE @LAST_NAME VARCHAR(64)
DECLARE @FIRST_NAME VARCHAR(64)
DECLARE @MI CHAR(1)
DECLARE @EMP_UNIQ_ID DECIMAL(10,2)
DECLARE @JOBCODE CHAR(6)
DECLARE      @LOCATION CHAR(4)
DECLARE      @PYRAMID CHAR(2)
DECLARE      @SUPERVISOR DECIMAL(10,2)
DECLARE      @WORK_PHONE_NUM VARCHAR(15)
DECLARE      @CELL_PHONE_NUM VARCHAR(15)
DECLARE      @HOME_PHONE_NUM VARCHAR(15)
DECLARE      @EMAIL_ADDRESS VARCHAR(64)
DECLARE      @RETCODE INTEGER
DECLARE      @RETMSG CHAR(32)

SET @AD_USR_ID = 'ISPA4'

EXEC('CALL MRSSI.DP001SP(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',
@AD_USR_ID, @LAST_NAME output, @FIRST_NAME output, @MI output, @EMP_UNIQ_ID output,
@JOBCODE output, @LOCATION output, @PYRAMID output, @SUPERVISOR output,
@WORK_PHONE_NUM output, @CELL_PHONE_NUM output,
@HOME_PHONE_NUM output, @EMAIL_ADDRESS output, @RETCODE output, @RETMSG output)
at TEST

SELECT Lastname = @LAST_NAME, FirstName = @FIRST_NAME


------------------------------

 SQL0104N  An unexpected token "VARCHAR" was found following "VARCHAR".  Expected tokens may include:  "TABLE STATEMENT , . SCROLL INSENSITIVE SENSITIVE ASENSITIVE N".  SQLSTATE=42601



what i am missing...

Thanks
0
Comment
Question by:mani_sai
2 Comments
 
LVL 37

Accepted Solution

by:
momi_sabag earned 500 total points
ID: 37767463
that all depends on the client tool which you use, that apperantley does not support this kind of operation
try downloading ibm data studio and do it through there
http://www.ibm.com/developerworks/downloads/im/data/
0
 
LVL 8

Author Closing Comment

by:mani_sai
ID: 37788378
Thanks
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Database tuning – How to start and what to tune. This question is frequently asked by many people, both online and offline. There is no hard and fast rule-of-thumb for performance tuning, however, before beginning the tuning process one should a…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question