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 <= 10000000) 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";