Questions tagged [output-parameter]

output parameters allow stored procedures to return data to the calling code.

133 questions
2
votes
1 answer

Retrieve Stored Procedure Output Parameters in Entity Framework always null

C# code public List GetProducts() { var nameParam = new ObjectParameter("numbers", typeof(int)); List listobjs = new List(); …
2
votes
1 answer

How do I call stored proc in DB2 using raw SQL (LINQPad)

I have a stored procedure called MY_STORED_PROC. It has an integer input parameter and an integer output parameter. I've tried all manner of DECLAREs, BEGINs and ENDs and calls, and I've started to look into changing statement terminators (??), and…
sennett
  • 8,014
  • 9
  • 46
  • 69
2
votes
1 answer

qt call oracle stored procedure

I am using QsqlQuery to call oracle stored procedure that uses input parameters and two output parameters The procedure executed perfectly but output parameters contains no data QSqlQuery movementQuery ; movementQuery.prepare("call…
2
votes
2 answers

Using Spring's JDBC support to get output parameters

I'm using Spring's JDBC support to run SQL queries and updates on an Oracle database. I'd like to insert a row and then get the key that it was assigned (using an Oracle sequence). In normal JDBC code, I would include a RETURNING INTO clause and…
Austin Keeley
2
votes
3 answers

Return an output parameter from SQL Server via a stored procedure and c#

I am having a devil of a time getting an output value from SQL Server. Here is my stored procedure: ALTER PROCEDURE [dbo].[Insert_UnknownCustomer_Quote_Document] -- Add the parameters for the stored procedure here @NewDocumentFileName…
Darren
  • 793
  • 5
  • 17
  • 30
1
vote
2 answers

Why won't this SQL output parameter play nicely?

I have the following code. When I use breakpoints, I can see that ["@myID"].Value is a real value, such as 2467. However, I'm not able to cast that as a string for my tryParse. I've tried using "as string" like below, and I've also tried…
WEFX
  • 8,298
  • 8
  • 66
  • 102
1
vote
0 answers

Get message of Raiserror SQL or change value of output parameter

Using SQL Server, I'm executing a stored procedure that may sometimes throw a Raiserror and sometimes not. Now I tried to use the returned parameter for tests, but it is not passed errCount=-1 query="exec [db\].[testErrGoLang] @dev=10, @dev2=0 …
Spison
  • 21
  • 2
1
vote
1 answer

Dapper - Get value of output parameter from stored procedure

Without using Dapper, this code returns the correct result of "true": using(connection= new SqlConnection(connectionString)) { using(var cmd = connection.CreateCommand()) { cmd.CommandText= query; cmd.CommandType=…
Ibanez1408
  • 4,550
  • 10
  • 59
  • 110
1
vote
2 answers

C#: Retrieve output parameter of non-parametrized stored procedure query?

I have this stored procedure CREATE PROCEDURE [dbo].[TestProcedure] @param1 int = 0 ,@param2 int = 0 ,@total_sales int = 5 OUTPUT AS BEGIN SET NOCOUNT ON; SET @total_sales = @total_sales * 5 SELECT * FROM…
Stefan Steiger
  • 78,642
  • 66
  • 377
  • 442
1
vote
1 answer

How to assign result of OUTPUT DELETED to an output parameter?

I have the following query that generates the next available bill of lading numbers. ALTER PROCEDURE [dbo].[GetNextTruckBol] @FacilityId INT, @Count INT = 1 AS BEGIN SET NOCOUNT ON; UPDATE Facilities SET NextTruckBol =…
Jonathan Wood
  • 65,341
  • 71
  • 269
  • 466
1
vote
2 answers

How can I prevent caller to my function from using the same pass-by-reference variable in C++?

I have a legacy interface that has a function with a signature that looks like the following: int provide_values(int &x, int &y) x and y are considered output parameters in this function. Note: I'm aware of the drawbacks of using output parameters…
Billy
  • 5,179
  • 2
  • 27
  • 53
1
vote
2 answers

Stored procedure with OUTPUT - Must declare the scalar variable

I'm writing a stored procedure that will be executed from C# to get data from database. Therefore I have to pass a GUID to this stored procedure and it should find data in table Contact or in the Lead table & return data back to C# app via output…
1
vote
2 answers

How do I get Oracle output variable data in .net

I am working with Oracle in .net using the ODP.NET. I was wondering how I get the variables from an out variable when calling a stored procedure. What I have currently is... using(IDataReader reader = defaultDB.ExecuteReader("CalledStoredProc",…
SoftwareSavant
  • 9,467
  • 27
  • 121
  • 195
1
vote
2 answers

How can i get @rErr / Output Parameter value in c#?

I create a SQL stored procedure create proc p1 ( @name1 nvarchar(50), @rErr int OUTPUT ) as begin Transaction insert into test (name1) values (@name1) if @name1 = 'n100' Begin Rollback Transaction Set…
Toufiq
  • 21
  • 3
1
vote
1 answer

returning output parameter from Oracle stored proc

I am trying to set the value of the output parameter thirdPartyId, but I am getting an error saying missing or invalid option at the set thirdPartyId statement. PROCEDURE usp_insert_user( userType VARCHAR2, …
kralco626
  • 8,456
  • 38
  • 112
  • 169
1 2 3
8 9