Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

'SP2-0310: unable to open file'

Posted on 2007-04-04
2
Medium Priority
?
4,288 Views
Last Modified: 2010-05-10
I am new to perl, currently I am getting 'SP2-0310: unable to open file' error. what I am doing is to pass 3 arguments to SQL file: code looks like this:

Perl code:
sub call_sql_script {
  my ($name, $append_spool) = @_ ;
  if (-e $name) {
    $sqlplus ="sqlplus";
    print "SQLPLUS: $sqlplus      $ENV{DB_CONNECT}\n";

    $status = system ($sqlplus, $ENV{DB_CONNECT}, "\@[Full Path here]call_script.sql $ENV{SQL_DEFINE_FILE} $name $append_spool");
    return $status;
  } else {
    output("File $name does not exists.");
    exit(1);
  }
}

SQL Code:
@&1
whenever sqlerror exit 1;
SPOOL &3 APPEND
@&1
SPOOL OFF
exit;

It seems that when hard code the path and file name it works. I have double and tripple checked the path nad it is correct.

I would appreciate you help.

Thanks

0
Comment
Question by:khanzada19
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 17

Accepted Solution

by:
mjcoyne earned 1000 total points
ID: 18850871
Why is "\@" in your path?
0
 

Author Comment

by:khanzada19
ID: 18851023
I am executing the call_script.sql file '\' is the escape.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question