Calling SQL*Loader from OCCI
Hi All,
I need to access SQL*Loader from C++.
I know there is an interface for OCI to access SQL*Loader.
I also know there is a gnu project of a c++ wrapper to the OCI-SQL*Loader interface (odpd).
According to the OCCI documentation it is just a C++ facade of OCI (with some goodies like thread managing , etc.).
I want to know the following:
1. How can I operate OCI from OCCI?
2. Are there are source samples of operating OCI from OCCI or even better operating OCI SQL*Loader interface from OCCI?
3. Are there are any known (/unknown :-) ) problems with either OCCI access to OCI or OCI interface itself to the SQL*Loader?
Thanks,
Arik
Hi,
If you have a OCCI application and you want to interoperate with OCI, you can retrieve the underlying OCI handles from OCCI objects and write OCI code.
e.g :-
//with Environment env, Connection conn OCCI objects
OCIEnv *ocienv = env->getOCIEnv();
OCISvcCtx *ocisvc = conn->getOCISvcCtx();
//use OCI calls
OCIError *errhp;
OCIHandleAlloc (ocienv, &errhp, OCI_HTYPE_ERROR,...);
OCIHandleAlloc (ocienv, &dpctx, OCI_HTYPE_DIRPATH_CTX,..);
err = OCIDirPathLoadStream(...);
OCCI does not have a direct path API at present.
Thanks.
Similar Messages
-
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 Sql-loader from PL/SQL
What is the command(s) to call Sql-Loader from inside a PL/SQL procedure?
Regards,
Ahmad.I don't think it is possible ...
-
Calling Sql*Loader from oracle Form builder
How do i call sql* loader from my forms to import the external data in different formats into my existing database?
Specify the flexibility of sql* loader to import external data from .txt files or .xls files.
Would be thankful if certain examples are given along with the answer.Hi,
1. First you have to create seperate ctl (Control files) which maps to different file formats
2. Using Oracle Forms,
2a) You can use the 'HOST' command to execute the command line ie. In this case executing
SQL*Loader script
2b) You also have the feature in ORACLE forms to read text files and load the data into
ORACLE db.
This can be achieved by using TEXT_IO package which comes with ORACLE Forms.
Hope this helps
Ta
Shailender -
How to Call SQL Loader from Java ( servlet )?
We need to call SQL Loader command from Java Servlets? Any suggestions how this can be done?
Thanks
RahulProbably not the best way, but you could try using JNI to call a C function which then invokes SQL Loader via system() or exec(). I haven't done this myself though...
-
Calling SQL LOADER From Java Program
Hi
I need to invoke sql loader from inside a Java Class.
Any Pointers in this regards will be really appreciated.
Thanks
VishalYou can create two different files which has sqlldr command defined....
1. loader.sh
2. loader.bat
and in the depending on the OS execute one...
String command = "";
if(System.getProperty("os.name").equals("Windows 2000")){
//if os is windows 2000 then execute bat file
command = <<bat file path>>
}else{
command = <<shell path>>
Runtime rt = Runtime.getRuntime();
Process p = rt.exec(command);
int i = p.exitValue();
-
Calling SQL Loader from Forms 4.5 using HOST command in Win2000
One of my forms calls SQL Loader 7.3 using HOST command to load a csv file onto the database(Oracle 7.3) under Windows 2000 platform.
Only after sql loader finishes its operation the control should come to my form i.e. synchronous execution.
As of now its running asynchronously.
Is there any way to make it synchronous. If Not any other work arounds?
Environment Details
Forms [32 Bit] Version 4.5.10.6.0 (Production)
Windows 2000 Operating System
Oracle7 Release 7.3.2.3.2Forms6i running on W2000, Rdbms 8.1.7
in Forms I added a button TEST,
Trigger when-button-pressed : host('test.bat') ;
in directory .......\frm I added file test.bat :
REM ===============
cd /d C:\........\ldr
pause
sqlldr parfile=test.par
pause
type test.log
pause
exit
REM ================
now, pressing TEST button opens DOS window, telling me what's going on, running sqlldr, finally going back to forms
Are you using NO_PROMPT or NO_SCREEN option of HOST command ?
Had a look at Forms 4.5 manuals, there is no mentioning of (a)synchronously operation in connection with HOST command. -
Calling SQL Loader from SQL Plus
Hi everyone,
I currently use both SQL Loader and SQL Plus to load data and to then carry out certain DML tasks and to reinstate indexes. That all works fine but of course I need to be present to start and to monitor the various scripts.
What I would really like to do is to be able to incorporate the calls to SQL-Loader into my SQL-Plus scripts and am wondering if this is possible.
At the moment I run some parts of the load in 'batch' (i.e. command line calls to SQL-Loader and to SQL-Plus) but this won't work for the whole load because the batch calls (from Windows) are not able to wait for particular processes to finish before they start the next. This works OK for the SQL-Loader scripts (because they can run in parallel) but will not work for the whole load because the load needs to be finished before the further processing starts.
Or maybe there is a way (Windows .BAT files?) to set up batch processes which are intelligent enough to wait for one action to finish before starting the next action.
Any thoughts or any links to HOWTOs on this would be a great help.
Regards and thanks,
Alan SearleHi Alan,
In SQL*Plus you have the HOST command.
I would go for the .bat solution using [START /WAIT|http://www.computerhope.com/starthlp.htm]
Regards
Peter -
Error while calling sql loader from shell script.
In the table DBMS_SCHEDULER_JOB_RUN_DETAILS im getting the error as ""SQL*Loader-128: unable to begin a session ORA-01017: invalid username/password; logon denied""....do we need previliges for creating session of the db user????.....or wht other settings we require to do.....if the username and password used is right.
user1122577 wrote:
SQL*Loader-128: unable to begin a session ORA-01017: invalid username/password; logon deniedI don't know, but somehow the error you recived looks like ORA-01017 : )
[oracle@dell ~]$ sqlplus ring/ring
SQL*Plus: Release 10.2.0.4.0 - Production on Thu Jul 22 11:50:58 2010
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Data Mining and Real Application Testing options
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Data Mining and Real Application Testing options
[oracle@dell ~]$
[oracle@dell ~]$
[oracle@dell ~]$ sqlldr ring/ring
control = i don't have it
SQL*Loader: Release 10.2.0.4.0 - Production on Thu Jul 22 11:51:08 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
SQL*Loader-500: Unable to open file (i don't have it.ctl)
SQL*Loader-553: file not found
SQL*Loader-509: System error: No such file or directory
[oracle@dell ~]$
[oracle@dell ~]$
[oracle@dell ~]$ sqlldr ring/wrongpassword
control = i don't have it again
SQL*Loader: Release 10.2.0.4.0 - Production on Thu Jul 22 11:51:38 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
SQL*Loader-128: unable to begin a session
ORA-01017: invalid username/password; logon denied
[oracle@dell ~]$ -
Calling SQL Loader from ColdFusion Web Server
We are trying to Load Data files into Oracle through a Cold Fusion Web Application. Users will browse to a local file on their computers, click a button, and our application will use SQL Loader to load the data into oracle. The ColdFusion web server is Unix and the 11g database server is Linux. When we run the ColdFusion code below we get a file not found error, the sqlldr executable cannot be found. Do we need to install an Oracle client or something on the ColdFusion Web server to get this to work?
<cfexecute name="sqlldr" arguments="ADVDEMO@ADVDEMO/Transact2011 control=/space/users/www/advfiles/ControlFiles/BS/Bio_ControlFile.ctl" timeout="500"></cfexecute>'sqlldr' is part of Oracle server or (full) Oracle client software - NOT the OS - so indeed you need to install at least the client. Unfortunately 'sqlldr' is not part of the Instant Client, which is much smaller than the full client.
Some guys tried to add 'sqlldr' manually:
http://my.opera.com/onyxluo/blog/2007/12/28/add-sql-loader-into-oracle-10-instant-client
Werner -
Calling SQL*Loader from PERL; Message 2100 not found
I am trying a simple PERL script to call sqlldr and load data into an Oracle 10G database. I get the error message:
Message 2100 not found; No message file for product=RDBMS, facility=UL
Many forums have said the answer to this is to set environment variables like ORACLE_HOME and PATH. Even having done that I get this error. My script looks like:
#!E:\CommonApps\Perl\Perl\bin -w
$ENV{ORACLE_HOME}='E:\CommonApps\oracle';
print "Oracle HOME is: ";
print $ENV{ORACLE_HOME};
print "\n";
$ENV{PATH} = 'E:\CommonApps\oracle;E:\CommonApps\oracle\bin';
print "Path is ";
print $ENV{PATH};
print "\n";
if ($#ARGV != 7) { print "Incorrect Usage of runsqlldr\n";print "Usage: perl runsqlldr.pl dbuser dbpass dbname datafile discard ctlfile logfile badfile \n"; exit; }
$dbuser=$ARGV[0];
$dbpass=$ARGV[1];
$dbname=$ARGV[2];
$datafile=$ARGV[3];
$discard=$ARGV[4];
$ctlfile=$ARGV[5];
$logfile=$ARGV[6];
$badfile=$ARGV[7];
if (system("sqlldr userid=$dbuser/$dbpass\@$dbname control=$ctlfile data=$datafile=log=$logfile bad=$badfile discard=$discard SKIP=1 ERRORS=10000 ROWS=10000 BINDSIZE=512000 PARALLEL=TRUE") != 0) {
die "\n Running sqlldr failed!\n";
exit 0;
Is there anything else I need to do to make this work? The E:\CommonApps\oracle\rdbms\mesg directory has 3 files: kgpus.msb, ocius.msb, oraus.msb.
Thanks
Arvind*** Duplicate Post *** {code}
-
Calling SQL*Loader from Windows
Hi I have created the following Control file and stored it on my PC at Z:\D DRIVE\LG\Kenya\RAW DATA FILES
OPTIONS (ERRORS=999999999, DIRECT=TRUE, ROWS=100000)
LOAD DATA
INFILE 'Z:\D DRIVE\LG\Kenya\RAW DATA FILES\Personal_Loans_Raw_Data.csv'
APPEND
PRESERVE BLANKS
INTO TABLE TB_KEN_LOANS_RAW_DATA
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
CUSTOMER_NUMBER
, AUTHORISER_DECISION
, SALES_CODE
, OPEN_DATE
, PRODUCT
, TOP_UP_LOAN
, LOAN_AMOUNT
, TOP_UP_AMOUNT
, TOP_UP_ACCT_NO
, SYSTEM_DATE CONSTANT '30-APR-2009'
, LOAD_DATE "SYSDATE"
How should i load it in Windows?user637544 wrote:
i executed the following statement at the Windows - > Run
sqlldr userid=schema/password@sid control=Z:\D DRIVE\LG\Kenya\RAW DATA FILES\loans.ctl
but nothing happened. just a black box opened and closed immediately. no log files, bad files or records were inserted.The problem with windows -> run is that it opens a command window and then automatically closes it when the command is finished, so if there were any errors you won't get a chance to see them.
Use:
Windows -> Run -> cmd <enter>
which will open up a command window.
In that command window, issue your sqlldr command as you did previously.
Then see what output/errors you get. -
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. -
hi,
can any one tell me how to call sql loader from forms 9i
thanks
vikram.Hi,
How to execute SQLLDR from web forms in IAS.
You need to set the ORACLE_HOME to the one which has sqlldr.
You can create a DOS BAT file like this for Windows and call this
using the HOST built-in.
If you are using this on web then the HOST will execute in the
Application Server machine. So, files should be in that machine.
REM=======For Windows===============
REM filename Mysqlldr.BAT
REM my file to execute sqlldr
set ORACLE_HOME=D:\oracle\iSuites
set PATH=D:\oracle\iSuites\bin;%PATH%
sqlldr scott/tiger@l817 D:\Mycontrol.ctl DATA=mydata.dat LOG=mylog.log BAD=mybad.log
REM======================
Similarily, you can create a Shell script for UNIX system.
Source: Metalink
~KBK -
Calling SQL Loader using HOST command from Developer Forms 4.5
I want to execute a set of code from D2K Forms 4.5 which has interfface with Client - OS ( In my case Windows NT/XP). I want to execute SQL Loader from Forms using Host Command and then after completion of that process, I want to do next transcations ( depending upond success of HOST/SQL Loader).
How to achive this?
I tried writing code like this ...
l_vc_command := 'sqlldr73'
||' USERID='||l_vc_username||'/'||l_vc_password||'@'||l_vc_connect_string
||' CONTROL='||l_vc_filepath||'Upload.ctl'
||' DATA='||LTRIM(RTRIM(l_vc_fileloc))
||' LOG='||l_vc_filepath|| l_vc_log_file || '_' || l_dt_sysdate_str ||'.log'
||' BAD='||l_vc_filepath|| l_vc_bad_file || '_' || l_dt_sysdate_str ||'.bad'
||' DISCARD='||l_vc_filepath|| l_vc_discard_file || '_' || l_dt_sysdate_str ||'.dsc';
HOST(l_vc_command,NO_PROMPT);
After this command i want to do some other code execution. so even if it fails or success, next code is executed. How to control this?
Please help..
Regards,
MilindForms6i running on W2000, Rdbms 8.1.7
in Forms I added a button TEST,
Trigger when-button-pressed : host('test.bat') ;
in directory .......\frm I added file test.bat :
REM ===============
cd /d C:\........\ldr
pause
sqlldr parfile=test.par
pause
type test.log
pause
exit
REM ================
now, pressing TEST button opens DOS window, telling me what's going on, running sqlldr, finally going back to forms
Are you using NO_PROMPT or NO_SCREEN option of HOST command ?
Had a look at Forms 4.5 manuals, there is no mentioning of (a)synchronously operation in connection with HOST command.
Maybe you are looking for
-
UK Payroll : /111 Splitting
Hi Experts, The issue is regarding with wage type /111 and related PCR. We have one customized wage type 1234 in IT0014. As per the requirement it should calculate percentage of /111 and percentage will be given in IT0014. For this we have written on
-
when i put a new hard drive in my macbook i had to reinstall OS X. It seems the software updates didn't get backed up with time machine meaning that I have outdated software for safari and especially itunes. I used time machine to transfer all my fil
-
Outputting SQL statement into HTML table
ok, my problem is that i can only output the first row from my table in my DB and i want to be able to display all the rows from that table which are of a particular type..maybe someone here can help.. and if anyone thinks the code is a bit pants ple
-
hi friends, my job profile has been changed in BW where i have to handle like this: Job Description: Process Chain monitoring for BW info packages. Troubleshooting the problems for Index error, Aggregates errors, Statistics creation, Ensuring comple
-
How can i determin which tab has been clicked??
hi there how do i determine which one of the tabs in a tabbedPane has been clicked? do i add ActionListener to the tabbedPane or its sub JPanel?