Skip to Content.
Sympa Menu

freetds - RE: [freetds] DBD::ODBC (0.45), MS SQL, unixODBC, FreeTDS (CVS) , bind_param_ino ut

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: ZIGLIO Frediano <Frediano.Ziglio AT vodafoneomnitel.it>
  • To: "'freetds AT lists.ibiblio.org'" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] DBD::ODBC (0.45), MS SQL, unixODBC, FreeTDS (CVS) , bind_param_ino ut
  • Date: Tue, 7 Jan 2003 17:31:41 +0100

>
> Thank you - a great leap forwards - I'm not quite there but
> this is a step
> in the right direction. There is actual data coming back
> from the query
> now, I'm just not getting it in the variables. I'm thinking
> it might have
> to do with the position of the placeholders... I have posted to the
> dbi-users list on this issue, hopefully I will get a response
> this time.
> I've updated the trace at
> http://nicotine.golden.net/~chrism/freetds.log -
> I'm just wondering if my new issue might have to do with the
> position of the
> placeholders. Here's my new code snippet:
> $sth = $dbh->prepare('
> declare @DDI UDTDDI, [..] @AvailableInd UDTFlag
> select @DDI = ?, [...] @AvailableInd = ?
> execute p_ccs_MakeBooking @ClientAccount="xxxxxx",
> [...] @DDI=@DDI
> OUTPUT,
> [...] @AvailableInd=@AvailableInd OUTPUT');
>
> # bind_param_inout(placeholder position, \bind_var, max_len, type)
> # the values are assigned to the referenced variables earlier in the
> script...
> $sth->bind_param_inout(1, \$DDI, 32, DBI::SQL_VARCHAR);
> [...]
> $sth->bind_param_inout(8, \$AvailInd, 1, DBI::SQL_BIT);
> $sth->execute();
>
> So I was wondering if it were possible to somehow push the
> values into the
> @variables after the query... Maybe I'm just being naive
> thinking that the
> placeholders are being updated because the exec hasn't run
> yet when they are
> bound, but that's all I can come up with right now.
>
> Thanks again!
>
> Chris
>

I don't know very well DBI on Perl (altough one of my project at work use
it...) but I know quite well FreeTDS.
First try something simpler. Second note that TDS 4.2 do not support very
well prepared statement (so we do a sort of emulation...)
Try a procedure like

create procedure prepare_test
@a int output
as
select @a = 123
go

prepare something like
"execute prepare_test ? output"
and bind the parameters.

Best method with ODBC should be prepare "{call prepare_test ?}" but it's not
still supported under FreeTDS (lack for SQLNativeSQL and other useful
things)

freddy77

=================================
"STRICTLY PERSONAL AND CONFIDENTIAL

This message may contain confidential and proprietary material for the sole
use of the intended recipient. Any review or distribution by others is
strictly prohibited. If you are not the intended recipient please contact
the sender and delete all copies.
The contents of this message that do not relate to the official business of
our company shall be understood as neither given nor endorsed by it."

=================================




Archive powered by MHonArc 2.6.24.

Top of Page