Solved

calling DB2 stored procedure from query tool

Posted on 2012-03-26
2
1,636 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Many to Many From without subform 11 81
how to solve "recursive" database tables 2 59
SQL: splitting Columns 6 40
Access Data Retrieval 1 14
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…
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
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…

751 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