You will get this if you use the older DBD::Sybase. I struggled with this
stuff and made ugly workarounds just get stuff undef through a placeholder
with DBD::Sybase 0.21. Either switch to 0.91 or check for an undef value
and do a $dbh->quote() on it... unfortunately, you won't be able to use
placeholders and you'll be stuck using a stored procedure to do a lousy
insert. I HIGHLY recommend you use the latest DBD::Sybase module and at
least DBI 1.14.
HTH,
Curt Crandall
On Thu, 28 Jun 2001, Tim Harsch wrote:
> how do you use undef when you mean to without -w barking this at you:
> Use of uninitialized value at
> /usr/local/perl5.005/lib/site_perl/DBD/Sybase.pm line 121.
>
> code snip:
> $hDB->do( <<SQL );
> create table #temp_for_this_session
> ( fld1 int not null,
> fld2 varchar(20) null )
> SQL
>
> my @myvalues = (
> [ 5, undef ],
> );
>
> foreach my $myvalue ( @myvalues ) {
> my $sql = 'insert into #temp values ( ?, ? )';
> $hDB->do( $sql, {}, @$myvalue );
> } # end foreach
>
> __END__
>
> I'm supposed to use undef to indicate NULL in the database right? Should
> Sybase.pm be checking for undef before trying to use the value?
>
>