Invoke SQL Loader

Hi,
I have an application where I use a SQL Loader to load data onto the table. When i log in as a regular user i try to invoke the SQL Loader on the server. For the credentials to connect to the server like username/Password@database to invoke the sqlldr it looks into a table. We had hard coded the admin username and password while passing these credentials to the server. So irrespective of which user logged in it would load data into the admin.tablename. But right now we want to change that and we want to load data into each users individual table.
For example if its user1 logged in .. when he does the data load it should load data into user1.tablename. So I assume i have to pass his credentials which connecting to the SQL loader instead of the admin. But we dont store any information of the user and their passwords in the application and there is no way we could retrieve password for each user. So if I dont have the password information of the user how would i connect to the server to run the SQL Loader. Could I pass the table name explicitly to the sqlldr instead of the .ctl file? Is there any work around to this as to how I could load data onto individual users tables.
Thanks and Regards

user635059 wrote:
Hi,
I have an application where I use a SQL Loader to load data onto the table. When i log in as a regular user i try to invoke the SQL Loader on the server. For the credentials to connect to the server like username/Password@database to invoke the sqlldr it looks into a table. We had hard coded the admin username and password while passing these credentials to the server. So irrespective of which user logged in it would load data into the admin.tablename. But right now we want to change that and we want to load data into each users individual table.
Well, since you hard coded the admin username, that admin username has INSERT ANY TABLE, yes? So all you need to do is create SQL*Loader control file specifying OWNER.TABLENAME as load table. For example, control file is:
load data
into table u1.example
fields terminated by ',' optionally enclosed by '"'
(col1 char(5),
col2 char(7))
{code}
Data file is:
{code}
hello,world,|
james,bond,|
{code}
Now:
{code}
SQL> show user
USER is "SCOTT"
SQL> create table u1.example(col1 varchar2(10),col2 varchar2(10))
  2  /
Table created.
SQL> host sqlldr scott/tiger data=c:\temp\example.txt control=c:\temp\example.ctl
SQL> select * from u1.example
  2  /
COL1       COL2
hello      world
james      bond
SQL>
{code}
SY.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • 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

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

  • How can I invoke a sql loader from oracle form?

    I'm got a problem on invoking sql loader command from oracle form where the sql loader product has been installed in Window NT.
    Thanks for your help!

    U can use HOST procedure with NO_SCREEN option.
    this will go like
    Host('d:\orant\bin\SQLLDR80 USERID=username/password@connect CONTROL=contril_file.CTL LOG=log_file.LOG discard=discard_file.dis bad=bad_file.bad', NO_SCREEN);
    Hope this will Work
    Good Luck :-)
    Naren

  • 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

  • Sql Loader and carriage returns

    I am currently trying to use sql loader to load data from flat files that was extracted from sybase using bcp and delimited with pipes. There are text and varchar columns that contain carriage return line feeds. I want to preserve these, but I can not load them into Oracle 8.05 using sql loader as it interprets them as end of record indicators. Does anyone have a way to solve this problem? Any assistance would be appreciated.
    Thanks in advance,
    Jignesh

    External tables are accessible from SQL, which generally simplifies life if the data files are physically located on the database server since you don't have to coordinate a call to an external SQL*Loader script with other PL/SQL processing. Under the covers, external tables are normally just invoking SQL*Loader.
    SQL*Loader is more appropriate if the data files are on a different server or if it is easier to call an executable rather than calling PL/SQL (i.e. if you have a batch file that runs on a server other than the database server that wants to FTP a data file from a FTP server and then load the data into Oracle).
    Justin

  • SQL *Loader and External Table

    Hi,
    Can anyone tell me the difference between SQL* Loader and External table?
    What are the conditions under we can use SQL * Loader and External Table.
    Thanx

    External tables are accessible from SQL, which generally simplifies life if the data files are physically located on the database server since you don't have to coordinate a call to an external SQL*Loader script with other PL/SQL processing. Under the covers, external tables are normally just invoking SQL*Loader.
    SQL*Loader is more appropriate if the data files are on a different server or if it is easier to call an executable rather than calling PL/SQL (i.e. if you have a batch file that runs on a server other than the database server that wants to FTP a data file from a FTP server and then load the data into Oracle).
    Justin

  • SQL-Loader and Pipes

    I have to insert 300.000.000 datasets (generated dynamically by a seperate process) into an Oracle 8.1.6 database. I'd like to do this via SQL-Loader but since Linux (kernel 2.2 at least) supports only files up to 2Gigs and I don't have the necessary space on my machine to generate a large amount of ASCII files I'd like to ask whether there is a possibility to use an ordinary pipe in combination with SQL-Loader. I tried to use a named pipe but all my attempts failed.
    I don't like to use Perl and the DBI module since this would be far so slow (would take about one week I guess).
    Hans

    External tables are accessible from SQL, which generally simplifies life if the data files are physically located on the database server since you don't have to coordinate a call to an external SQL*Loader script with other PL/SQL processing. Under the covers, external tables are normally just invoking SQL*Loader.
    SQL*Loader is more appropriate if the data files are on a different server or if it is easier to call an executable rather than calling PL/SQL (i.e. if you have a batch file that runs on a server other than the database server that wants to FTP a data file from a FTP server and then load the data into Oracle).
    Justin

  • Sql loader and Store Prrocedures

    Hi!!
    I ned load text files with sql loader first at temporal tables,later on put this in tables with Stored Procedures in one data base Oracle 8.1.5.
    My sqlldr version is 8.1.6 and not4s compatible with 8.1.5 of the data base server.
    How can i load the files?
    Thank4s

    External tables are accessible from SQL, which generally simplifies life if the data files are physically located on the database server since you don't have to coordinate a call to an external SQL*Loader script with other PL/SQL processing. Under the covers, external tables are normally just invoking SQL*Loader.
    SQL*Loader is more appropriate if the data files are on a different server or if it is easier to call an executable rather than calling PL/SQL (i.e. if you have a batch file that runs on a server other than the database server that wants to FTP a data file from a FTP server and then load the data into Oracle).
    Justin

  • SQL*Loader permission issue?

    I have set up a run_all script on LINUX to invoke SQL*Loader for each table to be loaded. I can run this as the Oracle owner just fine. When I try to let the developer run this on dev, they get the following:
    SQL*Loader: Release 9.2.0.1.0 - Production on Tue Apr 25 08:55:18 2006
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    SQL*Loader-128: unable to begin a session
    ORA-01034: ORACLE not available
    ORA-27121: unable to determine size of shared memory segment
    Linux Error: 13: Permission denied
    They can use SQL*Plus on the command line with the userid and password from the SQL*Loader file. I don't want to have to run these for them every time, so any help or ideas would be greatly appreciated!

    Hi
    Has the same ORACLE_HOME variable value of the Oracle owner and the developer?
    Ott Karesz
    http://www.trendo-kft.hu

  • Sql*Loader and Conc. Mgr.

    I would like for our users to submit a request (in GL) that will run sql*loader to load a file of their choosing to an oracle table. Oracle tells me I must use their consulting arm for this kind of question. Does anyone have any ideas on how to do this?

    External tables are accessible from SQL, which generally simplifies life if the data files are physically located on the database server since you don't have to coordinate a call to an external SQL*Loader script with other PL/SQL processing. Under the covers, external tables are normally just invoking SQL*Loader.
    SQL*Loader is more appropriate if the data files are on a different server or if it is easier to call an executable rather than calling PL/SQL (i.e. if you have a batch file that runs on a server other than the database server that wants to FTP a data file from a FTP server and then load the data into Oracle).
    Justin

  • SQL*Loader-929: Error parsing insert statement for table

    Hi,
    I get the following error with SQL*Loader:
    Table MYTABLE loaded from every logical record.
    Insert option in effect for this table: INSERT
    Column Name Position Len Term Encl Datatype
    IDE FIRST * ; CHARACTER
    SQL string for column : "mysequence.NEXTVAL"
    CSI_NBR 1:10 10 ; CHARACTER
    POLICY_NBR 11:22 12 ; CHARACTER
    CURRENCY_COD 23:25 3 ; CHARACTER
    POLICY_STAT 26:27 2 ; CHARACTER
    PRODUCT_COD 28:35 8 ; CHARACTER
    END_DAT 44:53 10 ; CHARACTER
    FISCAL_COD 83:83 1 ; CHARACTER
    TOT_VAL 92:112 21 ; CHARACTER
    SQL*Loader-929: Error parsing insert statement for table MYTABLE.
    ORA-01031: insufficient privileges
    I am positive that I can SELECT the sequence and INSERT into the table with the user invoking sql*loader.
    Where does that "ORA-01031" come from?
    Regards
    ...

    Options:
    1) you are wrong about privileges OR
    2) you have the privilege only when you connect via SQL*Plus (or whichever other tool you used to test the insert).
    Is it possible that during your test you enabled the role which granted you the INSERT privilege - and that SQL*Loader doesn't do this?
    Can you see the table in this list?
    select *
    from user_tab_privs_recd
    where table_name='MY_TABLE'
    and owner='table owner whoever';
    select *
    from user_role_privs;Any roles where DEFAULT_ROLE is not YES?
    HTH
    Regards Nigel

  • Automate SQL*LOADER

    Hi,
    I am working on a Decision Support System project.
    I need to load flat files into Oracle tables through SQL * Loader. And the entire process should be invoked through JAVA front end.
    How do I go about?
    I will deeply appreciate any help.
    Raghu.

    Hi,
    In our prev. project, We have customized-(automated) SQL*LOADER. There, we were using UNIX O/S. So We have used shell scripts for creating the control file (a script can create control file automatically). And it will call the sql loader and load the data into tables.
    Here u can use same logic.
    If ur flat file contents are in same format, u can use the static control files (means, at installation time u can create control files) and whenever u want this, u can call. Dont go for dynamic control files.
    1. If u is using Java as front end, u can use native methods and call sql loader (exe). Problem is, U can not invoke, and such thing from client m/c. U can do it only from server side.
    2. This way also u can try. By using external procedure method, u can call shared library and shared library can invoke sql loader (write a small C shared library program for invoking SQL*LOADER). Here, u can invoke SQL*LOADER from client m/c also.
    3. One more ways is there. By using listener tech. u can invoke it. Create listener program and run on server side as back ground process. Whenever, there is request, it will sql loader.
    With regards,
    Boby Jose Thekkanath
    [email protected]
    Dharma Computers(p) Ltd.
    Bangalore-India.

  • 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 using JSP

    wht is the way of using sqlldr in JSP script to load data Oracle DB from a csv file.
    i know how we do sqlldr in cmd.
    can we provide the sqlldr command to system by using jsp if yes how?

    SQL*Loader is a command-line utility. In theory, since Java can call out to the operating system, you could invoke SQL*Loader on the application server to load data into Oracle. It would probably be more appropriate, though, to copy the CSV to the database server and make use of an external table in the database to do the load.
    Justin

Maybe you are looking for

  • Motion-ease in/out

    I'm working in FCE4 and using a number of still pictures. I'm doing pans and zooms using the motion control. No problem. The acceleration from start to stop is constant. I want it to start out slow, speed up, then slow down to end. So I control click

  • Speedup too low?

    Please see the program below, //====================================================== public class MainTest {      public static void MyTestTask4_2(){           long rep=20000000;           final CountDownLatch latch=new CountDownLatch(4);          

  • Advantages of buying MSI products

    Hi people. I just wanna seek some help here for my Social subject project. I hope someone can list down 5 good advantages of buying MSI products. Thank you!

  • Urgent!!! select methods problem!!!

    hi,all dose anybody have encounter such problem : if the xml nodes have prefix that the select methods can not work as well, the select result is null,but the xml nodes do not have prefix that the result will be right. i use the oracle xdk10.0 ,and p

  • Software Component Version cannot be changed after Importing Objects

    Hi Gurus,   I was trying out the import export function of XI. I export a message mapping and then re-import it back into XI. However, after doing that, it is telling me that the Software Component Version cannot be changed. I'm now unable to make an