Solved

'SP2-0310: unable to open file'

Posted on 2007-04-04
2
4,162 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
Comment Utility
Why is "\@" in your path?
0
 

Author Comment

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
create a gui in perl 3 42
Oracle Syntax 8 38
unable to get sorting resultset 15 44
Best way to split and output to csv in bash 2 26
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…
Utilizing an array to gracefully append to a list of EmailAddresses
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now