From: Brian Roy <[EMAIL PROTECTED]>
> I was under the impression that placeholders would work in ODBC.
They do.
> I was
> hoping this was the case as I don't want to rewrite my code that works
> under mySQL. I'm trying to insert into MS SQL server with the same
> statements. Please let me know if there is something I'm missing here.
>
> sub sqinsert () {
> my ($names, $formdata) = @_;
> my $fields = join(', ', @$names);
> my $places = join(', ', ('?') x @$names);
> my $sql = "INSERT into $table ($fields) values ($places)";
> $sth = $dbh->prepare($sql); $sth->execute(@$formdata) || die
> $dbh->errstr;; $sth->finish(); }
>
> This is what I receive when I watch profiler on the SQL server. The
> ?'s get populated but they are with '@P's. I'm not sure how/why this
> is happening.
>
> INSERT into queue_stats (qdate, qtime, callid, queue, exten, qevent,
> qholdtime, qcalltime, qorigposition) values (@P1, @P2, @P3, @P4, @P5,
> @P6, @P7, @P8, @P9)
And appart from the unexpected text in the profiler what happens?
Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery