ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-dbi-dev
perl-dbi-dev
bind_param for named parameters - clarification sought
by Martin Evans other posts by this author
May 13 2008 5:23AM messages near this date
ANNOUNCE: IBM Informix Database Driver for Perl DBI Version 2008.0513 (2008-05-13) released | Re: bind_param for named parameters - clarification sought
Tim,

In the thread "problem with DBD::ODBC and placeholders 
[SEC=UNCLASSIFIED]" on dbi-users recently you said:

 >  Drivers that support named placeholders like ":N" where N is an
 >  integer, could support both forms of binding: bind_param(":1",$v) and
 >  execute($v)
 >  It's not dis-allowed. Driver docs should clarify this issue.

Is it really your intention that to bind named parameter "fred" as in 
the SQL "insert into xxx values(:fred)" you call bind_param(":fred",$v)?

As it happens DBD::ODBC has a bug in its support of named parameters 
(other than :1, :2 etc) which means it did not work at all but it ALSO 
expects the name parameter ":fred" above to be passed to bind_param as 
"fred" i.e. the leading ':' is treated as an introducer and not part of 
the parameter name. I believe, but am prepared to be put right, other 
non-perl database drivers also drop the ':' when binding.

As it didn't work before I can change it to be either - just let me know.

Thanks.

Martin
-- 
Martin J. Evans
Easysoft Limited
http://www.easysoft.com
Thread:
Martin Evans
Tim Bunce
Greg Sabino Mullane
Jonathan Leffler

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved