Invoke SQL Loader from PL/SQL Procedure

hi
Is there any way to invoke sqlloader from a PL/SQL Procedure ?
Thanks
Ashish

'HOST' is not a PL/SQL command, it's a SQL*Plus command.
If you think about it for a moment, being able to run an O.S. command, such as SQL*Loader, from within the database is pretty dangerous. I suspect this is why Oracle has no way of doing it. Otherwise, a you'd be able to execute an O.S. command as the user 'oracle' (on UNIX - probably 'SYSTEM' on NT, which is even worse!!!).
All it takes is to change this :
execute '/usr/oracle/bin/sqlldr user/password@DB file=input.txt' ;
to this :
execute 'rm -rf /usr/oracle' ;
and you can start checking the job adverts...

Similar Messages

  • 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
    null

    Hi
    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 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 ...

  • 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

  • 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

  • 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
    Vishal

    You 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();
             

  • SQL Loader from Forms 10

    Hello!
    How can i call to SQL Loader from my application developed by Forms 10?

    My application is doing something similar.
    Given that the iAS server can read from the data source (where the flat file for the sqlldr to load), all you need is to write a shell script that is invoked from within the forms application (using the host command). The shell script (I use Perl) will do invoking the sqlldr and also other checks, etc
    hope this helps

  • Run SQL*Loader from forms

    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.

  • Invoking Web Service From PL SQL package

    Below is the sample code to invoke web service from pl/sql package using UTL_HTTP:
    Declare
    http_req UTL_HTTP.req;
    http_resp UTL_HTTP.resp;
    Begin
    http_req :=
    UTL_HTTP.begin_request
    'http://'
    || lv_hosturl
    -- || '.net/soa-infra/services/finance_rt/Payments/paymentsprocess_client_ep',
    --new url
    || '.net/soa-infra/services/finance_rt/PaymentsReq/paymentsprocess_client_ep?WSDL',
    'POST',
    'HTTP/1.1'
    UTL_HTTP.set_header (http_req, 'Content-Type', 'text/xml');
    -- since we are dealing with plain text in XML documents
    UTL_HTTP.set_header (http_req,
    'Content-Length',
    LENGTH (lv_soap_request)
    UTL_HTTP.set_header (http_req, 'SOAPAction', '');
    -- required to specify this is a SOAP communication
    UTL_HTTP.write_text (http_req, lv_soap_request);
    http_resp := UTL_HTTP.get_response (http_req);
    UTL_HTTP.read_text (http_resp, lv_soap_respond);
    UTL_HTTP.end_response (http_resp);
    resp := XMLTYPE.createxml (lv_soap_respond);
    End;

    Hi,
    there are a lot of option to make plsql web services .
    First you can stay with jdev 10.1.3
    Use the xmldb servlets
    use jdev 11g tp4 to create plsql ws and upgrade to jdev 11g production
    And I think in the next release of jdev it will be back , there are more options which disappeared like the adf bc sdo ws or jmx datacontrol etc.
    thanks Edwin

  • Change the mapping generation code from sql*loader to pl/sql

    I want to use a mapping with a flat file operator to generate pl/sql code even if a mapping generate sql*loader code as default.
    I tried to change the Language generation property of the mapping but an API8548 error message is shown. The suggested solution by OWB is to change the language generation code in the property inspector of the mapping.
    I can't use external table because I have to work with a remote machine.
    What i have to do to change the generation code from SQL*Loader to PL/SQL?

    How about breaking this out into 2 mappings? In the first mapping, map a flat file operator to an table using SQL*Loader code. Then define a second mapping using the table as source and therefore generate PL/SQL. Then use process flow to launch the 2nd map to run after completion of first.

  • 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,
    Varsha

    Simply "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.

  • 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.

  • 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

  • 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 Searle

    Hi 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

Maybe you are looking for

  • End to End Monitoring

    Hello, I have implemented this scenario : "Flat file ->mapping->BPM (for calling a bapi)->mapping->Flat file" and when i use the message monitoring sometimes end-to-end monitoring is available and sometimes not, Why ??? Is there a specific configurat

  • Combining PDF's in Pro X

    I was just upgrade to Adobe Acrobat Pro X.  I have a PDF started that I need to insert different PDF's into.  When I use the Insert from File it sometimes work as I expect.  But more often than not, it does not work as expected.  I have had Acrobat i

  • 10.1.3 Migration Issue with data-sources.xml

    Hi: Running into lots of migration issues for an application built in 10.1.3 EA, migrating to 10.1.3. production, mostly in the BC project. Here's one: the database connections built in EA were not carried over to prod, so they needed to get re-built

  • PROFIT SHARING TO YOUR CUSTOMERS TO HELP BOTH COMPANY AND CUSTOMER GROW FOR THE FUTURE

    DEAR VERIZON WHY NOT OFFER PROFIT SHARING TO YOUR VERIZON CUSTOMERS AND MORE MORE PLANS A CUSTOMER HAS THE MORE PROFIT VERIZON WILL SHARE WITH ITS CUSTOMERS THE 99%..... I feel whtn you give back it would help THE PEOPLE AND COMPANY. AS ONE {edited f

  • License Information for 11gR2 Standard Edtion

    Hi, Can any one please help me for the below points. 1) How many MAX Standard Edition's License a Company can take. 2) Where can we find the Licensing and Cost information for 11gR2 Edition's. Thanks & Regards, Poorna Prasad.S