Need help to run sql loader from Form6i
Hi All,
I have some problem with the sql loader running from form 6i.
I have done following steps for that.
1. have created bat file to run sql loader.
2.Alos created ctl and txt files inside the same folder.
In the form , in button press i have written below code
HOST('cmd /c C:\load1.bat > C:\output.txt');
But it is giving error as -
"Unable to open Load1.ctl."
but i have run that bat files from command prompt ; and it is running fine.
I guess probably it is not getting the correct path.
Will pls help me, wt exacly I'm doing wrong?
Rg,
Subir
Hi Francois,
Thanks for reply.
It is not a problem with the batch files. Coz, I just able to run batch files, but that is not correct solution.
Once the host command id firing, that time it is going to path -
"c:\orant\Form60\"
And in this path it searching for that batch files and all the require files; but the require files are present in some different folder. So i think I need to change the path as well, but that I'm unable to do.
To resolve the problem, I have copied all the files in "c:\orant\Form60\" folder, and then it is working.
So I think I need to changed the path, so how to change the path. If I able to change the path I think it will worked. How to change the path?
Best Rg,
Subir
Similar Messages
-
How can we run SQL*Loader from forms. I guess HOST command will run the OS comman on the clinet. How do I invoke the Loader script on the server from the forms clinet?
-Ravi.Look..the oracle server is in UnixWare 7 and the client PC
is on Windows XP Pro, but before install the Oracle Client Software into the client pc the builtin HOST doesn't work
then I install the Software in Windows XP pc and now I'm
working loading the txt file into the server on Unix,
Try to install the Oracle Client Software into the Citrix
client, I think it work. -
Need command to run sql script from sql prompt
Hi,
I am beginner in sql i need a command to run sql file from sql prompt.In notepad i have write 10 to 15 tables creation and saved as .sql i want to run this file from sql promp pls some one help.I am very great full to all users in this forum.You can also use the 'start' command.
You may also want to look in the SQLPlus User Guide and Reference (for your release) at the set command for commands to set the number of lines per page, turn headings on or off, and so on:
http://download.oracle.com/docs/cd/E11882_01/server.112/e10823/toc.htm
HTH -- Mark D Powell -- -
Need help, executing a SQL file from Forms
Hi everyone,
I don't know if this can be done. I want to execute a SQL file from a When-Button-Pressed trigger. I checked a couple of place but havent found anything yet on how to do this. If someone know of a way, please help.
Thanks
Ericprocedure p_call_sqlplus is
l_filename varchar2 (1000) := 'C:\abc\def\test.sql' ;
begin
host ('sqlplus /NOLOG @' || l_filename ) ;
end ;
rem ======== test.sql ========
connect scott/tiger
spool 'C:\abc\def\test'
select * from emp ;
spool off
exit
rem ======================working on the machine where forms is running -
Hi,
I am using sqlloader to load data from csv file to a table. csv file format is as below. And the condition is to load only data from locations DHL and ABC
item loc scheddate qty
10000001 DHL 7/13/2011 100
1000002 DHL 7/14/2011 10
101 ABC 7/15/2011 1000
10000002 ABC 7/16/2011 100
100 X 7/16/2011 0
and I am loading into table tab1
(note: there are few other cols which are nullable and don't want to isnert them)
here is the code I have written
LOAD DATA
INFILE file1.csv'
REPLACE
INTO TABLE tab1
WHEN (LOC = 'DHL')
FIELDS TERMINATED BY ","
TRAILING NULLCOLS
ITEM,
LOC,
SCHEDDATE DATE "MM/DD/YYYY",
QTY,
EXPDATE DATE (:SCHEDDATE,'MM/DD/YYYY'),
STARTDATE DATE "MM/DD/YYYY" ":SCHEDDATE",
SEQNUM SEQUENCE(1000,1),
ORDERNUM CONSTANT "2",
INTEGRATION_JOBID CONSTANT "RBI603"
INTO TABLE igpmgr.INTINS_SCHEDRCPTS
WHEN (LOC = 'ABC')
FIELDS TERMINATED BY ","
TRAILING NULLCOLS
ITEM,
LOC,
SCHEDDATE DATE "MM/DD/YYYY",
QTY,
EXPDATE DATE "MM/DD/YYYY" "to_char(to_date(:SCHEDDATE,'MM/DD/YYYY')+365,'DD/MM/YYYY')",
STARTDATE DATE "MM/DD/YYYY" ":SCHEDDATE",
SEQNUM SEQUENCE(1000,1),
ORDERNUM CONSTANT "2",
INTEGRATION_JOBID CONSTANT "RBI603"
But its only inserting rows from loc DHL and not from ABC...
Please help me..
Thanks,
Ravi.Hello Ravi,
Based on your sample data, adding commas to match the field terminators specified in the control file:10000001,DHL,7/13/2011,100
1000002,DHL,7/14/2011,10
101,ABC,7/15/2011,1000
10000002,ABC,7/16/2011,100
100,X,7/16/2011,0Consider the following:LOAD DATA
INFILE test.csv'
APPEND
INTO TABLE tab1
WHEN (LOC = 'ABC')
FIELDS TERMINATED BY ","
TRAILING NULLCOLS
( ITEM
, LOC
, SCHEDDATE DATE "MM/DD/YYYY"
, QTY -- moved to the fourth column to match the order presented in the sample data
, EXPDATE DATE "MM/DD/YYYY" -- changed specified date format to use double quotes instead of single quotes and swapped order of DD & MM to match SCHEDDATE in sample data, but also not present in the sample data, so would expect this to be treated as null, so not sure why it is specified
, STARTDATE DATE "MM/DD/YYYY" ":SCHEDDATE"
, SEQNUM SEQUENCE(1000,1)
, ORDERNUM CONSTANT "2"
, INTEGRATION_JOBID CONSTANT "RBI603"
INTO TABLE tab1
WHEN (LOC = 'DEF')
FIELDS TERMINATED BY ","
TRAILING NULLCOLS
( ITEM POSITION(1) -- added POSITION(1) to allow sqlldr to start reading from the beginning of the line
, LOC
, SCHEDDATE DATE "MM/DD/YYYY"
, QTY -- moved to the fourth column to match the order presented in the sample data
, EXPDATE DATE "MM/DD/YYYY" -- not present in the sample data, so would expect this to be treated as null, so not sure why it is specified
, STARTDATE DATE "MM/DD/YYYY" ":SCHEDDATE"
, SEQNUM SEQUENCE(1000,1)
, ORDERNUM CONSTANT "2"
, INTEGRATION_JOBID CONSTANT "RBI603"
)Hope this helps,
Luke
Please mark the answer as helpful or answered if it is so. If not, provide additional details.
Always try to provide actual or sample statements and the full text of errors along with error code to help the forum members help you better. -
How to display list process, when i run sql*loader in c#
Hello,
How to display list process, when i run sql*loader in c#. I mean when i run sql*loader from cmd windows, i get list process how many row has been inserted. But when i run SQL*Loader from C#, i can't get process SQL*Loader.
This is my code:
string strCmd, strSQLLoader;
string strLoaderFile = "XLLOAD.CTL";
string strLogFile = "XLLOAD_LOG.LOG";
string strCSVPath = @"E:\APT\WorkingFolder\WorkingFolder\sqlloader\sqlloader\bin\Debug\8testskrip_HTTP.csv";
string options = "OPTIONS (SKIP=1, DIRECT=TRUE, ROWS=1000000,BINDSIZE=512000)";
string append = "APPEND INTO TABLE XL_XDR FIELDS TERMINATED BY ','";
string table = "OPTIONALLY ENCLOSED BY '\"' TRAILING NULLCOLS (xdr_id,xdr_type,session_start_time,session_end_time,session_last_update_time,session_flag,version,connection_row_count,error_code,method,host_len,host,url_len,url,connection_start_time,connection_last_update_time,connection_flag,connection_id,total_event_count,tunnel_pair_id,responsiveness_type,client_port,payload_type,virtual_type,vid_client,vid_server,client_addr,server_addr,client_tunnel_addr,server_tunnel_addr,error_code_2,ipid,c2s_pkts,c2s_octets,s2c_pkts,s2c_octets,num_succ_trans,connect_time,total_resp,timeouts,retries,rai,tcp_syns,tcp_syn_acks,tcp_syn_resets,tcp_syn_fins,event_type,flags,time_stamp,event_id,event_code)";
strCmd = "sqlldr xl/secreat@o11g control=" + strLoaderFile + " LOG=" + strLogFile;
System.IO.DirectoryInfo di;
try
System.Diagnostics.ProcessStartInfo cmdProcessInfo = new System.Diagnostics.ProcessStartInfo("cmd.exe");
di = new DirectoryInfo(strCSVPath);
strSQLLoader = "";
strSQLLoader += "LOAD DATA INFILE '" + strCSVPath.ToString().Trim() + "' " + append + " " + table;
StreamWriter writer = new StreamWriter(strLoaderFile);
writer.WriteLine(strSQLLoader);
writer.Flush();
writer.Close();
// Redirect both streams so we can write/read them.
cmdProcessInfo.RedirectStandardInput = true;
cmdProcessInfo.RedirectStandardOutput = true;
cmdProcessInfo.UseShellExecute = false;
cmdProcessInfo.LoadUserProfile = true;
//System.Diagnostics.Process.Start("CMD.exe", strCmdLine);
// Start the procses.
System.Diagnostics.Process pro = System.Diagnostics.Process.Start(cmdProcessInfo);
// Issue the dir command.
pro.StandardInput.WriteLine(strCmd);
// Exit the application.
pro.StandardInput.WriteLine("exit");
//Process[] processlist = Process.GetProcesses();
//foreach(Process pro in processlist){
Console.WriteLine("Process: {0} ID: {1}", pro.ProcessName, pro.Id);
Console.WriteLine(pro.StandardOutput.ReadLine());
// Read all the output generated from it.
string strOutput;
strOutput = pro.StandardOutput.ReadToEnd();
pro.Dispose();
catch (Exception ex)
return;
finally
Thanks.friend
sqlldr is an application residing in the OS. procedure runs in the dbms engine.
you cannot run an os command directly from a procedure or a function or a package .
If you want to do so you need to use either a daemon process created by a PRO*C program
or a JAVA stored procedure to do so.
just refer to previous question forums, you can find the solution. Somebody has already given a solution using
java to run an OS command . check it out
prakash
[email protected] -
Sample code of how to execute sql loader from visual basic
Hi,
Can anyone please provide me with sample code of how to
run sql loader from inside a visual basic 6.0 application with Oracle 8.1.7.3 database or please point me to documentation/tech books containing such examples?
Thanks very much
JohnYou have to use the command shell to activate a file.bat. The Shell command has the following parameters :
Shell(Pathname, Windows Style )
[email protected]
Joel P�rez -
Invoking SQL Loader from linux - Help Needed
Hi All,
When i tried to invoke the sql loader from linux by using following command
sqlldr username@server/password control=loader.ctl
But its always throws this message
Message 2100 not found; No message file for product=RDBMS, facility=ULMessage 2100 not found; No message file for product=RDBMS, facility=UL
Can somebody help me to fix this issue?You may need to set your Oracle environment, try this ($ is the command prompt):
$ export ORACLE_SID=orcl
$ . /usr/local/bin/oraenv
$ sqlldr username@server/password control=loader.ctl:p -
I need help moving my Photoshop 7 from my old laptop to my new laptop which is running Windows 7 Enterprise. I’ve tried two routes unsuccessfully. I install the CD, it does not autoplay. I execute Autoplay.exe at the root directory, I am welcomed, I choose English, I accept the EULA, I get the Install/Explore choices window, with the Install button already selected, I click the Photoshop button, the CD spins, and nothing happens. In the 2nd attempt I execute Setup.exe in the Photoshop directory, and nothing happens at all. I’m never even offered the opportunity to enter my product code. What should I do?
There could is likely a compatibility problem between the old software and the newer operating system.
-
How to I run SQL Loader in a procedure
Hi
Can somebody tell me how can i run SQL Loader in a pl/sql procedure ?
i tried this:
host sqlldr73 tiger/scott load.ctl
then this
host sqlldr73 tiger/scott "c:\load.ctl"
but none works.
Please advise.
Thanks.
regards
Estherfriend
sqlldr is an application residing in the OS. procedure runs in the dbms engine.
you cannot run an os command directly from a procedure or a function or a package .
If you want to do so you need to use either a daemon process created by a PRO*C program
or a JAVA stored procedure to do so.
just refer to previous question forums, you can find the solution. Somebody has already given a solution using
java to run an OS command . check it out
prakash
[email protected] -
How do you run sql loader?
I can not find suitable documentation on running sql loader in 9i on win2000. Can anyone give me a hint on the syntax of this command? Can I run it in SQL/Plus?
Thanks.sqlldr.exe is it's own utility. it's not part of sqlplus. To run it in sqlplus you typically have to 'host sqlldr'. To run it, try typing 'sqlldr HELP=Y' from a DOS command prompt. It should get your the parameters.
-
Invokin SQL*Loader from a stored procedure
I try to invoke SQL*LOADER from within a database package by using external C procedure (the procedure calls the system() C function) but the loader generates the following error in its log file :
SQL*Loader -523: error -2 writing to file (STDERR)
and no data is uploaded.
I have tried to use system() from within database procedures to execute OS commands and it works. Does anyone know what is the problem with using system() to execute "sqlldr <parameters>"? Is there some other way to call the loader from within a stored PL/SQL procedure?
Thank you very much for your help.
Aneta Valova
nullHi
What is your task and why you are trying to invoke SQL*Loader from strorage procedure or package? Maybe the redirecting of stderr will resolve your problem but thik is it the best way to do your job.
I am not sure, that invoking other executables from Oracle instance is good idea.
Regards
null -
Calling SQL*Loader from Forms
Hi,
I was wondering if anyone has called SQL*Loader from Forms?
What I am wanting to do is use Oracle Forms as the interface where you can specify a file that you can import into the database and it will use a set control file. Push the import button and SQL*Loader does the rest.
Is using Java code to call SQL*Loader from Forms a viable option, or is there an easier way to achieve the desired outcome.
Any ideas or guidance will be much appreciated.
Thanks,
Scott.Scott,
In forms, there's a HOST built-in command which is supposed to execute any o/s commands.
What you have to do is :
1. Bult up the string exacltly in the fashion which you will run in o/s
2. Call the HOST Built-in and pass in the string
Here's a example :
Declare
lOsCmd Varchar2(1000) := Null;
Begin
lOsCmd := 'sqlldr user-id=userid/passwd@connectStr '
|| ' control=c:\temp\abc.ctl log=c:\temp\abc.log '
|| ' bad = c:\temp\abc.log';
Host (lOsCmd, No_Screen);
End;
-- Shailender Mehta -- -
Calling oracle SQL Loader from java program
Hi,
I want to insert data into oracle tables from a text files containing fixed length fields. I am using SQLLoader to achieve this. The requirement is to call the SQLLoader within the java program.
Does anyone know how to call SQL Loader from java program?
Thanks,
VarshaSimply "exec" the sqlldr program with the parameters you need to pass to it.
Runtime.exec (........)
Try to pass all parameters needed including the username and password, and use the option "silent" to avoid output, and the option "log" to have a log file of the modifications that sqlldr has done to the database. -
Launch the SQL*Loader From Stored Procedure???
Is it possible to aaunch the SQL*Loader from a stored procedure? Please help!
Try the documentation on external procedures
Maybe you are looking for
-
Tax statement item missing for tax code O3
Hi experts, I'm sorry about my question which can find out a lot in SDN forum, but i still post this here because my case is different, I see some similar Error, but I cant solve my issue. In sales standard process, I do SO, DO, Bill without that err
-
Hello! I have a 1996 iMac (1.83 GHz Intel Core Duo processor and 2 Gigabytes of memory) running Tiger 10.4.6. An Airport Express provides WiFi. I understand that Apple TV2 is not compatible with this OS X. However, I just want to play movies from Net
-
Hello everyone, I am getting started with flex 2 those days. It’s amazing. A lot of features make it easy to develop applications. I have little experience in ActionScript3.0 so I am eager to know the ability of AS3.0 to build a dynamic UI and to int
-
Issue with 'open with' bridge cc
hey all, i've searched and all the discussions that 'start' with a similar question, get diverted, or people who are 'trying' to help don't really read the question, so here i hope to make is clear so the correct answer will be provided. specs - wind
-
Photoshop (and other suite programs) freeze up continually (OSX)
Hey people, I thought I'd ask here before contacting support. I've bought the Adobe Web Premium CS4 package a while back (when they just released CS5) and I'm having huge issues now. Basically all my Adobe applications freeze up directly or do so whe