Hi all,
Can u pls help me tackling this issue.....
I will be recieving a set of .sql files name along with its path in an Excel file. I have to read these sql scripts name along with its path and compile it from Perl. In oracle there are two commands which helps in achieving this
Sta "filepath/filename.sql"; or @filepath/filename.sql;
both these queries when executed in oracle runs absolutely fine. But when i execute this query via the execute method DBI, it throws the following error.
@D:/coe_det.sql
DBD::Oracle::st execute failed: ORA-00900: invalid SQL statement (DBD ERROR: OCIStmtExecute)
for Statement "@D:/coe_det.sql" at
deploy_db_obj.pl line 97.
Here D:/coe_det.sql is the name of my script with its path;
FYI am using Perl 5.8.8 and my code is as follows
foreach my $i (1..$#input)
{
$script=$input[$i][1].$input[$i][0];
my $compilation_query="\@$script";
print "$compilation_query\n";
my $sth=$db_conn_obj->prepare($compilation_query) or die "prepare
+err:". $db_conn_obj->errstr;
$sth->execute() or die "Cannot execute:".$sth->errstr;
}
In the above code, i will have my script name along with its path in variable $script, variable $compilation_query has the sql query to be compiled i.e "@d:\coe_det.sql"
Thanks in advance.....
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.