Solved

'SP2-0310: unable to open file'

Posted on 2007-04-04
2
4,261 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 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

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and theā€¦
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
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.

623 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