From: "Peter Rabbitson" <rabbit+d...@rabbit.us> > Octavian Rasnita wrote: >> Hi all, >> >> I have an Oracle table with 2 clob columns and I am trying to add a new >> record in it, using: >> >> my $row = $schema->resultset( 'TblName' )->create( { >> question => 'This is the first question', >> answer => 'Answer 1', >> date_time_q => '2012-01-01 00:00:00', >> date_time_a => '2012-01-01 10:00:00', >> } ); >> >> my $result = $schema->resultset( 'Sugestii' )->find( $row->id ); >> >> print 'question: ', $result->question, "\n"; >> print 'answer: ', $result->answer, "\n"; >> >> The result is: >> >> question: Answer 1the first question >> answer: >> >> It seems that the data is broken. The values for both clob columns are >> stored in the first clob column in the table, or better said, the value of >> the second column overwrites the value of the first column, so if the value >> of the second column is longer than the value of the first column, the first >> column will contain just the value of the second column. >> And the second column is always empty. >> >> I have searched a lot for helpful information on the net, and I found more >> web pages telling very explicitly that an Oracle table can contain just a >> single clob column, and many other pages telling also explicitly that an >> Oracle table can contain more clob column (and just a single long >> column...), so I don't know what's the truth or if it matters. >> >> This code was working before with DBIC but now it is not working anymore... >> I am using Perl 5.14.2, DBIC 0.08196, DBD::Oracle 1.38, Oracle 11G under >> Ubuntu 11. >> >> Do you have any idea what could be the problem? Any solution or workaround? > > Crap! I would hazard a guess this is some subtle behavior change in > DBD::Oracle. In any case DBIC needs to move away from using the buggy > blob support in DBD::Oracle, and use the blob OCI calls directly. > > Can you please augment the oracle blob test[1] to work with 2 columns > at the time instead of 1 as it is now? Better test coverage (I expect > the tests to fail) will make it easier to implement the necessary > changes. > > Thanks! > > [1] > http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits/DBIx-Class.git;a=blob;f=t/73oracle.t;h=907c278cd229ab2a58c28b665ca3f356c2471810;hb=HEAD#l374 >
Yes, I will try to do that. In the meantime I have tested if the values can be inserted using DBI and it worked, so I don't know if DBD::Oracle is the problem because DBI also uses it: $dbh->do( "alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS'" ); $dbh->do( "alter session set nls_timestamp_format = 'YYYY-MM-DD HH24:MI:SS.FF'" ); $dbh->do( "alter session set nls_timestamp_tz_format='YYYY-MM-DD HH24:MI:SS.FF TZHTZM'" ); $dbh->do( "alter session set NLS_COMP='LINGUISTIC'" ); $dbh->do( "alter session set NLS_SORT='BINARY_AI'" ); my $sth = $dbh->prepare( "insert into sugestii(id, date_time_q, date_time_a, question, answer) values(?, ?, ?, ?, ?)" ); $sth->execute( 10000, '2012-01-01 00:00:00', '2012-01-01 10:00:00', 'This is the first question', 'Answer 1' ); ...and the values for the fields `question` and `answer` were exactly as they should be. (And I have also tried with some older versions of DBD::Oracle but with the same error when using DBIC). Octavian _______________________________________________ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk