473,378 Members | 1,578 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,378 software developers and data experts.

Parameter value differs on my procedure

1
Hi,
I have written a procedure, but it is not showing the proper output. As i am a beginner unable to find it out. My desired output is an set of records from a table.
this is my procedure:

Expand|Select|Wrap|Line Numbers
  1. CREATE PROCEDURE FIVESTAR (IN TB_SCHEMA VARCHAR(1024),IN TB_NAME VARCHAR(1024),OUT QUERY1 VARCHAR(1024))
  2. DYNAMIC RESULT SETS 1
  3. LANGUAGE SQL
  4. P1: BEGIN
  5. -- Declare cursor
  6. DECLARE V_DYNAMIC VARCHAR(1024);
  7. DECLARE V_SQL VARCHAR(5500);
  8. ---DECLARE TB_NAME VARCHAR(1024);
  9.  
  10. DECLARE cursor1 CURSOR WITH RETURN for V_DYNAMIC;
  11. SET V_SQL = 'SELECT * FROM ' CONCAT TB_SCHEMA CONCAT '.' CONCAT TB_NAME;
  12.  
  13. PREPARE V_DYNAMIC FROM V_SQL;
  14. OPEN cursor1;
  15. FETCH cursor1 INTO QUERY1;
  16. CLOSE cursor1;
  17.  
  18. -- Cursor left open for client application
  19. --OPEN cursor1;-----
  20. END P1

Output:

db2 => call fivestar('VENKATASD','STAFF',?);

Value of output parameters
--------------------------
Parameter Name : QUERY1
Parameter Value : 10

Return Status = 0

Please correct me , how to clear this.
Jul 31 '14 #1
0 1035

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: test | last post by:
why does this code cause the "Parameter count does not match Parameter Value count" error.??? Dim arGetaffManageparms() As System.Data.SqlClient.SqlParameter = New...
4
by: Laszlo Csabi | last post by:
Hi Folks, Can someone explain me why I'm getting the following error? The error message I got is : "Parameter count does not match Parameter Value count."
3
by: thomas goodwin | last post by:
I have a query which asks for a parameter value to execute it. To see the results I have to: a) click on the query -- the "Enter Parameter Value" window pops up. b) enter the parameter value c)...
1
by: Hrvoje Voda | last post by:
How to get a parameter from store procedure ? Hrcko
1
by: Hrcko | last post by:
How to read a parameter from store procedure? I want to get a number of rows for the specific tabel. The parameter is @@ROWCOUNT. Hrcko
2
by: mikejacobz | last post by:
Hi, I am using the Enterprise Application Blocks (Data Access Application Block 2005) and all I want to do is pass in a date as a parameter to a Stored procedure. e.g private void...
1
by: yoursteveis | last post by:
Dear all, I have created a main report (for monthly purchase summary) and a sub report (for monthly sales summary). I have linked main report with a parameter query (i.e. purchasesummary1) and...
1
by: smak | last post by:
hi to all I am calling a sql stored procedure from vb. Sub IO_ORGANISER() Dim objcmd As New ADODB.Command objcmd.CommandText = "IOScheduler" objcmd.CommandType =...
0
by: Sudarsana | last post by:
How to retrieve output parameter value in ASp from Stored Procedure
1
mgpsivan
by: mgpsivan | last post by:
Hi, Is this possible in MySQL 5.0....? Can we pass an optional parameter to a procedure. Like SQL Shall we set a default value to the parameter of a Procedure in MySQL 5.0 Thanks, Sivan.G
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.