Solved

calling DB2 stored procedure from query tool

Posted on 2012-03-26
2
1,558 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
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…

914 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now