Solved

calling DB2 stored procedure from query tool

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
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…

747 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

12 Experts available now in Live!

Get 1:1 Help Now