I am having trouble creating a large table using perl DBI do and/or prepare execute. The table being created is approximately 2.2B records. When the code is executed the tables is created in my oracle 11.2g database but code dies if do(sql) or die / execute(sql) or die. However, errstr is null if you try to print the error message. If we reduce the number of rows created, the script runs fine.

use strict; use DBI; ###build connection strings my $HOST=`hostname`; my $sid="$ENV{ORACLE_SID}"; my $dbh; my $ctas_sql = q(create table perl_test_tb as select a.lvl from (select level lvl from dual connect by level <= 100000 +00) a ,(select level lvl from dual connect by level <= 220) +b ); connect_to_db(); sub connect_to_db { my $errormessage; # get the base filename for this script my $user = 'fdsglobal'; my $pass = 'snafu'; # Just connect to the db. my $connection = qq(dbi:Oracle:host=$HOST;sid=$sid); $dbh = DBI->connect("$connection", "$user", "$pass", {PrintError => 0, PrintWarn => 0, LongReadLen => 2000000100 # add 100 to the longest possible long, + as per DBI man page }) or die "Could Not Connect To Database: ". $DBI::errstr; } my $rows = $dbh->do($ctas_sql) or die "Cannot run code: $ctas_sql \n". + $dbh->errstr ."\n\n"; my $ctas_error = $dbh->errstr; print "perl test table created with $rows rows\n";

In reply to DBI limitation??? by kyledba2013

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.