Skip to Content.
Sympa Menu

freetds - RE: [freetds] problem with return values

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Rogers, Tom" <tom.rogers AT ccur.com>
  • To: 'FreeTDS Development Group' <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] problem with return values
  • Date: Tue, 13 Jan 2004 13:41:48 -0500

Are you 100% sure that you are looping through all your returned records
before attempting to inspect the return code? Assuming you are using jdbc
you should note that there is an ODBC "limitation" that makes return values
and output parameters not available until the returned recordset is flushed.

Thomas Rogers
System Engineer
Concurrent Computer Corporation
> phone: 215.712.7422 x7261
>
>
The information contained herein is proprietary and confidential and should
be treated in accordance with the Non-Disclosure Agreement and any
Amendments to said Agreement executed between the discloser and recipient.
If the reader of this message is not the intended recipient, you are hereby
notified that any dissemination, distribution, or copy of this information
is strictly prohibited. If you have received this information in error,
please immediately notify discloser, and then destroy the information
contained herein. Thank you.


-----Original Message-----
From: freetds-bounces AT lists.ibiblio.org
[mailto:freetds-bounces AT lists.ibiblio.org]On Behalf Of Cadman, Andrew
(Contractor)
Sent: Tuesday, January 13, 2004 1:43 PM
To: 'freetds AT lists.ibiblio.org'
Subject: [freetds] problem with return values


Hi

I have a strange problem with OUTPUT parameters using FreeTDS 0.62 with PHP
4.3.2, running Redhat 9, connected to SQL Server 2000.

I can return result sets without any issue at all, but in some cases where a
return value is set -1, it is returned as 0. This happens on a number of
different stored procedures.

However, running the stored procedure directly through SQL SERVER Enterprise
Manager's Query Analuzer utility works just fine and returns the correct
value. A sample of the PHP code is shown below:

$db = new sql_db($dbHost, $dbUser, $dbPasswd, $dbName, false);

$query = $db->sql_sproc_init("dbo.proc_login_registrar");

$param_len_1 = strlen($username);
$param_len_2 = strlen($password);

$db->sql_sproc_bind("@puserid",$username,SQLCHAR,false,false,$param_len_1);
$db->sql_sproc_bind("@ppassword",$password,SQLCHAR,false,false,$param_len_2)
;
$db->sql_sproc_bind("@pRetVal",&$pRetVal,SQLINT2,true,false,1);
$db->sql_sproc_bind("RETVAL",&$pRetValAgain,SQLINT2,true,false,2);

$rw = $db->sql_sproc_exec();


Anyone have any ideas?

thanks in advance,

Andrew Cadman





_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds




Archive powered by MHonArc 2.6.24.

Top of Page