473,407 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

CALL Procedure with OUTPUT parameters

I am a little confused. If i have an SP like:

CREATE PROCEDURE ABC (IN ID Integer,
OUT TEST1 Integer,
OUT TEST2 Integer)
....

How do you call this SP?

CALL ABC(varID, varTEST1, varTEST2);
This is compiling without error for me.

or

CALL ABC(varID, ?, ?);
However this is compiling with an error, yet IBM online help refers to using
this.

Am i doing something wrong?
Also, right now the DB2 database is on a Windows Server. I notice that the
Stored procedures have TABS in them. Will this cause any problem if we move
the database to a UNIX box?
Thank you



Nov 12 '05 #1
2 18371
Hi,
If SP is compiled successfully, then you call it as follows.
CALL ABC(50, ?, ?)

Chears,
Thiru
WantedToBeDBA.

--
Message posted via http://www.dbmonster.com
Nov 12 '05 #2
serge wrote:
I am a little confused. If i have an SP like:

CREATE PROCEDURE ABC (IN ID Integer,
OUT TEST1 Integer,
OUT TEST2 Integer)
...

How do you call this SP?

CALL ABC(varID, varTEST1, varTEST2);
This is compiling without error for me.

or

CALL ABC(varID, ?, ?);
However this is compiling with an error, yet IBM online help refers to using
this. What's the error you get? How to you invoke the CALL.
From the command line it shoudl work as is.
Embedded (i.e. inside another stored procedure) you will need to return
the result into some variable.
I think EXECUTE and EXECUTE IMMEDIATE supply an INTO clause for this
puprose.
Am i doing something wrong?
Also, right now the DB2 database is on a Windows Server. I notice that the
Stored procedures have TABS in them. Will this cause any problem if we move
the database to a UNIX box?

No problem.

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft...
3
by: Chris | last post by:
Hello everyone I want to call a DB2 7.2 stored procedure via ADO in VC++ 7.1 It has 4 parameters, the 1st and the 4th are OUTPUT and the others are INPUT params. My code looks like this:...
5
by: Amaryllis | last post by:
I'm trying to call a CL which is located on our AS400 from a Windows application. I've tried to code it in different ways, but I seem to get the same error every time. Does anyone have any clue...
6
by: SandySears | last post by:
I am trying to use a stored procedure to insert a record using VS 2005, VB and SQL Server Express. The code runs without errors or exceptions, and returns the new identifer in the output...
11
by: cj | last post by:
I need to call a stored procedure that passes back 2 strings. I don't think I need a data adapter or a select command or a command builder. So after I create the connection what do I do? Dim...
0
by: IamtheEvster | last post by:
Hi All, I am currently using PHP 5 and MySQL 5, both on Fedora Core 5. I am unable to call a MySQL stored procedure that returns output parameters using mysql, mysqli, or PDO. I'm having a...
4
by: Pakna | last post by:
Hi, is there any way to call a JAVA stored procedure from a SQL Trigger? We are having difficulties with this and cannot verify whether DB2 even *has* this capability? Thank you very much....
3
by: david | last post by:
I have trouble with it. I have created a sproc in SQL Server, called SearchClass, which returns a searched key from a table. I have tested this procedure in Analyzer and it works fine. However,...
0
by: pbaillard | last post by:
Here a sample to call a stored procedure with an Oracle Database. odc.Connection = m_cDb ' use an open connection to your database odc.CommandType = CommandType.StoredProcedure odc.CommandText =...
3
by: .Net Sports | last post by:
I need to call an stored procedure from an asp script, I don't need to do an Output parameter, only input parameters on 3 vars, but I get a "BOF EOF not true or record has been deleted" error when...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.