I am trying to insert a massive CLOB into an oracle DB and get a "Can't locate object method "prepare" via package DBI::st" errror when executing the command. Now the row does get inserted but the script dies after this error.

Here is a summarized version of the code

use strict; use Time::Local; use warnings; use Storable; use Data::Dumper; use DateTime; use DBI; use Digest::MD5 qw(md5 md5_hex md5_base64); use DBD::Oracle ':ora_types'; # The Connection # ## Connect to VistaMart DB my $dbh = DBI->connect("dbi:Oracle:host=$scriptProps{'IVDBHOST'};sid=$ +scriptProps{'IVDBSID'};port=$scriptProps{'IVDBPORT'}", $scriptProps{' +IVDBUSER'}, $scriptProps{'IVDBPASSWORD'},{ AutoCommit => 1 }) or grac +efulExit($DBI::errstr); $dbh->{LongReadLen} = 41943040; $dbh->{LongTruncOk} = 1; #The insert $dbh = $dbh->prepare("INSERT INTO vindbase_operator.mobily_vb_ +script_worklistv2 (worklistid, emstype, submitserver, submitdate, sub +mitowner, state, contents, contentscksum) VALUES (vindbase_operator.m +obily_vb_script_worklist_inc.nextval,?,?,to_date(?,'YYYY-MM-DD H H24:MI:SS'),?,?,?,?)"); $dbh->bind_param( 1, 'samsungWSM' ); $dbh->bind_param( 2, $hostname ); $dbh->bind_param( 3, getDateFromEPOC($fileList{$filena +me}{timestamp}) ); $dbh->bind_param( 4, $scriptName ); $dbh->bind_param( 5, 1 ); $dbh->bind_param( 6, $outFile, {ora_type => ORA_CLOB}) +; $dbh->bind_param( 7, md5_hex($outFile) ); $dbh->execute; #$dbh->commit; print ">>>>>>>>>>>>>>>>>FINNN\n"; #DEBUG #disconnect $dbh->disconnect;

The result is that the row gets inserted but the script barfs with the following error.

Can't locate object method "prepare" via package "DBI::st" at ./samsun +gWSMv2.pl line 512.

In reply to DBI Question by boodong

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.