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

Stored procedure with output variable

JC
Can someone post a working stored procedure with output variable that
works on northwind db or explain to me what I am missing. I've tried
ever tying but it always returns @outvariable parameter not supplied.
I've read everything but must be missing something. Here is an sample
SP that I can't get to work.
_____________________________________

CREATE PROCEDURE SampleProcedure
@out smallint OUTPUT
AS
Select @out = count(*) from titles
GO
_____________________________________
This errors and returns-
Server: Msg 201, Level 16, State 4, Procedure SampleProcedure, Line 0
Procedure 'SampleProcedure' expects parameter '@out', which was not
supplied.
What am I missing with this?
Frustrated,
Jeff
Jul 20 '05 #1
2 18971
Hi

Try:

DECLARE @outvariable smallint
EXEC SampleProcedure @outvariable OUTPUT
PRINT @outvariable

John
"JC" <uj*****@charter.net> wrote in message
news:b8**************************@posting.google.c om...
Can someone post a working stored procedure with output variable that
works on northwind db or explain to me what I am missing. I've tried
ever tying but it always returns @outvariable parameter not supplied.
I've read everything but must be missing something. Here is an sample
SP that I can't get to work.
_____________________________________

CREATE PROCEDURE SampleProcedure
@out smallint OUTPUT
AS
Select @out = count(*) from titles
GO
_____________________________________
This errors and returns-
Server: Msg 201, Level 16, State 4, Procedure SampleProcedure, Line 0
Procedure 'SampleProcedure' expects parameter '@out', which was not
supplied.
What am I missing with this?
Frustrated,
Jeff

Jul 20 '05 #2
JC
Thank you John, worked as I've been expecting.
Jeff

"John Bell" <jb************@hotmail.com> wrote in message news:<LN*******************@news-text.cableinet.net>...
Hi

Try:

DECLARE @outvariable smallint
EXEC SampleProcedure @outvariable OUTPUT
PRINT @outvariable

John
"JC" <uj*****@charter.net> wrote in message
news:b8**************************@posting.google.c om...
Can someone post a working stored procedure with output variable that
works on northwind db or explain to me what I am missing. I've tried
ever tying but it always returns @outvariable parameter not supplied.
I've read everything but must be missing something. Here is an sample
SP that I can't get to work.
_____________________________________

CREATE PROCEDURE SampleProcedure
@out smallint OUTPUT
AS
Select @out = count(*) from titles
GO
_____________________________________
This errors and returns-
Server: Msg 201, Level 16, State 4, Procedure SampleProcedure, Line 0
Procedure 'SampleProcedure' expects parameter '@out', which was not
supplied.
What am I missing with this?
Frustrated,
Jeff

Jul 20 '05 #3

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

Similar topics

6
by: Shaun Stuart | last post by:
I've got a webpage that calls some stored procedures with input variables. The procedures return recordsets and also some output variables. We're trying to get the values of the output variables....
3
by: Jarrod Morrison | last post by:
Hi all Im relatively new to using stored procedures and im not sure if it is possible to do what I am trying to do so any help here is greatly appreciated. I am using the variable @MachineName...
5
by: Member | last post by:
Hi All. Maybe someone in here could help on this too.... Uusally I can return a value from a stored procedure without any problem. Today I ran into something I cannot figure out. ...
3
by: Jarrod Morrison | last post by:
Hi All I have a stored procedure with a temporary table that with two columns in it. The first column contains 3 digit numbers and the second column some descriptive data. I was wondering what...
4
by: MD | last post by:
I am trying to create a dynamic SQL statement to create a view. I have a stored procedure, which based on the parameters passed calls different stored procedures. Each of this sub stored procedure...
1
by: Compkitty | last post by:
Hi, I'm sort of new to Stored Procedures; and I'm building a search page where there are 9 parameters the user can put in; as little as 1, at most 9.. then it runs the Stored P and looks at the...
2
by: Michael | last post by:
Running DB2 v7 UDB ("DB2 v7.1.0.93", "n031208" and "WR21333") on Windows XP, I am unable to find out why the "Build for Debug" option within Stored Procedure Builder is not enabled on Java stored...
5
by: Wael | last post by:
Hi, I have the following stored procedure that does some processing and puts the result in a temporary table. I tried several things that procedure to display output that I can access with...
9
by: fniles | last post by:
I am using VB.NET 2003 and SQL2000 database. I have a stored procedure called "INSERT_INTO_MYTABLE" that accepts 1 parameter (varchar(10)) and returns the identity column value from that table....
12
by: Dooza | last post by:
I have a stored procedure that takes a number of inputs, does a bulk insert, and then outputs a recordset. When I run the stored procedure in Server Management Studio I also get a return value from...
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
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...
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...

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.