Solved

'SP2-0310: unable to open file'

Posted on 2007-04-04
2
4,200 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
2 Comments
 
LVL 17

Accepted Solution

by:
mjcoyne earned 500 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

809 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