Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How should Oraperl execute .sql file? 1

Status
Not open for further replies.

azarko

Programmer
Apr 4, 2001
1
US
I have Perl 5, and I use Oraperl to connect to Oracle 8i. I have no problem executing one command per line using
Code:
&ora_do($lda, 'drop table myTable');
However, command
Code:
&ora_do($lda, '@myFile.sql');
and
Code:
&ora_do($lda, '@/absolut/path/myFile.sql');
are just silently ignored. What should I do?
Thanks for help in advance
:)
 
Have you looked at the DBI and DBD::Oracle modules? You may find these easier to use than oraperl.

Alternatively, load the .sql file into an array and try passing that as an argument to the ora_do command. For example:
[tt]
open(SQLFILE, &quot;</path/to/some.sql&quot;);
@SQL_Array = <SQLFILE>;
close(SQLFILE);
&ora_do($lda, @SQL_Array);
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top