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 | [reply] [d/l] [select] |
Thanks.
How about using "here document" ?
Something like:
sqlplus username/pwd <<EOF
some sql code...
EOF
I could not make it work.
| [reply] |
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 | [reply] [d/l] |
look at CPAN Moule DBI
and a DBD::Oracle for it.
Then you can make a connection to your Database from in your perlscript
and then use sql- for your queries. | [reply] |