<br><br><div><span class="gmail_quote">On 10/4/06, <b class="gmail_sendername">Hartmaier Alexander</b> <<a href="mailto:Alexander.Hartmaier@t-systems.at">Alexander.Hartmaier@t-systems.at</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> First of - did you try it like you would with any normal parameter?<br>><br>> $row->$colname($value);<br><br>Works for me with varchar2 fields.</blockquote><div><br>The issue here is quoting/escaping stuff in Oracle varchar fields. The parameter binding in raw DBI mentioned earlier takes care of this. This is something we probably need to fix in the general case in DBIC at some point, but its something not many people run into in practice.
<br><br>Right now in the Storage::DBI driver stuff, we just plug in ? placeholders then call ->execute(@args) on the generated statement handle. The DBI docs basically say that when you do this, the values are quoted/treated like SQL_VARCHAR by default, except in the probably rare case that the DBD driver is smart enough to know the types of your ?'s, or if you've done a bind_param on this sth before.
<br><br>I would propose we could go this route in the future to improve our code in this area:<br><br>1) Support a column_info parameter called "bind_attrs", which affects Storage::DBI's parameter type binding. This would allow the user to do this:
<br><br>__PACKAGE__->add_columns( funky_col => { bind_attrs => { ora_type => 'ORA_CLOB', ora_field => 'funky_col' } }, other_col => ... );<br><br>and have the case in this email thread handled correctly at execute time. This way users can always plug in whatever funky thing they need until we figure out how to support it correctly in a future release.
<br><br></div></div>2) Support automatic default "bind_attrs" for certain vendor and column_info->{data_type} combinations (like, automatically generating the above when the storage type is Storage::DBI::Oracle for columns with data_type set to 'varchar').
<br><br>-- Brandon<br>