Loading Data into Table with Complex Transformations

Hello Guys
I am trying to load data into one of the Dimension table and it has quite a few Transformations and i created 6 temp tables
1. It has 7 Columns , Gets 935 rows based on where condition
2. It has 10 Columns , Gets 935 rows with but it has nulls in it i.e for column 1 there are 500 fields and columns 2 there are 300 etc ...
3 , 4 , 5 , 6 all the same as the 2 table
and at the end when i am trying to join all the temp tables with the Product_id into the target , which is in each temp table ...
I am Getting Error Saying Not Obeying Primary key Constraints i.e unique values are not been inserting into the Product_id Column of Target Table and the Job is running for Hours
and the main Problem comes at , some of the Columns have the same Product_id
Please help me
I have been Trying for 1 week and i am in Full pressure
Thanks
Sriks
Edited by: Sriks on Oct 16, 2008 6:43 PM

Hi,
If you are creating a warehouse and product_key is ur PK then it should come only once and so u might have to think ur logic in getting the data. To get over the isue u can disable the constraint and load with out the cosntraint, but i would have u look at the logic and make sure u have only 1 product_key in the table.
Regards
Bharath

Similar Messages

  • How can I load data into table with SQL*LOADER

    how can I load data into table with SQL*LOADER
    when column data length more than 255 bytes?
    when column exceed 255 ,data can not be insert into table by SQL*LOADER
    CREATE TABLE A (
    A VARCHAR2 ( 10 ) ,
    B VARCHAR2 ( 10 ) ,
    C VARCHAR2 ( 10 ) ,
    E VARCHAR2 ( 2000 ) );
    control file:
    load data
    append into table A
    fields terminated by X'09'
    (A , B , C , E )
    SQL*LOADER command:
    sqlldr test/test control=A_ctl.txt data=A.xls log=b.log
    datafile:
    column E is more than 255bytes
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)

    Check this out.
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96652/ch06.htm#1006961

  • Loading data into table with filename

    Hi All,
    I am new to ODI. I have a requirement to load of a flat file into oracle, along with the name of file in one column of the table. That means, if there are 10 rows of data from that file then the additional column 'FileName" of the table will have current file name written 10 times. Please suggest how this can be achieved. I am able to do half of it but file name is not populated.
    Thanks.

    Hi ,
    Probably what you can do is
    1. create a variable to read the file name . Refer http://odiexperts.com/?tag=file-variable-odi for creating such a variable.
    2. Now in your interface , target table column which holds the filename , use '#<variable created in step 1>'
    and specify it to be executed on target .
    It should do the trick .
    Thanks,
    Sutirtha

  • FDMEE Import error "No periods were identified for loading data into table 'AIF_EBS_GL_BALANCES_STG'

    Hi,
    We are having trouble while importing one ledger 'GERMANY EUR GGAAP'. It works for Dec 2014 but while trying to import data for 2015 it gives an error.
    Import error shows " RuntimeError: No periods were identified for loading data into table 'AIF_EBS_GL_BALANCES_STG'."
    I tried all Knowledge docs from Oracle support but no luck. Please help us resolving this issue as its occurring in our Production system.
    I also checked all period settings under Data Management> Setup> Integration Setup > Global Mapping and Source Mapping and they all look correct.
    Also its only happening to one ledger rest all ledgers are working fine without any issues.
    Thanks

    Hi,
    there are some Support documents related to this issue.
    I would suggest you have a look to them.
    Regards

  • Shell Script Programming -- Loading data into table

    Hello Gurus
    I am using Oracle's sql*loader utility to load data into a table. Lately, I got an unlikely scenario where in I need to process the data file first before loading it into the table and where I need help from you guys.
    Consider the following data line
    "Emp", DOB, Gender, Subject
    "1",01/01/1980,"M","Physics:01/05/2010"
    "2",01/01/1981,"M","Chemistry:02/05/2010|Maths:02/06/2011"
    "3",01/01/1982,"M","Maths:03/05/2010|Physics:06/07/2010|Chemistry:08/09/2011"
    "4",01/01/1983,"M","Biology:09/09/2010|English:10/10/2010"Employee - 1 will get loaded as a single record in the table. But I need to put Subject value into two separate fields into table. i.e. Physics into one column and date - 01/05/2010 into separate column.
    Here big problem starts
    Employee - 2 Should get loaded as 2 records into the table. The first record should have Chemistry as subject and date as 02/05/2010 and the next record should have all other fields same except the subject should be Maths and date as 02/06/2011. The subjects are separated by a pipe "|" in the data file.
    Similarly, Employee 3 should get loaded as 3 records. One as Maths, second as Physics and third as Chemistry along with their respective dates.
    I hope I have made my problem clear to everyone.
    I am looking to do something in shell scripting such that before finally running the sql*loader script, the above 4 employees have their records repeated as many times as their subject changes.
    In summary 2 problems are described above.
    1. To load subject and date into 2 separate fields in Oracle table at the time of load.
    2. If their exists multiple subjects then a record is to be loaded that many times as there exists any changes in employee's subject.
    Any help would be much appreciated.
    Thanks.

    Here are some comments. Perl can be a little cryptic but once you get used to it, it can be pretty powerful.
    #!/usr/bin/perl -w
    my $line_count = 0;
    open FILE, "test_file" or die $!;
    # Read each line from the file.
    while (my $line = <FILE>) {
        # Print the header if it is the first line.
        if ($line_count == 0) {
            chomp($line);
            print $line . ", Date\n";
            ++$line_count;
            next;   
        # Get all the columns (as separated by ',' into an array)
        my @columns = split(',', $line);
        # Remove the newline from the fourth column.
        chomp($columns[3]); 
        # Read the fields (separated by pipe) from the fourth column into an array.
        my @subject_and_date = split('\|', $columns[3]);     
        # Loop for each subject and date.
        foreach my $sub_and_date (@subject_and_date) {
            # Print value of Emp, DOB, and Gender first.
            print $columns[0] . "," . $columns[1] . "," . $columns[2] . ",";
            # Remove all double quotes from the subject and date string.
            $sub_and_date =~ s/"//g;
            # Replace ':' with '","'
            $sub_and_date =~ s/:/","/;
            print '"' . $sub_and_date . '"' . "\n";       
        ++$line_count;
    close FILE;

  • Not able to load data in tables with correct way

    Hi
    i made one trigger to load data in view and tables.
    CODE FOR TRIGGER>>>>
    Object Details Code Errors SQL
    CREATE OR REPLACE TRIGGER "WELL_GENERATOR_TRIGGER_1"
    INSTEAD OF INSERT ON VIEW_WELL_GENERATOR_FORM
    FOR EACH ROW
    DECLARE
    rowcnt number;
    BEGIN
    INSERT INTO facility (FAC_PK) VALUES (:NEW.FAC_PK);
    SELECT COUNT(*) INTO rowcnt FROM WELL WHERE WEL_PK = :NEW.WEL_PK;
    IF rowcnt = 0 THEN
    INSERT INTO WELL (WEL_PK,SITE,FAC_FK) VALUES(:NEW.WEL_PK,:NEW.SITE,:NEW.FAC_PK);
    ELSE
    UPDATE WELL SET WELL.SITE = :NEW.SITE,
    WELL.FAC_FK = :NEW.FAC_PK
    WHERE WELL.WEL_PK = :NEW.WEL_PK;
    END IF;
    SELECT COUNT(*) INTO rowcnt FROM WELL_STATUS WHERE WELL_STATUS.STA_PK = :NEW.STA_PK;
    IF rowcnt = 0 THEN
    INSERT INTO WELL_STATUS (WELL_TYPE, WELL_TYPE_DATE, OPER_STATUS, CLASS,WEL_FK)
    VALUES(:NEW.WELL_TYPE, :NEW.WELL_TYPE_DATE, :NEW.OPER_STATUS, :NEW.CLASS,:NEW.WEL_PK);
    ELSE
    UPDATE WELL_STATUS SET WELL_STATUS.WELL_TYPE = :NEW.WELL_TYPE,
    WELL_STATUS.WELL_TYPE_DATE = :NEW.WELL_TYPE_DATE,
    WELL_STATUS.OPER_STATUS = :NEW.OPER_STATUS,
    WELL_STATUS.CLASS = :NEW.CLASS,
    WELL_STATUS.WEL_FK = :NEW.WEL_PK
    WHERE STA_PK = :NEW.STA_PK;
    END IF;
    SELECT COUNT(*) INTO rowcnt FROM PERMIT WHERE PERMIT.PER_PK = :NEW.PER_PK;
    IF rowcnt = 0 THEN
    INSERT INTO PERMIT (AUT_STATUS,WEL_FK) VALUES (:NEW.AUT_STATUS,:NEW.WEL_PK);
    ELSE
    UPDATE PERMIT SET PERMIT.AUT_STATUS = :NEW.AUT_STATUS,
    PERMIT.WEL_FK = :NEW.WEL_PK
    WHERE PERMIT.PER_PK = :NEW.PER_PK;
    END IF;Now But still i am not getting result which i want.Like in WELL_STATUS table i could nt able to insert the value (WEL_FK) from (WEL_PK).And In PERMIT table column (WEL_FK) still i could nt able to insert the value (WEL_PK).
    Now WEL_PK value autogenerate from the SEQ same with STA_PK and PER_PK.But instead of taking value from seq STA_PK take the value from WEL_PK (dnt know why ? But in data its shows me Same value WEL_PK and STA_PK).Same thing With PER_PK.
    so where i am wrong ? i really need your help.
    workspace:PRACTISE
    UN:[email protected]
    PW:testing
    Application:     39289 - TESTTING
    Thanks
    Edited by: vijaya45 on Jul 13, 2009 9:44 PM
    Edited by: vijaya45 on Jul 14, 2009 12:48 AM

    Hello vijaya45,
    Not sure if this will help, but I noticed you currently have a WELL_GENERATOR_TRIGGER_1 and a WELL_GENERATOR_TRIGGER_2, and "1" is disabled but "2" is enabled. Which one is supposed to be running at this point?
    John

  • Sql*loader - load data in table with multiple condition

    Hi,
    I have oracle 9i on Sun sloaris and i need to load data in one of oracle table using sql*loader with conditional column data.
    My table is like:
    Load_table
    col1 varchar2(10),
    col2 varchar2(10),
    col3 varchar2(10),
    Now i have to load data like:
    If col2 = US1 then col3 = 'AA'
    If col2 = US2 then col3 = 'BB'
    If col2 = US3 then col3 = 'CC'
    How can i load this data in table using sql*loader?
    Thanks,
    Pora

    Hi
    it is a half-solution.
    You have to:
    1. open file
    2. take a line
    3. split the line into values (using substring to)
    4. check condition (01 or 02)
    5. do a proper insertion
    Good Luck,
    Przemek
    DECLARE
    v_dir VARCHAR2(50) := 'd:/tmp/'; --directory where file is placed
    v_file VARCHAR2(50) := 'test.txt'; -- file name
    v_fhandle UTL_FILE.FILE_TYPE; ---file handler
    v_fline VARCHAR2(906); --file line
    v_check VARCHAR2(50);
    BEGIN
    v_fhandle := UTL_FILE.FOPEN(v_dir, v_file, 'R'); --open file for read only
    LOOP -- in the loop
    UTL_FILE.GET_LINE( v_fhandle , v_fline); -- get line by line from file
    if (substr(v_fline,17,2) = '01') then --check the value
    INSERT INTO ... -- Time_in
    else
    INSERT INTO ... -- Time_out
    end if;
    END LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN UTL_FILE.FCLOSE( v_fhandle );
    END;

  • How to load data into table Using Script Task

    We have a directory/folder where we have a file. We need to insert the File Created Date , File Name , Extension into the database table of Sql server by using Script Task.
    So could you please suggest , how to frame the connection string , fetch the file details and insert the data into the database table using Script Task of SSIS 2008

    You can achieve it as follows using standard script task
    1. Add a ForEachLoop container to point to your directory to iterate though the files. Add a variable of type string inside loop to get file name of each file it iterates. Choose option Filename and extension. Add a variable to just store extension part
    (FileExtension), set EValuateAsExpression true for it and give expression as below
    SUBSTRING(@[User::FileName],FINDSTRING(@[User::FileName],".",1)+1,LEN(@[User::FileName]))
    2. Add a script task inside loop and pass filename variable as a read only variable to it. Crete a new variable to get creationdate and pass it as ReadWrite. Inside write code as below
    Public Sub Main()
    ' Add your code here
    Dim f As New System.IO.FileInfo(Dts.Variables("FileName").Value.ToString())
    Dts.Variables("FileCreatedDate").Value = f.CreationTime
    Dts.TaskResult = ScriptResults.Success
    End Sub
    3. Add a Exec SQL Task after Script task inside loop and give a query like below
    INSERT INTO TableName (FileName,CreatedDate,Extension)
    VALUES(?,?,?)
    and in parameter tab map the parameter placeholders 0,1 and 2 to @[User::FileName],@[User::FileCreatedDate] & @[User::FileExtension] variables
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Importing data into tables with grant access (sql developer 3.2)

    Hello,
    I want to import data into a table PAY_BALANCE_BATCH_LINES which is an interface table. I'm logged in to a schema (APPS) and this table belongs to the HR schema. However, if you look at the grants, the APPS schema has all access to this particular table. In TOAD, this used to work great.
    But in sqldeveloper, when I filter the tables dropdown, I am not able to find this table. Since this is my primary way of uploading data I'm not sure how else I can get access to upload data into this table. I don't know the password for the HR schema by the way.
    Is there a way out?
    Many Thanks

    Scroll down the tree to the 'Other Users' node, expand it, and then drill down into HR > Tables. Then do your import.
    For an alternative browser, right-click on your connection in the tree and open a Schema Browser.

  • Issue with loading data into cube with duplicate members in different dimensions

    Have a cube with allowed dublicate members only in two dims (Period1 and Period2).
    Outlines saves with no errors, but when i try to load data, i get some errors:
    "Member 2012-12 is a duplicate member in the outline
    A6179398-68BD-7843-E0C2-B5EE81808D0B    01011    cd00    st01    2905110000    EK    fo0000    NNNN-NN-NN    2012-12    cust00000$$$    1" 
    These dims represent two similar periods of time. Am I to change member names and aliases a little in one of them(f.e. yyyy1-mm --> yyyy1 - mm1)?
    Users wouldnt like it...
    Period1
      yyyy1
        yyyy1/q1
          yyyy1-mm1
          yyyy1-mm2
          yyyy1-mm3   
        yyyy1/q2
    Period2
      yyyy1
        yyyy1/q1
          yyyy1-mm1
            yyyy1-mm1-dd1 
            yyyy1-mm1-dd2
          yyyy1-mm2
          yyyy1-mm3   
        yyyy1/q2
    Tnanx

    You may have to use fully qualified name something like
    [Period1].[2012-12]
    [Period2].[2012-12]
    You can refer to ESSBASE admin guide on "Creating and Working With Duplicate Member Outlines"
    Regards,
    Sunil

  • Cannot enter data into table with column named DATE

    I have a table as follows:
    CREATE TABLE PACKINGLINE (
    SNO VARCHAR2(13),
    "DATE" DATE DEFAULT SYSDATE,
    PRDORDNO VARCHAR2(12),
    NOW DATE DEFAULT SYSDATE,
    CONSTRAINT PACKINGLINE_PK PRIMARY KEY ("SNO", "DATE"));
    Note the "cleaverly" named DATE and NOW columns (yes, that is the name of the column... our company was bessed with a very clear SQL server DBA in the past)
    This SQL statement works:
    INSERT INTO PACKINGLINE (SNO, PRDORDNO) VALUES ('1000808972', '100080897');
    However when I try use SQL Developer as follows I cannot enter data:
    1. Open SQL Developer
    2. Click on "Tables" then on my table named PACKINGLINE
    3. Click the "Data" tab
    4. Click the [+] "Insert Row" Icon
    5. Enter the same data as above
    6. Click Commit
    7. The following error is shown in the log window and I cannot commit the data change.
    Error message
    ==================
    INSERT INTO "DBO"."PACKINGLINE" (SNO, PRDORDNO) VALUES ('1000808971', '100080897')
    One error saving changes to table "DBO"."PACKINGLINE":
    Row 5: ORA-06550: Row 1、Column 25:
    PL/SQL: ORA-06552: PL/SQL: Compilation unit analysis terminated
    ORA-06553: PLS-320: the declaration of the type of this expression is incomplete or malformed
    ORA-06550: Row 1、Column 7:
    PL/SQL: SQL Statement ignored
    ==================
    I can copy and paste the above query into a normal SQL statement window and the data commits fine.

    Its so flaky there really must be something wrong Mr Adobe support person....
    If I load a PDF, do nothing, gently save it, reopen and then waiting for my trial dialogue to wake up so that I can click on continue trial... then save as extended reader blah.... then close. I have finally saved one that works!!!! but how difficult is that????
    WHAT IS WRONG ADOBE??

  • Load data into Table

    I want to load certain columns from table1 into columns in another table (table2) which is similar to table1 but have some additional columns.
    I am aware of PL/SQL solution to doing this. But i need to do this using sql statement that is driven from Java.
    Important part is read data from table1, copy in another table (table2) and update status in table1 all these activities should be part of one transaction.

    use view if u know from which table which columb you want and call that view from java....and triggers are also usefull in that condition on running of that view trigger should do its work....actually it will be better if you can eloborate your problem.

  • Can i use one interface to load data into 2 different tables

    Hi Folks,
    Can i use one interface to load data into 2 different tables(same schema or different schemas) from one source table with same structure ?
    Please give me advice
    Thanks
    Raj
    Edited by: user11410176 on Oct 21, 2009 9:55 AM

    Hi Lucky,
    Thanks for your reply,
    What iam trying is ...Iam trying to load the data from legacy tables(3) into oracle staging tables.But i need to load the same source data into two staging tables(these staging tables are in two different schemas)
    can i load this source data into two staging tables by using single standard interface(some business logic is there)
    If i can then give me some suggestion how to do that
    Thanks in advance
    Raj

  • Error while loading  data into External table from the flat files

    HI ,
    We have a data load in our project which feeds the oracle external tables with the data from the Flat Files(.bcp files) in unix.
    While loading the data, we are encountering the following error.
    Error occured (Error Code : -29913 and Error Message : ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04063: un) while loading data into table_ext
    Please let us know what needs to be done in this case to solve this problem.
    Thanks,
    Kartheek

    Kartheek,
    I used Google (mine still works).... please check those links:
    http://oraclequirks.blogspot.com/2008/07/ora-29400-data-cartridge-error.html
    http://jonathanlewis.wordpress.com/2011/02/15/ora-29913/
    HTH,
    Thierry

  • How to  load data into user tables using DIAPIs?

    Hi,
    I have created an user table using UserTablesMD object.
    But I don't have know how to load data into this user table. I guess I have to use UserTable object for that. But I still don't know how to put some data in particular column.
    Can somebody please help me with this?
    I would appreciate if somebody can share their code in this regard.
    Thank you,
    Sudha

    You can try this code:
    Dim lRetCode As Long
    Dim userTable As SAPbobsCOM.UserTable
    userTable = pCompany.UserTables.Item("My_Table")
    'First row in the @My_Table table
    userTable.Code = "A1"
    userTable.Name = "A.1"
    userTable.UserFields.Fields.Item("U_1stF").Value = "First row value"
    userTable.Add()
    'Second row in the @My_Table table
    userTable.Code = "A2"
    userTable.Name = "A.2"
    userTable.UserFields.Fields.Item("U_1stF").Value = "Second row value"
    userTable.Add()
    This way I have added 2 lines in my table.
    Hope it helps
    Trinidad.

Maybe you are looking for