[Dbix-class] Small patch for DBIx::Class::Storage::DBI::Oracle::Generic (BLOB handling)

Nickolay Platonov nickolay8 at gmail.com
Thu May 15 21:35:29 BST 2008


Hello

I've discovered the issue with BLOB column handling with
DBIx::Class::Storage::DBI::Oracle::Generic
(the column value doesnt want to go into base)

the key links:

http://search.cpan.org/~pythian/DBD-Oracle-1.21/Oracle.pm#Binding_for_Updat=
es_and_Inserts<http://search.cpan.org/%7Epythian/DBD-Oracle-1.21/Oracle.pm#=
Binding_for_Updates_and_Inserts>
http://search.cpan.org/~pythian/DBD-Oracle-1.21/Oracle.pm#Placeholder_Bindi=
ng_Attributes<http://search.cpan.org/%7Epythian/DBD-Oracle-1.21/Oracle.pm#P=
laceholder_Binding_Attributes>

http://search.cpan.org/~ash/DBIx-Class-0.08010/lib/DBIx/Class/Storage/DBI.p=
m#bind_attribute_by_data_type<http://search.cpan.org/%7Eash/DBIx-Class-0.08=
010/lib/DBIx/Class/Storage/DBI.pm#bind_attribute_by_data_type>

And here is a suggesting quick patch, based on info from links:


use DBD::Oracle qw(:ora_types);


sub bind_attribute_by_data_type {
    my ($self,$type) =3D @_;

    if ($type eq 'BLOB') {
        return { 'ora_type' =3D> SQLT_BIN };
    } elsif ($type eq 'CLOB') {
        return { 'ora_type' =3D> SQLT_CHR };
    } else {
        return;
    }
}

(these values are valid for DBD::Oracle build upon Oracle 10.2 or smth, so
this patch should be a bit complicated).


Hope this will save time for someone.

Regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20080516/d4c=
8d5cf/attachment-0001.htm


More information about the DBIx-Class mailing list