On 12 Sep 2003, Jason E. Stewart wrote:

> Date: 12 Sep 2003 09:24:15 +0530
> 
> >         - Moved the quoting of bind values out of execute() and into
> >                 bind -- as there is no need to requote the value
> >                 every time execute is called.
> 
> Does this mean that it is not necessary to explicitly quote any bound
> veriable in an execute - that it will be done for us?
> 
It means that dbdpg did a loop something akin to

Begin execute
for (@bound_params) {  # These could be specified by bind_param || 
                       # by execute("param", "param"...);
    push @quoted_params, quote_param($_);
}
rewrite_sql_statement(@quoted_params);
Execute statement;
return;

And it was changed to do something more like:

begin execute;
rewrite_sql_statement(@bound_params) # Because they were quoted when the 
                                     # were bound there is no need to 
                                     # do any quoting now.
execute statement;
return;

> I noticed a difference in DBD::mysql and DBD::Pg. I have always
> explicitly quoted the bind parameters and when I did that in

You mean as in bind_param(1,$quote->("value"))?  If so this should double 
quote the value? And I don't see why it would have done otherwise in the 
old version.

> DBD::mysql it double-quoted the parameters, and caused an error. 

What error?  You should just get a double quote but no error -- unless 
maybe you are trying to insert into a numeric column type?



> 
> Cheers,
> jas.
> _______________________________________________
> Dbdpg-general mailing list
> [EMAIL PROTECTED]
> http://gborg.postgresql.org/mailman/listinfo/dbdpg-general
> 

Reply via email to