in reply to Re^2: how could i insert data from a file to oracle database
in thread how could i insert data from a file to oracle database
On the other hand, you can also put multiple statements in a single scalar and have DBI execute that as well, e.g.
Just make sure each statement ends in a ';' (semicolon).{ local $/; open SQLFILE, "< file.sql" or die "Can't open file.sql: $!"; $stmts = <SQLFILE>; close SQLFILE; } eval { # Turn off autocommit, keep from dying on erros (but print them) $dbh{AutoCommit} => 0; $dbh{RaiseError} => 0; $dbh{PrintError} => 1; $dbh->do($stmts); $dbh->commit; }; if ($@) { print "Error: $@\n $DBI::errstr\n"; $dbh->rollback; }
---
echo S 1 [ Y V U | perl -ane 'print reverse map { $_ = chr(ord($_)-1) } @F;'
Warning: Any code posted by tuxz0r is untested, unless otherwise stated, and is used at your own risk.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: how could i insert data from a file to oracle database
by johngg (Canon) on Nov 09, 2007 at 22:59 UTC | |
by koleti (Novice) on Nov 13, 2007 at 16:40 UTC | |
by tuxz0r (Pilgrim) on Nov 13, 2007 at 19:31 UTC | |
by koleti (Novice) on Nov 13, 2007 at 21:03 UTC | |
by tuxz0r (Pilgrim) on Nov 13, 2007 at 21:33 UTC |