Error when calling SQL Loader from browser [message #70966] |
Tue, 20 August 2002 04:25 |
Ashish Mahajan
Messages: 3 Registered: August 2002
|
Junior Member |
|
|
Hi, I am trying to call a cgi script from my broswer that calls a shell, which calls sql loader.
But I get an error when I do this; here is the error:
Message1 not found; No message file for product=RDBMS, facility=ULMessage 502 not found; No
message file for product=RDBMS, facility=UL
Here is the cgi script:
#!/usr/bin/perl -w
print "Content-type:text/htmlnn";
use CGI;
system("/home/amahajan/uploadcont_PT_METRICS > /home/amahajan/a.out");
Here is the shell script (called uploadcont_PT_METRICS):
sqlload userid=XMET_ADM/xmetadm control=uploadcont1.ctl data=import_file.dat
And finally here is the output that I receive:
SQL*Loader: Release 7.3.4.0.1 - Production on Mon Aug 19 17:34:31 2002 Copyright (c) Oracle
Corporation 1979, 1996. All rights reserved.
So can somebody please tell me what I have to do to make this work. Do I have to source some
oracle variables?
Thanks,
Ashish
|
|
|
|
Re: Error when calling SQL Loader from browser(Last Question) [message #70969 is a reply to message #70968] |
Tue, 20 August 2002 06:44 |
Ashish Mahajan
Messages: 3 Registered: August 2002
|
Junior Member |
|
|
YES!!!!!!!!! I got it working. Thanks for your help, but I still have one more problem that I need help on.
Here it is. I want to pass a variable (maybe using the system command) for the data file name from my cgi script to my shell script that calls sql loader. Here is my cgi script:
#!/usr/bin/perl -w
print "Content-type:text/htmlnn";
use CGI;
system("/home/amahajan/uploadcont_PT_METRICS2 > /home/amahajan/a.out");
open(INF, "/home/amahajan/a.out") or dienice("Could not open test.out $! nn");
@data =INF;
close(INF);
foreach $line (@data) {
chomp($line);
print "$linen";
}
Here is my shell script:
ORACLE_SID=XMET
ORACLE_HOME=/oracle/app/oracle/product/7.3.4
export ORACLE_HOME
export ORACLE_SID
/oracle/app/oracle/product/7.3.4/bin/sqlload userid=XMET_ADM/xmetadm control=up
loadcont1.ctl data=import_file.dat
I want to replace where it says "import_file.dat" with a vairable that gets its value from the cgi script. Do you know how to do this?
Thanks,
Ashish
|
|
|
|
Re: Error when calling SQL Loader from browser(Last Question) [message #70974 is a reply to message #70971] |
Tue, 20 August 2002 10:09 |
Ashish Mahajan
Messages: 3 Registered: August 2002
|
Junior Member |
|
|
I am sorry, but I don't get what I am supposed to do. Am I suppose to write the following in my CGI script:
print <<"EOF"
system("/home/amahajan/uploadcont_PT_METRICS1 > /home/amahajan/a.out");
EOF
But how is this passing a value over to uploadcont_PT_METRICS1?
Please let me know if you can shine some light on this.
Thanks,
Ashish
|
|
|