On Mon, Nov 3, 2008 at 00:58, Amit Saxena <[EMAIL PROTECTED]> wrote:
> Hi
>
> What's the difference between passing "?" versus ":1", ":2", ":3" etc in
> prepare in Perl DBI ?
>
> For example, what's the difference between following two scenarios :-
>
> *Scenario 1*
>
> $sth = $dbh->prepare("insert into tablename values (:1, :2, :3)");
>
> $sth->execute($var1,$var2,$var3);
>
> *Scenario 2*
>
> $sth = $dbh->prepare("insert into tablename values (?, ?, ?)");
>
> $sth->execute($var1,$var2,$var3);
>
> Thanks & Regards,
> Amit Saxena
>from http://search.cpan.org/~timb/DBI-1.607/DBI.pm#Placeholders_and_Bind_Values Some drivers also allow placeholders like :name and :N (e.g., :1, :2, and so on) in addition to ?, but their use is not portable. If the :N form of placeholder is supported by the driver you're using, then you should be able to use either "bind_param" or "execute" to bind values. Check your driver documentation. -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/
