output-parameter

Returning SQL Server Output parameter to C# by Stored Procedure

帅比萌擦擦* 提交于 2019-12-25 03:05:17
问题 I have a stored procedure in SQL Server 2012 with an OUTPUT parameter. When I call the c# decrypt function, at the point when I hit ExecuteNonQuery() , I always get the error: Procedure or function 'DecryptCCode' expects parameter '@decryptedStr', which was not supplied. How do I get the OUTPUT value of my stored procedure in code? Thanks. Stored procedure: ALTER PROCEDURE [dbo].[DecryptCCode] @decryptedStr nchar(5) OUTPUT AS BEGIN SET NOCOUNT ON; IF NOT EXISTS (SELECT * FROM sys.symmetric

Informix: procedure with output parameters?

独自空忆成欢 提交于 2019-12-24 10:16:09
问题 I searched a lot, but couldn't find anything.. I just want to ask if there's any way to create and call a procedure ( Informix ) with out parameters. I know how to return one or more values (for procedures and for functions), but this is not what I want. It would be really strange, if Informix does not allow output parameters.. Thanks in advance! EDIT : Yes, I saw it's possible, but I still can't execute such procedure. For example: CREATE PROCEDURE mytest(batch INT,OUT p_out INT) DEFINE inc

How to pass output parameter to a Stored Procedure?

半城伤御伤魂 提交于 2019-12-20 12:46:09
问题 I have written a stored procedure with the following format: ALTER PROCEDURE usp_data_migration (@sourceDatabase varchar(50), @sourceTable varchar(50), @targetDatabase varchar(50), @targetTable varchar(50), @finaloutput varchar(max) output) AS BEGIN ----Set of SQL Blocks END Then, I am executing the procedure: DECLARE @finaloutput1 varchar(300) EXEC usp_data_migration 'Yousuf', 'emp', '[City Branch]', 'emp_tgt', @finaloutput1 output SELECT @finaloutput1 By executing this way I don't proper

PHP bindParam does not seem to work with a PARAM_INT out parameter

笑着哭i 提交于 2019-12-13 04:28:37
问题 The following is my MySQL stored procedure: DROP PROCEDURE IF EXISTS sp_authenticate; CREATE PROCEDURE sp_authenticate(IN user_name VARCHAR(50), IN password1 VARCHAR(50), OUT nmatch INT) BEGIN SELECT COUNT(*) INTO nmatch FROM user1 u WHERE u.name = user_name AND u.password1 = password1; END// This is how I am calling it from PHP: function authenticate($pdo, $user_name, $password){ $stmt = $pdo->prepare('CALL sp_authenticate(:user_name, :password, :nmatch)'); $stmt->bindValue(':user_name',

Output parameter of MySQL stored procedures via ADODB in MS Access (VBA) correct on one computer and random on another

有些话、适合烂在心里 提交于 2019-12-12 18:25:57
问题 I have tried (nearly) everything to isolate the problem, but I am lost. I have an MS Access application that uses ADODB to interface to a local MySQL database. I copied it to a new computer, but now the output parameters of the stored procedures contain a random value each time (if done via ADODB). When executed in MySQL WorkBench, the output parameters are correct. Here are the specs of the 2 computers: old : Windows 7 Pro, Office 2010 ProPlus, MySQL ODBC 5.3.4, MySQL server 5.6.22 (all are

PetaPoco and output parameters from stored procedures?

不问归期 提交于 2019-12-12 13:04:39
问题 I'm trying to setup an output parameter using PetaPoco. I found someone using this sample online: var ctx = new CustomDBDatabase(); var total = new SqlParameter("Total", System.Data.SqlDbType.Int); total.Direction = System.Data.ParameterDirection.Output; var results = ctx.Query<DBEntity>("exec GetDBEntities @StartIndex, @MaxIndex, @TotalCount = @Total out", id, start, max, total); int totalCount = (int)total.Value; However, total.value returns null, even though when I run this statement

SQLAlchemy get output parameters from a postgresql stored procedure

可紊 提交于 2019-12-11 03:57:21
问题 I am using Postgresql9.2 and SQLAlchemy0.8 . I have a stored procedure in database which has many out parameters and i want them to use by dot notation. But so far I have failed miserably. Below is how my code looks like. An example to show what i am doing is as follows. CREATE OR REPLACE FUNCTION stored_proc_name(IN in_user_id bigint, IN in_amount bigint, OUT pout_one bigint, OUT pout_two bigint ) RETURNS record AS $BODY$ begin select count(*) as AliasOne into pout_one from tabe_names where

Does ADODB fail on output parameters with optional input parameters?

霸气de小男生 提交于 2019-12-10 23:15:29
问题 I have a stored procedure in a SQL Server 2008 R2 database with an optional input parameter and an output parameter like this: CREATE PROCEDURE [dbo].[spCreateTicket] ( @TrackingCode varchar(25), @EmailAddress varchar(250) = null, @Ticket varchar(1000), @UserID int, @TicketID int output ) AS SET NOCOUNT ON INSERT INTO dbTicket (TrackingCode, EmailAddress, Ticket, UserID) SELECT @TrackingCode, @EmailAddress, @Ticket, @UserID SELECT @TicketID = SCOPE_IDENTITY() RETURN @TicketID When I invoke

How to get output parameters from MySQL stored procedure in Rails?

落爺英雄遲暮 提交于 2019-12-05 01:39:30
问题 I'm trying to get a output parameter from MySQL stored procedure, let's have look a example below: 1 In mysql I created this procedure and it works. CREATE PROCEDURE sp_name (out id int) Begin select id into @id from table order by id desc limit 1; End mysql> call sp_deduct_credit_and_money(@id); Query OK, 0 rows affected (0.01 sec) mysql> select @id; +--------------+ | @id | +--------------+ | 24 | +--------------+ 1 row in set (0.00 sec) 2 Therefore, it also works in Rails, BUT it won't

Is it bad practice to have an output parameter in a method in a WCF service?

半腔热情 提交于 2019-12-04 11:00:55
问题 I'm looking for reasons beyond the usual "out parameters are confusing and indicate the method is doing more than one thing"-style arguments and more about what is specifically bad about output parameters in WCF services. Where I work now, we have a rule against them in WCF services, and I'm trying to work out why! 回答1: Personally, I use out parameters in specific places (such as methods named TryParse()). So, I have some of the bias you talked about where I only use it in specific, limited