Solved

'SP2-0310: unable to open file'

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Alternative to GTT for a temp table for further reuse in Oracle 8 44
error in my cursor 5 50
Database Design Dilemma 6 65
Procedure syntax 5 48
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
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.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

740 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