[freetds] DBD::Sybase placeholder support

Dan Wierenga dwierenga at valueclick.com
Fri May 9 14:45:01 EDT 2008


> -----Original Message-----
> From: freetds-bounces at lists.ibiblio.org [mailto:freetds-
> bounces at lists.ibiblio.org] On Behalf Of James K. Lowden
> 
> If you send me a TDSDUMP log, I hope I'd be able to tell you how it
> works.

Script and log attached.

> Could I ask you to test with 0.82, too?  I'd love to announce this a
> new
> tested, confirmed feature (even though it began working some time
> back).
> I'd hate to announce it *used* to work and is now broken again.  :-/

I'll see if I can install 0.82 soonish.  I gave a brief try yesterday
and ran into some build problems; I'll try again when I have some time.



> Also, do output parameters work?  

With my proc declared as:
create proc proc_foo (@moo datetime, @foo datetime output) as
begin select @foo = @moo; select * from dano; end

then

my $proc_sth = $dbh->prepare(q|
    declare @foo datetime
    exec proc_foo ?, @foo output
|);
$proc_sth->execute('2008-05-09 12:34:56');
{
    while (my @foo = $proc_sth->fetchrow_array) {
        print join(', ', @foo);
    }
    redo if $proc_sth->{syb_more_results};
}

prints the usual result set (from the select * from dano statement) and
prints the record from the 2nd recordset, which is the OUTPUT parameter.
The DBD::Sybase documentation is actually pretty good on this.  


> I don't even know how that's supposed to work in Perl.  See, that's
> what
> comes from not using placeholders.  ;-)
> 
> Many thanks.  This is very cool.
> 
> --jkl
> _______________________________________________
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bar.pl
Type: application/octet-stream
Size: 468 bytes
Desc: bar.pl
Url : http://lists.ibiblio.org/pipermail/freetds/attachments/20080509/abeaf36a/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tds.log
Type: application/octet-stream
Size: 19548 bytes
Desc: tds.log
Url : http://lists.ibiblio.org/pipermail/freetds/attachments/20080509/abeaf36a/attachment-0001.obj 


More information about the FreeTDS mailing list