Can we give validations in sql loader

hi gems...
i want to populate a table through sql loader...but i have to give some conditions while inserting the records i.e. i have to give some checks and validations...
is it possible to give conditions in sql loader...
please help...

Probably you can use WHEN clause while loading the data. Please check the below documentation for more information.
http://download.oracle.com/docs/cd/E11882_01/server.112/e22490/ldr_control_file.htm#i1005657

Similar Messages

  • Function for column validation in SQl Loader control file.

    Hello Gurus,
    We have an requirement to create a function to validate all date and number columns in control file, and return 0/1 accordingly to valid_column which is last column . I have developed the function which accepts the number and date type columns as parameter and return Y/N. My question is, is there any way so that the function could be created without passing any parameter to it?
    If yes, then how to call the function in control file?
    I have been searching since a while on Google to find out any solution but could find out.
    Using Oracle 11g Enterprise Edition Release 11.2.0.1.0
    Thanks!
    Edited by: Sush on Jul 5, 2012 2:23 AM
    Edited by: Sush on Jul 5, 2012 4:16 AM
    Edited by: Sush on Jul 5, 2012 7:28 AM

    Hi Srini,
    I have gone through this document and i couldn’t find out any solution. That’s why i was seeking help from you Gurus.
    Thanks for your help, i think i have learnt few new things abt SQL Loader by studying this document :)
    Thanks!

  • Can't create valid PL/SQL stored procedure

    I have two questions about PL/SQL and JDBC:
    Question 1: I'm trying to create and execute a PL/SQL stored procedure, and I can't seem to get the syntax right. I'm trying to create the simplest stored proc I can. Here's the stored procedure:
    create or replace procedure test( inParam char(20) ) is
    begin
    select inParam from dual;
    end;
    When I try to execute it, I'm getting the error:
    PLS-00905: object TEST is invalid
    The creation of the proc, and the execution are being done using the same login.
    Question2: Once I get the stored procedure created, I want to call it from a JDBC application. Is this the correct syntax:
              CallableStatement stmt = connection.prepareCall("begin test('abc'); end;");
    or can I use the standard JDBC escape sequence:
              CallableStatement stmt = connection.prepareCall("{ call test('abc'); }");
    Thanks for your help,
    Jeff

    Forgot to mention, I'm using TimesTen 11.2.1.4.

  • Sql loader error with date format

    Hi everyone,
    I have table and have a data in one coulmn RECORDED_DATE like '20090224' and my client is asking me to load this coulmn data in 'yyyymmdd' format.I am strucked up with my ideas.I used to_date('20090124','yyyymmdd') in control file.but it is also not working Here it is my control file
    LOAD DATA
    INFILE 'C:\xxxx\SQLLDR\HE data\HE_data_Feb.txt'
    BADFILE 'C:\xxxx\SQLLDR\HE data.bad'
    DISCARDFILE 'C:\xxxx\SQLLDR\HE data.dsc'
    INTO TABLE LSCCMGR.FASTPAY_HE_DATA
    REPLACE
    fields terminated by X'09'
    TRAILING NULLCOLS
    (RECORDED_DATE "TO_DATE(:RECORDED_DATE,'mm/dd/yyyy')"
    AGENT_ID
    MEASURE
    TRANSACTIONS
    FEES
    If i excute like this i am getting the error like
    Record 1: Rejected - Error on table LSCCMGR.FASTPAY_HE_DATA, column RECORDED_DATE.
    ORA-01843: not a valid month
    Getting for all records,what i need o change to get the RECORDED_DATE as dateformat.Ple any one help me in this issue to resolve
    How can we perform this using sql loader pls let me know,Thanks in advance.
    Sravan

    Hi,
    >>(RECORDED_DATE "TO_DATE(:RECORDED_DATE,'mm/dd/yyyy')"
    *Change this line to*
    (RECORDED_DATE "TO_DATE(:RECORDED_DATE,'yyyymmdd')"Regards,

  • SQL Loader problem while loading records from txt file to database table.

    I am getting following error while loading records from flat txt file into database table with the help of 'sqlldr' command. I have executed catldr.sql from RDBMS folder but it is still showing same error. I am setting DIRECT = TRUE while issuing sqlldr command. If I try with DIRECT = FALSE then it works fine. Database is Oracle 8i.
    SQL*Loader-951: Error calling once/load initialization
    ORA-24329: invalid character set identifier
    F1 Please.

    Hello,
    Direct path load, can only be used with SQL*Loader and Database have the same version.
    Care to tell the database version and sql*loader version you are using.
    -Sri

  • SQL*Loader and ORA-00054

    I was wondering if anyone knows a way to prevent ORA-00054 errors on tables when using SQL*Loader. I'm currently invoking scripts that extract data from a source system and load into a table in my database. I'm concurrently invoking the script because I have multiple source systems to improve my overall time for the loads. Sometimes, I get failures on the loads due to ORA-00054 errors. Can this be prevented? Is these a WAIT command/option that can be turned on for SQL*Loader?

    desc toto
    Name Null? Type
    COL1 DATE
    Controlfile :
    load data
    infile 'titi.dat'
    truncate
    into table titi
    (col1 position(1:7) DATE "YYYYMMDD" "DECODE (:col1, '9999999','19990101','000000
    0',null,:col1 + 19000000)")
    Indeed, the input format date is SYYMMDD where S=0 if year=19xx and S=1 if Year=20xx.
    Thanks for your reply.

  • SQL Loader or Materialized view

    Can we achive the following SQL Loader ?
    If yes can someone point me out some ling
    Requirement:
    We need to create a Reporting DB to use for Reporting and a Transactional DB will be in separate Host. Basically we need to pull data from a set of tables from Transactional DB and move to Reporting DB schema at proper intervals.
    We might have to get data from different column from different tables and store it in a single table/multiple tables in Reporting DB
    If as part of housekeeping of the Source database we delete some records (older records), In that case we have to ensure that this delete does not happen in reporting DB

    Materialized view will be the best option for this. You can schedule jobs for refreshing the Materialized view at some interval. If you use sqlloader you need to do some coding.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14226/repmview.htm#REPLN003
    Edited by: sac on Nov 16, 2009 10:58 AM

  • Help in calling sql loader and an oracle procedure in a script

    Hi Guru's
    please help me in writing an unix script which will call sql loader and also an oracle procedure..
    i wrote an script which is as follows.
    !/bin/sh
    clear
    #export ORACLE_SID='HOBS2'
    sqlldr USERID=load/ps94mfo16 CONTROL=test_nica.ctl LOG=test_nica.log
    retcode=`echo $?`
    case "$retcode" in
    0) echo "SQL*Loader execution successful" ;;
    1) echo "SQL*Loader execution exited with EX_FAIL, see logfile" ;;
    2) echo "SQL*Loader execution exited with EX_WARN, see logfile" ;;
    3) echo "SQL*Loader execution encountered a fatal error" ;;
    *) echo "unknown return code";;
    esac
    sqlplus USERID=load/ps94mfo16 << EOF
    EXEC DO_TEST_SHELL_SCRIPT
    it is loading the data in to an oracle table
    but the procedure is not executed..
    any valuable suggestion is highly appriciated..
    Cheers

    multiple duplicate threads:
    to call an oracle procedure and sql loader in an unix script
    Re: Can some one help he sql loader issue.

  • Hi i need a help on sql loader

    Hi all
    How can i check weather the SQL Loader is installed in my system or not .
    Thanks and regards
    goutham

    Hi
    it is located in D:\oracle\product\10.2.0\client_1\BIN. how should i acees this with command prompt .
    i am totaly new to it and need to know it if any document is avialable on sql loader can any body pls send it me r say me where can i found it on net
    thanks in advance
    goutham

  • HELP: SQL*LOADER AND Ref Column

    Hallo,
    I have already posted and I really need help and don't come further with this
    I have the following problem. I have 2 tables which I created the following way:
    CREATE TYPE gemark_schluessel_t AS OBJECT(
    gemark_id NUMBER(8),
    gemark_schl NUMBER(4),
    gemark_name VARCHAR2(45)
    CREATE TABLE gemark_schluessel_tab OF gemark_schluessel_t(
    constraint pk_gemark PRIMARY KEY(gemark_id)
    CREATE TYPE flurstueck_t AS OBJECT(
    flst_id NUMBER(8),
    flst_nr_zaehler NUMBER(4),
    flst_nr_nenner NUMBER(4),
    zusatz VARCHAR2(2),
    flur_nr NUMBER(2),
    gemark_schluessel REF gemark_schluessel_t,
    flaeche SDO_GEOMETRY
    CREATE TABLE flurstuecke_tab OF flurstueck_t(
    constraint pk_flst PRIMARY KEY(flst_id),
    constraint uq_flst UNIQUE(flst_nr_zaehler,flst_nr_nenner,zusatz,flur_nr),
    flst_nr_zaehler NOT NULL,
    flur_nr NOT NULL,
    gemark_schluessel REFERENCES gemark_schluessel_tab
    Now I have data in the gemark_schluessel_tab which looks like this (a sample):
    1 101 Borna
    2 102 Draisdorf
    Now I wanna load data in my flurstuecke_tab with SQL*Loader and there I have problems with my ref column gemark_schluessel.
    One data record looks like this in my file (it is without geometry)
    1|97|7||1|1|
    If I wanna load my data record, it does not work. The reference (the system generated OID) should be taken from gemark_schluessel_tab.
    LOAD DATA
    INFILE *
    TRUNCATE
    CONTINUEIF NEXT(1:1) = '#'
    INTO TABLE FLURSTUECKE_TAB
    FIELDS TERMINATED BY '|'
    TRAILING NULLCOLS (
    flst_id,
    flst_nr_zaehler,
    flst_nr_nenner,
    zusatz,
    flur_nr,
    gemark_schluessel REF(CONSTANT 'GEMARK_SCHLUESSEL_TAB',GEMARK_ID),
    gemark_id FILLER
    BEGINDATA
    1|97|7||1|1|
    Is there a error I made?
    Thanks in advance
    Tig

    multiple duplicate threads:
    to call an oracle procedure and sql loader in an unix script
    Re: Can some one help he sql loader issue.

  • SQL Loader versus External Table

    If anyone has worked on external tables please let me know your views.

    user637544 wrote:
    for sqlldr i follow the following approach
    1. truncate table
    2. call sqlldr and load records in staging table
    3. check for bad records
    how do i tuncate, call external table and check bad records for external table.As part of the SQL*Loader control file you can tell it to truncate the table as part of the process before it loads in the data.
    The key differences between SQL*Loader and External Tables are:
    1. SQL*Loader is an external utility run from the o/s command line, whereas External tables are usable from within SQL and PL/SQL.
    2. SQL*Loader can only load data up into the database, whereas External tables can allow you to read files and write files (10g onwards)
    3. SQL*Loader has limited control on skipping rows etc. whereas External tables can be queried using SQL and has all the flexibility that SQL can offer.
    4. SQL*Loader requires connection information to the database, whereas External tables are already part of the database
    5. SQL*Loader can only change the source filename through dynamic o/s level scripts, whereas External tables can have the filename changed using an ALTER TABLE ... LOCATION ... command.
    If you want to truncate your staging table before loading it with data from the external table, then you will just have to do that as a seperate step, because the external table is not associated with other tables. Simply truncate the other table and then query the data from the external table into the staging table.
    External tables offer a lot more flexibility than using SQL*Loader.

  • SQL Loader - Also posted in Database-General forum

    Hi All,
    I am using Oracle 9i and am new to it. I created a new user and I am not very sure if I assigned all the priveleges and roles correctly.
    Problem is that I cannot log into SQL Plus and neither can I use SQL Loader. Am working in Windows XP environment. I can connect to SQLPLUS and SQL LOADER with the usual scott/tiger userid/passwd. Why cant I connect with the username/password that I created?
    I can use the Enterprise Manager Console provided by Oracle with scott/tiger as well as with the new username/password that I created. But why cant I connect to SQL Loader and SQL Plus?
    Regards,
    Mahesh.

    The error says:
    ORA-01017: invalid username/password; logon denied
    Which seems to indicate that you are not using correct
    password that you assigned when CREATE USER command was
    executed.
    Possibly, when you connect using enterprise manager, you
    might be connecting as SYSDBA which allows you to login
    since your NT userid might be part of the DBA group.
    try conncting to the database using the AS SYSDBA syntax
    when using SQL*Plus:
    click on START -> RUN
    and type "SQLPLUS.EXE /nolog" (without double-quotes) and click ok.
    At the SQL prompt, type connect <username> AS SYSDBA
    and see if you can connect.
    If you can, this means that when you created this new
    user you gave it SYSDBA privs. and at that point,
    password (or the username for that matter) is ignored.
    See the following session. here I do NOT have any user created by the name "XYZ" still when I connect AS SYSDBA,
    it allows me to connect:
    =======================================================
    SQL> connect xyz as sysdba
    Enter password:
    Connected.
    SQL>
    =======================================================

  • SQL Loader Control File configuration

    Hi,
    I'm writing loader scripts for a Consulting team to use to load standard format files for customers. I want to be able to support different field separators without having to create copies of the control files for each separator variant.
    e.g.
    LOAD DATA
    INFILE "%IMPPATH%\BaseProd.txt"
    BADFILE "%IMPPATH%\BaseProd.bad"
    DISCARDFILE "%IMPPATH%\\BaseProd.dsc"
    INSERT INTO TABLE
              IMPORT_PRODUCT
         FIELDS TERMINATED BY ','
         OPTIONALLY ENCLOSED BY '"'
         TRAILING NULLCOLS
    (      PROD_CD      "UPPER(:PROD_CD)",
         PROD_DESCRP,
         SELL_PRICE)
    I'd like to be able to specify a %variable% for the FILEDS TERMINATED BY value. (The %IMPPATH% works a treat for the location of the file.)
    Anyone know how to achieve this?
    Thanks in advance.

    I have tried
    SET MYSEPARATOR=,
    and
    FIELDS TERMINATED BY '%MYSEPARATOR%'
    I then get the message in the LOG file
    Column Name Position Len Term Encl Datatype
    PROD_CD FIRST * O(") CHARACTER
    Terminator string : '%MYSEPARATOR%'
    It appears to be looking for the complete string %MYSEPARATOR% as the separator!
    I have also tried
    SET MYSEPARATOR=','
    and
    FIELDS TERMINATED BY %MYSEPARATOR%
    which gives the error
    SQL*Loader-350: Syntax error at line 9.
    Illegal combination of non-alphanumeric characters
    FIELDS TERMINATED BY %MYSEPARATOR%
    ^

  • Using SQL Loader in more than one table

    Hi all,
    I have a new question for those who have used SQL Loader. I
    have never used it and I just know that I need a control file to
    tell SQL Loader what is my flat file layout and what table the
    information goes to. My problem is: my flat file has information
    that goes to two tables in my schema. Those files are very big
    (aprox 280Mb) and I would like to read them just once. Can I do
    this with SQL Loader?
    Other question, is that the fastest way to import data from
    flat files becouse I am using PERL and it takes aprox. 9 hours
    to import 10 of those files. I could use UTL_FILE to read it but
    I heard that SQL Loader was better.
    Thanks for your cooperation
    (Robocop)
    Marcelo Lopes
    Rio de Janeiro - Brazil

    SQL*Loader is the fastest way to load, particularly in direct parallel mode, and can certainly load to multiple tables.
    >
    My advice would be to have a look at the examples given in the Oracle Utilities guide, there is one for loading to multiple
    tables, which I have pasted below.
    >
    -- Loads EMP records from first 23 characters
    -- Creates and loads PROJ records for each PROJNO listed
    -- for each employee
    LOAD DATA
    INFILE &#8217;ulcase5.dat&#8217;
    BADFILE &#8217;ulcase5.bad&#8217;
    DISCARDFILE &#8217;ulcase5.dsc&#8217;
    REPLACE
    INTO TABLE emp
    (empno POSITION(1:4) INTEGER EXTERNAL,
    ename POSITION(6:15) CHAR,
    deptno POSITION(17:18) CHAR,
    mgr POSITION(20:23) INTEGER EXTERNAL)
    INTO TABLE proj
    -- PROJ has two columns, both not null: EMPNO and PROJNO
    WHEN projno != &#8217; &#8217;
    (empno POSITION(1:4) INTEGER EXTERNAL,
    projno POSITION(25:27) INTEGER EXTERNAL) -- 1st proj
    INTO TABLE proj
    WHEN projno != &#8217; &#8217;
    (empno POSITION(1:4) INTEGER EXTERNAL,
    projno POSITION(29:31 INTEGER EXTERNAL) -- 2nd proj
    INTO TABLE proj
    WHEN projno != &#8217; &#8217;
    (empno POSITION(1:4) INTEGER EXTERNAL,
    projno POSITION(33:35) INTEGER EXTERNAL) -- 3rd proj
    see the documentation for a complete explanation of the configuration.
    Thanks, I will read it.

  • SQL Loader (newbee)

    Can anyone tell me how I would go about uploading a .csv file into Oracle 8i?
    I understand that this can be done via the SQL loader, but how?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Richard Llewellyn ([email protected]):
    Can anyone tell me how I would go about uploading a .csv file into Oracle 8i?
    I understand that this can be done via the SQL loader, but how?<HR></BLOCKQUOTE>
    null

Maybe you are looking for

  • Manual de Integracao v300-2009-03-16 - SAP 4.7 SP30 preparado para NF-e?

    Boa tarde, Estou iniciando um projeto de implementação de MP135 + NF-e + SPED na versão 4.7 do SAP, este ambiente encontra-se atualizado com o SP30. Gostaria de saber se é possível configurar a NF-e com base no novo layout definido no "novo" manual d

  • Questions in XI

    please answer me 1.How to Use Third Party Adapters in u r project.? 2.How to Use External Objects?

  • Links wont open when i click on them

    every link i click on especially links in my email messages..wont open..started doing this when i got the new email version

  • Installation of Solaris 86

    Hi, I have an old dual boot windoze 98 /mandriva Linux machine, which I want to totally convert to solaris. I down loaded solaris 10, but my machine is 1998, so only supporting installation from floppy, and there is no floppy for solaris 10 - you can

  • Multiple PO assigned to single Import PO

    Dear MM Followers. In the case of imports PO there are various vendors which are linked to a Imports PO like insurance,transportation,stuffing/destuffing of containers,third part inspection etc. In standard SAP we release the main PO on the Import ve