Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: How can I invoke SQLPLUS within a perl script?

by jorg (Friar)
on Mar 30, 2001 at 00:49 UTC ( [id://68188]=note: print w/replies, xml ) Need Help??


in reply to How can I invoke SQLPLUS within a perl script?

If you mean sqlplus , the Oracle tool then you can invoke it through my $output = `sqlplus username/pwd @sqlfile.sql`(output of sqlplus is stored in $output) or you could do a system call as in my $rc = system('sqlplus username/pwd @sqlfile.sql')($rc contains the returncode of sqlplus)

This is the approach you can follow to execute any system command, either backticks ``, or system().. Do a supersearch on these keywords to find more examples.

Jorg

"Do or do not, there is no try" -- Yoda

Replies are listed 'Best First'.
Re: Re: How can I invoke SQLPLUS within a perl script?
by Anonymous Monk on Mar 31, 2001 at 07:08 UTC
    Thanks. How about using "here document" ? Something like: sqlplus username/pwd <<EOF some sql code... EOF I could not make it work.
      sure you would then do:
      my $command= <<COMMAND; sqlplus / username/password @runthisfile.sql COMMAND
      then plug $command into the above described functions

      Jorg

      "Do or do not, there is no try" -- Yoda

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-24 11:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found