thor has asked for the wisdom of the Perl Monks concerning the following question:
Basically, I'm trying to use DBI to call a stored procedure with one of the parameters containing an ASCII NUL character. What I've tried so far:
What I think the problem is is that the pack('i',15)<code> makes <code>"^@^@^@^O", where ^@ is ASCII NUL. So, when this gets passed, perl somehow sees this as the end of string (just like in C), and stops processing the string. Is there some way to pass this in without having perl interpret the NUL's?my $packed = pack("i", 15); $packed .= '$'; # #1 $sth = $dbh->prepare("exec my_proc ?"); $sth->execute($packed); # #2 $sth = $dbh->prepare("exec my_proc $packed"); $sth->execute();
thanks,
thor
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Calling a Sybase Procedure with NUL in a parm
by mpeppler (Vicar) on Feb 05, 2003 at 00:30 UTC | |
by thor (Priest) on Feb 05, 2003 at 01:22 UTC | |
by mpeppler (Vicar) on Feb 05, 2003 at 16:30 UTC | |
by thor (Priest) on Feb 05, 2003 at 23:24 UTC | |
|
Re: Calling a Sybase Procedure with NUL in a parm
by Abigail-II (Bishop) on Feb 04, 2003 at 23:29 UTC | |
by mpeppler (Vicar) on Feb 05, 2003 at 00:35 UTC | |
|
Re: Calling a Sybase Procedure with NUL in a parm
by derby (Abbot) on Feb 04, 2003 at 23:55 UTC | |
|
Re: Calling a Sybase Procedure with NUL in a parm
by data64 (Chaplain) on Feb 05, 2003 at 00:03 UTC | |
by thor (Priest) on Feb 05, 2003 at 01:28 UTC |