Use Oracle directory object in SQL*loader?

Hi All,
We have a bunch of flatfiles that need to be read on a daily basis. We are using SQL*loader to read these files into Oracle.
The files arrive into a different directory every day ( /filesDDMMYY/ ). We now manually copy these files into the static directory which is pointed to in our ctl file. I was wondering if it's possible to use an Oracle Directory object to point to these data files, in stead of the pysical directory we use now?
Now we use: INFILE './sources/mydata.txt' , but I would like to make this a dynamic refrence to a directory with a different name
I searched the documentation and the internet quite extensively, but can not get an answer if it's possible to use directory objects in conjunction with sql loader.
Any help or suggestions would be appriciated.
Greetz,
Toin.
Message was edited by:
Toin ~ corrected typo

you can remove the INFILE parameter from the CTL files, and instead specify it on the command line (DATA=./sources...).
obviously this would still require changing every ctl file, but you would only need to do it once, not everytime you change a directory.
of course, the shell script which runs sqlldr would need to change. however, you could make the shell script more robust, by having it connect to sqlplus to look up the actual directory path from ALL_DIRECTORIES, and then use that when calling sqlldr.

Similar Messages

  • How to get file names for one oracle directory object.

    Hi all ,
    I defined one oracle directory object . Now I want to know how many files stored under this object in physical directory and their names ? anyone know how to do it by pl/sql ?
    Thanks,
    George

    Chris Poole has an [XUTIL_FINDFILES package|http://www.chrispoole.co.uk/apps/xutlff.htm] which can do this in pure SQL. It does require, though, that your DBA install code in the SYS schema and that you rely on the behavior of an undocumented X$ table. That may not be possible in certain environments.
    I personally prefer a small Java stored procedure along the lines of [this one from Tom Kyte|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:439619916584]. It isn't a pure PL/SQL solution, but it tends to fit relatively cleanly in any environment. Most DBAs will be willing to grant the privileges this sort of approach requires where they would be hesitant to grant the access necessary for XUTIL_FINDFILES.
    Justin

  • Oracle DIRECTORY object and subdirectories

    As you know, in 9i the use of the UTL_FILE_DIR is being deprecated in favour of Oracle DIRECTORY objects. This is fine for security reasons and administration but there seems to be a problem with subdirectories.
    The situation: we are generating literally millions of files using UTL_FILE. These files are going to be stored in one of forty thousand directories (the precise directory is derived from parsing the file's key ID).
    In the old days access could be granted simply by setting the UTL_FILE_DIR parameter to /<root>/dir/*
    As far as I can see, the Oracle DIRECTORY does not support subdirectories. Is there any way of avoiding the creation of forty thousand CREATE DIRECTORY statements and a concommitant number of GRANT statements?
    Oracle 9.2, any suggestions gratefully received.
    Cheers, APC

    Just curious Andrew-- are there things in the UTL_FILE package that you don't find implemented better in Java's I/O classes? I wouldn't claim to be the world's leading expert on Java I/O, so I won't comment on the specifics of this. Generally I think using Java to re-write a piece of existing native functionality is a hard one to sell:
    (1) Java tends to run slower than native code
    (2) It's a chunk of work, and my PM is already breathing down my neck.
    However, I might do this as a hobby project. If I do, I'll let you know how it turns out :)
    Cheers, APC

  • Loading Objects with SQL*Loader

    When loading a column object with SQL*Loader, is it possible to specify a column specific 'TERMINATED BY' clause in the control file?
    I've successfully defined column-level termination characters for regular columns and nested tables, but can't seem to find any way of achieving the same result with column objects.

    When loading a column object with SQL*Loader, is it possible to specify a column specific 'TERMINATED BY' clause in the control file?
    I've successfully defined column-level termination characters for regular columns and nested tables, but can't seem to find any way of achieving the same result with column objects.

  • How to Unpivot, Crosstab, or Pivot using Oracle 9i with PL/SQL?

    How to Unpivot, Crosstab, or Pivot using Oracle 9i with PL/SQL?
    Here is a fictional sample layout of the data I have from My_Source_Query:
    Customer | VIN | Year | Make | Odometer | ... followed by 350 more columns/fields
    123 | 321XYZ | 2012 | Honda | 1900 |
    123 | 432ABC | 2012 | Toyota | 2300 |
    456 | 999PDQ | 2000 | Ford | 45586 |
    876 | 888QWE | 2010 | Mercedes | 38332 |
    ... followed by up to 25 more rows of data from this query.
    The exact number of records returned by My_Source_Query is unknown ahead of time, but should be less than 25 even under extreme situations.
    Here is how I would like the data to be:
    Column1 |Column2 |Column3 |Column4 |Column5 |
    Customer | 123 | 123 | 456 | 876 |
    VIN | 321XYZ | 432ABC | 999PDQ | 888QWE |
    Year | 2012 | 2012 | 2000 | 2010 |
    Make | Honda | Toyota | Ford | Mercedes|
    Odometer | 1900 | 2300 | 45586 | 38332 |
    ... followed by 350 more rows with the names of the columns/fields from the My_Source_Query.
    From reading and trying many, many, many of the posting on this topic I understand that the unknown number or rows in My_Source_Query can be a problem and have considered working with one row at a time until each row has been converted to a column.
    If possible I'd like to find a way of doing this conversion from rows to columns using a query instead of scripts if that is possible. I am a novice at this so any help is welcome.
    This is a repost. I originally posted this question to the wrong forum. Sorry about that.

    The permission level that I have in the Oracle environment is 'read only'. This is also be the permission level of the users of the query I am trying to build.
    As requested, here is the 'create' SQL to build a simple table that has the type of data I am working with.
    My real select query will have more than 350 columns and the rows returned will be 25 rows of less, but for now I am prototyping with just seven columns that have the different data types noted in my sample data.
    NOTE: This SQL has been written and tested in MS Access since I do not have permission to create and populate a table in the Oracle environment and ODBC connections are not allowed.
    CREATE TABLE tbl_MyDataSource
    (Customer char(50),
    VIN char(50),
    Year char(50),
    Make char(50),
    Odometer long,
    InvDate date,
    Amount currency)
    Here is the 'insert into' to populate the tbl_MyDataSource table with four sample records.
    INSERT INTO tbl_MyDataSource ( Customer, VIN, [Year], Make, Odometer, InvDate, Amount )
    SELECT "123", "321XYZ", "2012", "Honda", "1900", "2/15/2012", "987";
    INSERT INTO tbl_MyDataSource ( Customer, VIN, [Year], Make, Odometer, InvDate, Amount )
    VALUES ("123", "432ABC", "2012", "Toyota", "2300", "1/10/2012", "6546");
    INSERT INTO tbl_MyDataSource ( Customer, VIN, [Year], Make, Odometer, InvDate, Amount )
    VALUES ("456", "999PDQ", "2000", "Ford", "45586", "4/25/2002", "456");
    INSERT INTO tbl_MyDataSource ( Customer, VIN, [Year], Make, Odometer, InvDate, Amount )
    VALUES ("876", "888QWE", "2010", "Mercedes", "38332", "10/13/2010", "15973");
    Which should produce a table containing these columns with these values:
    tbl_MyDataSource:
    Customer     VIN     Year     Make     Odometer     InvDate          Amount
    123 | 321XYZ | 2012 | Honda      | 1900          | 2/15/2012     | 987.00
    123 | 432ABC | 2012 | Toyota | 2300 | 1/10/2012     | 6,546.00
    456 | 999PDQ | 2000 | Ford     | 45586          | 4/25/2002     | 456.00
    876 | 888QWE | 2010 | Mercedes | 38332          | 10/13/2010     | 15,973.00
    The desired result is to use Oracle 9i to convert the columns into rows using sql without using any scripts if possible.
    qsel_MyResults:
    Column1          Column2          Column3          Column4          Column5
    Customer | 123 | 123 | 456 | 876
    VIN | 321XYZ | 432ABC | 999PDQ | 888QWE
    Year | 2012 | 2012 | 2000 | 2010
    Make | Honda | Toyota | Ford | Mercedes
    Odometer | 1900 | 2300 | 45586 | 38332
    InvDate | 2/15/2012 | 1/10/2012 | 4/25/2002 | 10/13/2010
    Amount | 987.00 | 6,546.00 | 456.00 | 15,973.00
    The syntax in SQL is something I am not yet sure of.
    You said:
    >
    "Don't use the same name or alias for two different things. if you have a table called t, then don't use t as an alais for an in-line view. Pick a different name, like ordered_t, instead.">
    but I'm not clear on which part of the SQL you are suggesting I change. The code I posted is something I pieced together from some of the other postings and is not something I full understand the syntax of.
    Here is my latest (failed) attempt at this.
    select *
      from (select * from tbl_MyDataSource) t;
    with data as
    (select rownum rnum, t.* from (select * from t order by c1) ordered_t), -- changed 't' to 'ordered_t'
    rows_to_have as
    (select level rr from dual connect by level <= 7 -- number of columns in T
    select rnum,
           max(decode(rr, 1, c1)),
           max(decode(rr, 2, c2)),
           max(decode(rr, 3, c3)),
           max(decode(rr, 4, c3)),      
           max(decode(rr, 5, c3)),      
           max(decode(rr, 6, c3)),      
           max(decode(rr, 7, c3)),       
      from data, rows_to_have
    group by rnumIn the above code the "select * from tbl_MyDataSource" is a place holder for my select query which runs without error and has these exact number of fields and data types as order shown in the tbl_MyDataSource above.
    This code produces the error 'ORA-00936: missing expression'. The error appears to be starting with the 'with data as' line if I am reading my PL/Sql window correctly. Everything above that row runs without error.
    Thank you for your great patients and for sharing your considerable depth of knowledge. Any help is gratefully welcomed.

  • Problems using Oracle Directory

    Hi all
    I have the following problem using 9i: I would like to use oracle internet directory to register my db's. I am currently reading the online handbooks and found a section that says to start the directory by using the 'oidmon' and 'oidctl' commands. The problem is that I cannot find these tools anywhere on the server, altough i am pretty sure i intalled anything important. is this a separate product? I thought it was included in 9i 9.2?
    Anyone?
    Cheers,
    Michael

    Hi.
    Hmm, your shared lib path appears to be ok. What version of Solaris are you running? Also what JDK version are you using (I'll assume you are using the one that installed with WLS)?
    You might also try posting this to the weblogic.developer.interest.jdbc newsgroup.
    Thanks,
    Michael
    Alex wrote:
    Hi,
    Please help. While trying to do a dbping, I get the following error:
    [root@hkodsdb01 SMEloan]# java -Djava.library.path=/export/home/greenwood/bea/wlserver6.0/lib/solaris:/export/home/greenwood/bea/wlserver6.0/lib/solaris/oci817_8:/u01/oracle/product/817/lib utils.dbping ORACLE oracle smeloan 192.168.1.252
    Starting Loading jDriver/Oracle .....
    Error encountered:
    java.sql.SQLException: System.loadLibrary threw java.lang.UnsatisfiedLinkError with the message '/export/home/greenwood/bea/wlserver6.0/lib/solaris/oci817_8/libweblogicoci37.so: ld.so.1: /greenwood/bea/jdk131/jre/bin/../bin/sparc/native_threads/java: fatal: libclntsh.so.8.0: open failed: No such file or directory'.
    at weblogic.jdbcbase.oci.Driver.loadLibraryIfNeeded(Driver.java:202)
    at weblogic.jdbcbase.oci.Driver.connect(Driver.java:57)
    at java.sql.DriverManager.getConnection(DriverManager.java:517)
    at java.sql.DriverManager.getConnection(DriverManager.java:146)
    at utils.dbping.main(dbping.java:167)
    The required file is under the Oracle directory specified. Also, I am having some problems with using the LD_LIBRARY_PATH for my shared library files. The command won't work with LD_LIBRARY_PATH and I must use the -Djava.library.path parameter. Any thoughts and suggestions?
    Thanks so much for your help in advance.
    Alex--
    Michael Young
    Developer Relations Engineer
    BEA Support

  • Export Oracle Databaes Objects into sql file

    Hi Experts,
    I searched and could not find anything whether is that possible to dump oracle database into a sql file.
    Can some one clarify this?
    Thanks,
    Dharan V

    Hi,
    Still struggling here,
    CREATE OR REPLACE DIRECTORY DUMP_DIR AS 'c:\';
    GRANT DATAPUMP_EXP_FULL_DATABASE TO SCOTT;
    GRANT DATAPUMP_IMP_FULL_DATABASE TO SCOTT;
    EXPDP SCOTT@LOCAL-DB directory=DUMP_DIR dumpfile=scott.dmp content=metadata_only Full=Y
    password: tiger
    C:\Documents and Settings\Dharan>expdp SCOTT@LOCAL-DB directory=DUMP_DI
    R dumpfile=scott.dmp content=metadata_only Full=Y
    Export: Release 11.1.0.6.0 - Production on Sunday, 31 January, 2010 16:48:42
    Copyright (c) 2003, 2007, Oracle.  All rights reserved.
    Password:
    Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Produc
    tion
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    Starting "SCOTT"."SYS_EXPORT_FULL_01":  SCOTT/********@LOCAL-DB directo
    ry=DUMP_DIR dumpfile=scott.dmp content=metadata_only Full=Y
    Processing object type DATABASE_EXPORT/TABLESPACE
    Processing object type DATABASE_EXPORT/PROFILE
    Processing object type DATABASE_EXPORT/SYS_USER/USER
    Processing object type DATABASE_EXPORT/SCHEMA/USER
    Processing object type DATABASE_EXPORT/ROLE
    Processing object type DATABASE_EXPORT/GRANT/SYSTEM_GRANT/PROC_SYSTEM_GRANT
    Processing object type DATABASE_EXPORT/SCHEMA/GRANT/SYSTEM_GRANT
    Processing object type DATABASE_EXPORT/SCHEMA/POST_SCHEMA/PROCACT_SCHEMA
    Processing object type DATABASE_EXPORT/AUDIT
    Master table "SCOTT"."SYS_EXPORT_FULL_01" successfully loaded/unloaded
    Dump file set for SCOTT.SYS_EXPORT_FULL_01 is:
      C:\SCOTT.DMP
    Job "SCOTT"."SYS_EXPORT_FULL_01" successfully completed at 16:51:20But i don't see any scott.dmp in either c:\ [on newly created directory]
    OR C:\Documents and Settings\Dharan.
    Ok...i Tried similarly the second one now
    C:\Documents and Settings\Dharan>impdp SCOTT@LOCAL-DB directory=DUMP_DI
    R dumpfile=scott.dmp content=metadata_only Full=Y
    Export: Release 11.1.0.6.0 - Production on Sunday, 31 January, 2010 16:48:42
    Copyright (c) 2003, 2007, Oracle.  All rights reserved.
    Password:
    Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Produc
    tion
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    Master table "SCOTT"."SYS_SQL_FILE_FULL_01" successfully loaded/unloaded
    Starting "SCOTT"."SYS_SQL_FILE_FULL_01":  SCOTT/********@LOCAL-DB dire
    tory=DUMP_DIR dumpfile=scott.dmp SQLFILE=SCOTT.sql
    Processing object type DATABASE_EXPORT/TABLESPACE
    Processing object type DATABASE_EXPORT/PROFILE
    Processing object type DATABASE_EXPORT/SYS_USER/USER
    Processing object type DATABASE_EXPORT/SCHEMA/USER
    Processing object type DATABASE_EXPORT/SCHEMA/TABLE/POST_INSTANCE/PROCDEPOBJ
    Processing object type DATABASE_EXPORT/SCHEMA/POST_SCHEMA/PROCOBJ
    Processing object type DATABASE_EXPORT/SCHEMA/POST_SCHEMA/PROCACT_SCHEMA
    Processing object type DATABASE_EXPORT/AUDIT
    Job "SCOTT"."SYS_SQL_FILE_FULL_01" successfully completed at 17:13:35Even now i can't see any .sql file either c:\ [on newly created directory]
    OR C:\Documents and Settings\Dharan.
    Suggest what am doing wrong here.
    Thanks,
    Dharan V

  • Error while using expressions with direct path sql loader

    We are using an expression (substr) in the control file while loading the data into a table T using sql loader using a user U.
    The user U does not have permissions to the table T directly but through a role R.
    While running the sql loader using direct=true option (because the data load is very huge), an error 'table or view does not exist' is thrown.
    This error does not occur when conventional path is used; or when the user is given permissions on the table directly. We dont want to use both these options. Is there any other solution to this problem?
    Thanks!

    We are using an expression (substr) in the control file while loading the data into a table T using sql loader using a user U.
    The user U does not have permissions to the table T directly but through a role R.
    While running the sql loader using direct=true option (because the data load is very huge), an error 'table or view does not exist' is thrown.
    This error does not occur when conventional path is used; or when the user is given permissions on the table directly. We dont want to use both these options. Is there any other solution to this problem?
    Thanks!

  • XML queries... Change the code from using Oracle db into MS SQL

    Hi, I am a new begginer in this field. I came accross to an article that focuses in Oracle's XSU approach.
    Currently, i am trying to convert the java code from using Oracle db to MSSQL db. The code has shown below:
    import javax.naming.*;
    import javax.sql.*;
    import java.sql.*;
    import oracle.xml.sql.query.*;
    public class testxml
         public static void main(String args[]) throws SQLException, NamingException
         String tabName = "emp";
         int maxRows = 3;
         Context ctx = new InitialContext ();
         DataSource ds = (DataSource) ctx.lookup ("MyOra");
         Connection conn = ds.getConnection ();
    OracleXMLQuery qu = new OracleXMLQuery (
    conn, "select EMPNO, ENAME from " + tabName);
    qu.setMaxRows (maxRows);
    qu.setRowsetTag ("EMPLOYERS");
    qu.setRowTag ("PERSON");
    String xmlString = qu.getXMLString();
    System.out.println (xmlString);
    conn.close ();
    Currently, i am having difficulties to change the "bold" area that uses Oracle into MS SQL as my current application is using MS SQL as the database.
    Please help and need more advices from all of you. Thank You

    I resolved this issue myself. For the answer please message me.

  • How to handle SQL connection if password Active directory always change? (Connection using Active directory via network SQL 2012 )

    I have 3 server (Web server, database sql 2012 server and Active directory). I'm using sqlsvr version 3.0,  PHP version 5.3 ,IIS version 7 and windows server 2008.
    Right now my php connection to SQL 2012 using AD id, so How to handle if password on active directory change?

    Solved : Using Kaberos

  • Want to use sequence object of oracle when loading data in sql loader

    Hi,
    I want to use sequence when loading data in sqll loader, but the problem is i could not use sequence object of oracle to load the data by sql loader, i can use sequence of sql loader.
    I want to use sequence object because in later entries this sequence object will be used.If i use sequence of sql loader how can i use oracle sequence object
    Is there any other option

    I have a simillar problem, I also want to use a sequence when loading data by the SQL Loader.
    My control file is:
    load data
    infile '0testdata.txt'
    into table robertl.tbltest
    fields terminated by X'09'
    trailing nullcols
    (redbrojunos,
    broj,
    dolazak,
    odlazak nullif odlazak=blanks,
    komentar nullif komentar=blanks)
    And the datafile is:
    robertl.brojilo.nextval     1368     17.06.2003 08:02:46     17.06.2003 16:17:18     
    robertl.brojilo.nextval     2363     17.06.2003 08:18:18     17.06.2003 16:21:52     
    robertl.brojilo.nextval     7821     17.06.2003 08:29:22     17.06.2003 16:21:59     
    robertl.brojilo.nextval     0408     17.06.2003 11:20:27     17.06.2003 18:33:00     ispit
    robertl.brojilo.nextval     1111     17.06.2003 11:30:58     17.06.2003 16:09:34     Odlazak na ispit
    robertl.brojilo.nextval     6129     17.06.2003 14:02:42     17.06.2003 16:23:23     seminar
    But all records were rejected by the Loader, for every record I get the error:
    Record 1: Rejected - Error on table ROBERTL.TBLTEST, column REDBROJUNOS.
    ORA-01722: invalid number

  • SQL*Loader-273: READBUFFERS may be used only in direct path.

    Hi,
    I am trying to upgrade from OWB 10G to 11G. y map from flat file to stage maps work fine in 10G. when i upgrade the maps to 11G i get the error:
    Error
    RPE-01013: SQL Loader reported error condition, number 1.
    SQL*Loader: Release 11.1.0.7.0 - Production on Fri May 8 15:10:20 2009
    Copyright (c) 1982, 2007, Oracle. All rights reserved.
    SQL*Loader-273: READBUFFERS may be used only in direct path.
    SQL*Loader: Release 11.1.0.7.0 - Production on Fri May 8 15:10:20 2009
    Copyright (c) 1982, 2007, Oracle. All rights reserved.
    SQL*Loader-273: READBUFFERS may be used only in direct path.
    if i go to configure and make the READBUFFERS to = 0 then the map works fine. this used to work fine in 10G. I compared the .CTL file of sql loder and i notice the 10G sql loader file did not care for this property being set. while in 11G .ctl file i see the readbuffer property being set. though i can make the map run in 11G i can not go to each map and then reset it. ...Please help.
    Thanks

    IN 10 G environment
    a.)Direct path = False.
    b.) Read buffers = 4 (defaults to 4)
    10G Code generated :
    -- Oracle Warehouse Builder
    -- Generator Version : 10.1.0.4.0
    -- Created Date : Mon May 11 10:16:31 CDT 2009
    -- Modified Date : Mon May 11 10:16:31 CDT 2009
    -- Created By : owb_repository
    -- Modified By : owb_repository
    -- Generated Object Type : SQL*Loader Control File
    -- Generated Object Name : GFHGF
    -- © 2003 Oracle Corporation. All Rights Reserved.
    OPTIONS ( ERRORS=50, BINDSIZE=50000, ROWS=200, READSIZE=65536)
    LOAD DATA
    CHARACTERSET WE8MSWIN1252
    INFILE 'C:\EAND.dat'
    INTO TABLE "{{ORACLE10G.Schema}}"."EAND"
    APPEND
    REENABLE DISABLED_CONSTRAINTS
    FIELDS
    "PERSON_SSN_SOURCE" POSITION (3:3) CHAR
    IN 11 G environment
    a.)Direct path = False.
    b.) Read buffers = 4 (for new maps crated defaults to 0)
    -- Generator Version : 11.1.0.7.0
    -- Created Date : Mon May 11 10:06:37 CDT 2009
    -- Modified Date : Mon May 11 10:06:37 CDT 2009
    -- Created By : OWB_WUSER
    -- Modified By : OWB_WUSER
    -- Generated Object Type : SQL*Loader Control File
    -- Generated Object Name : "GFHGF"
    -- Copyright © 2000, 2007, Oracle. All rights reserved.
    OPTIONS (BINDSIZE=50000,ERRORS=50,ROWS=200,READSIZE=65536)
    LOAD DATA
    CHARACTERSET WE8MSWIN1252
    INFILE '{{ETL_FILE_LOC.RootPath}}{{}}EAND.dat''
    BADFILE '{{ETL_FILE_LOC.RootPath}}{{}}EAND'
    READBUFFERS 4
    CONCATENATE 1
    INTO TABLE "STAG"."EAND"
    TRUNCATE
    REENABLE DISABLED_CONSTRAINTS
    "PERSON_SSN_SOURCE" POSITION (3:3) CHAR
    my question is even as both the properties in 10G and 11G are same why does .ctl file generated in 11G has statement "READBUFFERS 4" while this is neglected in owb 10G generated .ctl file? Please Help.
    Edited by: user591315 on May 11, 2009 8:14 AM
    Edited by: user591315 on May 11, 2009 8:16 AM

  • How to connect sqlserver use oracle sql developer?

    I created a non-oracle location connection in owb and can load data from sqlserver to warehouse. Now, I want to use sqlplus or sqldeveloper to connect sqlserver directly, But I got this error message"ora-03135:connection lost contact".
    How can I connect sqlserver in sqldeveloper or sqlplus?
    Thanks

    Hi Napo,
    SQLDeveloper can migrate to oracle, browse sqlserver and run and display results from single statements.
    I have not seen "ora-03135:connection lost contact" have you set up sqlserver for tcp/ip connection, checked the port is open (and not blocked by, for example, firewalls) and used the jtds driver to connect SQLDeveloper to sqlserver?
    Note that "ora-03135:connection lost contact" is an oracle error and does not seem related to sqlserver.
    Oracle also has heterogenous gateway products which may be useful
    Oracle® Database Gateway for SQL Server User's Guide
    http://download.oracle.com/docs/cd/B28359_01/gateways.111/b31049/toc.htm
    -Turloch

  • SQL Loader and Oracle 11g

    Hello,
    Im receiving an sqlldr: not found error. Im getting ready to talk with our System Admin about the situation. Before I do I wanted to make sure that SQL Loader (sqlldr) is an available add-on for the Oracle 11 client. A co-worker mentioned that SQLLDR may not be available as an add-on in the Oracle 11 client and that we would need to use IMPORT/EXPORT instead. Is this a true statement?
    Can someone please clarify these issues for me?
    Thanks a bunch!

    SQL*Loader is certainly available in either the 11.1 or 11.2 full client install. It may or may not be a component that is installed by default depending on the type of install you select during the installation process. But you can always go back and install that component.
    If you are talking about the Instant Client, I'm not sure that either SQL*Loader or import and export work with the Instant Client.
    And just to point it out, if you're using 11g, you would generally want to be using external tables rather than SQL*Loader.
    Justin

  • Problem using SQL-LOADER and Unique Identifiers

    I'm trying to load a fixed-length records file containing people names and phone numbers. Data is specified as follows
    Toni Tomas66666666669999999999
    Jose Luis 33333333330000000000
    Notice that a maximum of 2 numbers can follow a person name, and 0000000000 means "no number specified".
    I want to assign a unique identifier to people (instead of using the NAME field as a Primary Key) using an Oracle Sequence. I did that, but I don't know
    how to assign the same id to each number.
    Considering the 2 previous lines, desired result should be:
    PEOPLE
    ======
    1     Toni Tomas
    2     Jose Luis
    TEL_NUMBERS
    ===========
    1     6666666666
    1     9999999999
    2     3333333333
    In order to achieve that, my Control File looks like this
    LOAD DATA
    INFILE phonenumbers.txt
    INTO TABLE people
         personID "mySequenceName.nextval", --an Oracle sequence
         name POSITION(1:10) CHAR
    INTO TABLE tel_numbers
    WHEN phonenumber !='0000000000'
         personID !!!DON'T KNOW HOW TO REFERENCE THE SAME ID!!!!
         phonenumber POSITION(11:20) CHAR
    INTO TABLE tel_numbers
    WHEN phonenumber !='0000000000'
         personID !!!DON'T KNOW HOW TO REFERENCE THE SAME ID!!!!
         phonenumber POSITION(21:30) CHAR
    I tried lots of things, but anyone works:
    a) reference the ID using something like ":\"people.personID\" (or similar aproaches)
    b) using a BEFORE INSERT TRIGGER getting the CURRVAL value of the Sequence. This solution
    does not work because it seems that all people is loaded before any telephone number. Hence,
    all phone numbers are associated, wrongly, to the last person in the data file.
    Does anyone know how can I solve this issue?
    Help would be appreciated. Thank you.

    Hi V Garcia.
    Information within the file is correct. Each line represents a COMPLETE record (Part of the line represents parent information and the rest is children data). As you can see in my first message, you can have more than one detail for a given master (i.e. two phone numbers):
    Toni Tomas66666666669999999999
    (10 chars for the name, 10 for each phone number. Thus, 2 children records to be created)
    With the solution given by Sreekanth Reddy Bandi (use of CURRVALUE within the SQL-Loader Control File), not all the details are linked to the parent record on the DB tables. It seems SLQ-Loader gets crazy when there is such amount of information.

Maybe you are looking for

  • Select statement in if/else condition

    Hi i need to write a select statement in the if condition in pl/sql how can i write this example : if field_name not in (select statement) then Is this type of if condition is possible in pl/sql? thanks in advance for help.

  • A new video now present on my Firefox home page is causing the browser to crash on two computers. How do I remove it?

    Just today, the problem started on my work laptop. When Firefox first opens everything is okay, whether the video pop-up window is there or not. However, if I then open a new tab and select my Firefox home page, about 80% of the time the browser cras

  • Could not load library for database connection LCA

    Hi, I am facing RFC connection prblem while connectiong to database. I have installed SCM5.1 and live cache in single server Please find the logs. Work process log: B Mon Jul 20 11:19:13 2009 B  create_con (con_name=LCA) B  Loading DB library 'E:\usr

  • Simultaneous httpservice in the same component

    Dear Flexer, I created an Air application. On loading my component, I'd to make simultaneous request to my database to load some data to my component. My component is a form with several comobobox and and text field. But to do that I have two major p

  • From Sony XDCAM to DVD

    Ok, give me a simple flow chart on how to get HD video from and Sony XDCAM (PDW-700) to a DVD. Here's what we are doing now... We import the vids off the recording deck using Sony's XDCAM transfer utility. Once in FCS, we edit and then shoot it over