kyledba2013 has asked for the wisdom of the Perl Monks concerning the following question:
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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI limitation?
by hippo (Archbishop) on Apr 05, 2016 at 17:53 UTC | |
by kyledba2013 (Initiate) on Apr 05, 2016 at 20:09 UTC | |
|
Re: DBI limitation???
by BrowserUk (Patriarch) on Apr 05, 2016 at 17:54 UTC | |
by kyledba2013 (Initiate) on Apr 05, 2016 at 19:15 UTC | |
|
Re: DBI limitation???
by derby (Abbot) on Apr 06, 2016 at 14:14 UTC | |
by kyledba2013 (Initiate) on Apr 06, 2016 at 15:09 UTC | |
by derby (Abbot) on Apr 06, 2016 at 16:58 UTC | |
|
Re: DBI limitation???
by chacham (Prior) on Apr 06, 2016 at 13:42 UTC |