Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: how to import sql file into oracle database.

by agianni (Hermit)
on Nov 13, 2007 at 21:07 UTC ( #650600=note: print w/ replies, xml ) Need Help??


in reply to Re^2: how to import sql file into oracle database.
in thread how to import sql file into oracle database.

Here's your problem:

foreach my $stmt( @statements ){ $dbh->do($_); }

There are a couple of things wrong. First, your code is trying to execute the SQL one line at a time. So the first SQL command you are running is:

Create table xyz (

which generates the error you're seeing. jZed's advice on splitting on semi-colons and re-joining should work.

Also, you're naming your variable for the loop but then you are referencing $_, which may or may not work correctly.

perl -e 'split//,q{john hurl, pest caretaker}and(map{print @_[$_]}(joi +n(q{},map{sprintf(qq{%010u},$_)}(2**2*307*4993,5*101*641*5261,7*59*79 +*36997,13*17*71*45131,3**2*67*89*167*181))=~/\d{2}/g));'


Comment on Re^3: how to import sql file into oracle database.
Select or Download Code
Re^4: how to import sql file into oracle database.
by koleti (Novice) on Nov 13, 2007 at 22:18 UTC
    this is the error i am facing now
    Placeholder :0 invalid, placeholders must be >= 1 at C:/Perl/site/lib/DBD/Oracle .pm line 262, <SQL> line 10009.
      If your SQL has anything preceeded by a colon (eg :01) then the oracle interprets it as a placeholder, to be filled using bind calls of some description.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://650600]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2014-12-19 02:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (70 votes), past polls