Load data into a table from two sources

I developed an interface that has tables of the source of a source database that contains data of 4 companies. (we have multiple servers for different companies). Now, there is a requirement to load the data to another company in the same data warehouse. The problem is that the source is on another server. The database structure is the same. The names of tables, constraints are the same.

I can't just duplicate my previous interface and change the data source to this interface. -Does anyone know how to do this. I have about 50 + such interface of re - developing another interface is quite a tedious task.

Hello

Here are links to examples of the context, in the examples they use development and Production environments in order to demonstrate the different environments.  In your project, it will be the different companies.  Create a context for each company, provided that the scheme remains the same across companies.

https://blogs.Oracle.com/dataintegration/entry/executing_the_same_code_in_all

Context, physical and logical schema - how does it work? -ODIExperts.com

http://www.odigurus.com/2011/10/ODI-contexts.html

Thank you

ARV

Tags: Business Intelligence

Similar Questions

  • Load data into a table

    Hi friends,

    I'm trying to load records into the rules of the product table of the table with the following...

    create table product)

    prod_id varchar2 (20).

    prod_grp varchar2 (20).

    from_amt number (10),

    to_amt number (10),

    share_amt number (10)

    );

    Insert into product (prod_id, prod_grp, from_amt, share_amt) Values ('10037', "STK", 1, 18);

    Insert into product (prod_id, prod_grp, from_amt, share_amt) Values ('10037', "NSTK", 1: 16.2);

    Insert into product (prod_id, prod_grp, from_amt, to_amt, share_amt) Values ('10038', "NSTK", 1, 5000, 12);

    Insert into product (prod_id, prod_grp, from_amt, to_amt, share_amt) Values ('10038', "STK", 5001, 10000, 16);

    Insert into product (prod_id, prod_grp, from_amt, share_amt) Values ('10038', "STK", 10001, 20);

    Insert into product (prod_id, prod_grp, from_amt, to_amt, share_amt) Values ('10039', "NSTK", 1, 8000, 10);

    Insert into product (prod_id, prod_grp, from_amt, share_amt) Values ('10039', "STK", 8001, 12);

    create table rules)

    rule_id varchar2 (30),

    rule_grp varchar2 (10),

    rate_1 number (10),

    point_1 number (10),

    rate_2 number (10),

    point_2 number (10),

    rate_3 number (10),

    point_3 number (10)

    );

    Criteria of loading in the rules of the table:

    rule_id - "RL" | Product.prod_id

    rule_grp - product.prod_grp

    rate_1 - product.share_amt where from_amt = 1

    point_1 - product.to_amt

    rate_2 - if product.to_amt in point_1 is not NULL, then find product.share_amt of the next record with the same rule_id/prod_id where from_amt (of the next record) = to_amt (current record -

    point_1) + 1

    point_2 - if product.to_amt in point_1 is not NULL, then find product.to_amt of the next record with the same rule_id/prod_id where from_amt (of the next record) = to_amt (current record - )

    point_1) + 1

    rate_3 - if product.to_amt in point_2 is not NULL, then find product.share_amt of the next record with the same rule_id/prod_id where from_amt (of the next record) = to_amt(current )

    Enregistrement-point_2) + 1

    point_3 - if product.to_amt in point_2 is not NULL, then find product.to_amt of the next record with the same rule_id/prod_id where from_amt (of the next record) = to_amt (current record - )

    point_2) + 1

    I tried to load the first columns (rule_id, rule_grp, rate_1, point_1, rate_2, point_2) via the sql loader.

    SQL > select * from product;

    PROD_ID PROD_GRP FROM_AMT TO_AMT SHARE_AMT

    -------------------- -------------------- ---------- ---------- ----------

    10037                STK                           1                    18

    10037                NSTK                          1                    16

    1 5000 12 NSTK 10038

    10038 5001-10000-16 STK.

    10038 10001 20 STK.

    10039 1 8000 10 NSTK

    10039                STK                        8001                    12

    produit.dat

    PROD_ID | PROD_GRP | FROM_AMT | TO_AMT | SHARE_AMT

    "10037' |'. STK' | 1. 18

    "10037' |'. NSTK' | 1. 16.2

    '10038' |' NSTK' | 1. 5000 | 12

    '10038' |' STK' | 5001 | 10000 | 16

    '10038' |' STK' | 10001 | 20

    "10039' |'. NSTK' | 1. 8000 | 10

    "10039' |'. STK' | 8001 | 12

    Product.CTL

    options (Skip = 1)

    load data

    in the table rules

    fields ended by ' |'

    surrounded of possibly ' '.

    trailing nullcols

    (rule_id POSITION (1) ""RL"|: rule_id")

    rule_grp

    from_amt BOUNDFILLER

    point_1

    share_amt BOUNDFILLER

    , rate_1 ' BOX WHEN: from_amt = 1 THEN: share_amt END.

    , rate_2 expression "(sélectionnez pr.share_amt de produit pr où: point_1 n'est pas null et pr.prod_id=:rule_id et: point_1 =: from_amt + 1)" "

    , expression point_2 "(sélectionnez pr.to_amt de produit pr où: point_1 n'est pas null et pr.prod_id=:rule_id et: point_1 =: from_amt + 1)" "

    )

    He has not any support only values in rate_2, point_2... no error either... Not sure if there is another method to do this...

    Please give your suggestions... Thank you very much for your time

    Hello

    Thanks for posting the CREATE TABLE and INSERT instructions for the sample data; It's very useful!

    Don't forget to post the exact results you want from this data in the sample, i.e. what you want the rule table to contain once the task is completed.

    As ground has said, there is no interest to use SQLLDR to copy data from one table to another in the same database.  Use INSERT, or perhaps MERGE.

    2817195 wrote:

    Thank you for your answers... I thought it would be easier to manipulate the data using sql loader... I tried to use insert but do not know how to insert values in point_2, rate_3, rate_2, point_3, columns... For example, when point_1 is not null, need to do a find for the next with the same rule_id record and if the inserted record = pr.from_amt + 1 point_1 then RATE_2 should be inserted with this pr.share_amt of this record...

    SQL > insert into the rules)

    2 rule_id,

    rule_grp 3,.

    rate_1 4,.

    point_1 5,.

    rate_2 6,.

    point_2 7,.

    rate_3 8,.

    9 point_3)

    10. Select

    11 'RL ' | PR.prod_id RULE_ID,

    12 pr.prod_grp RULE_GRP,

    13 CASES WHEN END of pr.from_amt = 1 THEN pr.share_amt RATE_1,

    14 pr.to_amt POINT_1,

    15 (select pr.share_amt from product pr where point_1 is not null and rules.rule_id = pr.prod_id and point_1 = pr.from_amt + 1) RATE_2,

    16 (select pr.to_amt from product pr where point_1 is not null and rules.rule_id = pr.prod_id and = pr.from_amt + 1 point_1) POINT_2,.

    17 (select pr.share_amt from product pr where point_2 is not null and rules.rule_id = pr.prod_id and = pr.from_amt + 1 point_2) RATE_3,.

    18 (select pr.to_amt from product pr where point_2 is not null and rules.rule_id = pr.prod_id and = pr.from_amt + 1 point_2) POINT_3

    19 product pr;

    (select pr.share_amt from product pr where point_1 is not null and point_1 = pr.from_amt + 1) RATE_2,

    *

    ERROR on line 15:

    ORA-00904: "POINT_1": invalid identifier

    Help, please... Thank you very much

    This is what causes the error:

    The subquery on line 15 references only 1 table in the FROM clause, and this table is produced.  There is no point_1 column in the product.

    A scalar subquery like this can be correlated to a table in the Super request, but the only table in the FROM (line 19) clause is also produced.  Since the only table that you read is produced, only columns that you can read are the columns of the product table.

    You use the same table alias (pr) to mean different things 5. It's very confusing.  Create aliases for single table in any SQL statement.  (What you trying to do, I bet you can do without all these subqueries, in any case.)

  • Need a sql script loader to load data into a table

    Hello

    IM new to Oracle... Learn some basic things... and now I want the steps to do to load the data from a table dump file...

    and the script for sql loader

    Thanks in advance

    Hello

    You can do all these steps for loading data...

    Step 1:

    Create a table in Toad to load your data...

    Step 2:

    Creating a data file... Create your data file with column headers...

    Step 3:

    Creating a control file... Create your control file to load the data from the table data file (there is a structure of control file, you can search through the net)

    Step 4:

    Move the data file and the control file in the path of the server...

    Step 5:

    Load the data into the staging table using sql loader.

    sqlldr control = data =

    connect as: username/password@instance.

  • How dynamically load data in target tables using as source files

    Hello

    My script needs a single interface to load data from 5 different files in five paintings of target using a single interface. All target tables have the same structure. It is possible to point to files variable source using ODI. But the same approach does not work with database tables. I get errors trying to make my table as dynamic target/source.

    Can anyone suggest anything. The last option would write a dynamic PL/SQL block in the KM. Other friends of suggestions?

    Kind regards
    Jay

    and not exists)
    Select 'X '.
    h. #PLAYGROUND. "v_tab_name"T ".

    have you provided the name of the resource with the quotes, if so please remove it and try.

    If you have provided the name of the variable, a v_tab_name and do not provide quotes. Can you please change the name of the variable to the capital, namely V_TAB_NAME and use the same in the data store too and please try again.

  • How to load data into the table of correspondence in OIM 11 g

    Hello
    I have a lot of data that must be loaded into the table of choice as Codekey and decode. How can I load the data in bulk instead of manually via console Design?

    Is it possible to do? No API IOM or any what SQL query

    Kind regards
    JS

    Here's what you need to get.

    psLookupCode - search name,
    psValue - Code key
    psDescriptivevalue - DecodeKey

    The rest can be empty.

    addLookupValue

    void addLookupValue (java.lang.String psLookupCode,
    java.lang.String psValue,
    java.lang.String psDescriptiveValue,
    java.lang.String psLanguage,
    java.lang.String psCountry)
    throws Thor.API.Exceptions.tcAPIException,
    Thor.API.Exceptions.tcInvalidLookupException,
    Thor.API.Exceptions.tcInvalidValueException,
    tcAPIException adds a new entry for the specified search

    Parameters:
    psLookupCode - the Code for the definition of research
    psValue - the value that will be stored in the database
    psDescriptiveValue - a descriptive version of the value to be added
    psLanguage - the language for the added entry. Leave blank to accept the default value (en)
    psCountry - country for the specified entry. Leave blank to accept the default (US)

    Throws: tcAPIException tcInvalidLookupException - thrown if the search Code is no tcInvalidValueException - thrown if the value cannot be added to the list of choices (because it's a double, etc.)

    M

  • Insert data into the table from the flat Flie

    I have a flat file save in a directory on my server. I would like to read the data from the flat file and insert into a table on the stage. The flat file data as below
    01-02-03-04-05-06-07-08-09-10
    Suppose that Location_stage is my table and c1 is the column name.

    The data should be saved as follows


    Select * from location_stage

    C1
    ----
    01
    02
    03
    04
    05

    Any help will be appreciated.

    Thank you
    NS

    You can define an external table to read data from the file and a simple view to convert the string enclosed in columns:

    SQL> create directory ext_data as 'c:\';
    
    Directory created.
    
    SQL> create table ext_locations (
      2  loc varchar2(4000)
      3  )
      4  organization external
      5  (
      6  type oracle_loader
      7  default directory ext_data
      8  access parameters (
      9  records delimited by newline
     10  logfile ext_data:'ext_loc.log'
     11  fields terminated by ',' (loc)
     12  )
     13  location ('locations.txt')
     14  );
    
    Table created.
    
    SQL> select * from ext_locations;
    
    LOC
    -----------------------------------------------
    01-02-03-04-05-06-07-08-09-10
    
    SQL> create view location_stage as
      2  select regexp_substr(loc,'[^-]+',1,level) c1
      3  from ext_locations
      4  connect by level <= length(loc)-length(replace(loc,'-',''))+1;
    
    View created.
    
    SQL> select * from location_stage;
    
    C1
    ----------------------------------------------------------------------------
    01
    02
    03
    04
    05
    06
    07
    08
    09
    10
    
    10 rows selected.
    

    Your data is stored only in the file...

    Max

  • inserting data into a table from another table

    Hello

    I have a to insert a data in the other table.

    My requirement is I field Date_effect_date in the departments, I would copy the details field in dept_effect_date of employees.

    I used the query

    Insert in the dept_effect_date of certain employees (dept_effect_date) departments;

    and the result is:

    SQL error: ORA-01400: cannot insert NULL into ('HR'. "'"' EMPLOYEES'."" EMPLOYEE_ID')

    01400 00000 - "impossible to insert a NULL value in (%s)."

    MY DB: oracle 10g XE

    Sainaba

    You can do this by UPDATE not INSERT.

    Sudheeryekkala wrote:

    Hello

    I have a to insert a data in the other table.

    My requirement is I field Date_effect_date in the departments, I would copy the details field in dept_effect_date of employees.

    I used the query

    Insert in the dept_effect_date of certain employees (dept_effect_date) departments;

    and the result is:

    SQL error: ORA-01400: cannot insert NULL into ('HR'. "'"' EMPLOYEES'."" EMPLOYEE_ID')

    01400 00000 - "impossible to insert a NULL value in (%s)."

    MY DB: oracle 10g XE

    Sainaba

    INSERT the results of will by adding new lines to the table so you have the above error. In your case, you must update the value of the existing column

    (or, if the volume is large, then fill the data -

    join the table two in a new table CREATE TABLE EMP_NEW AS SELECT * FROM EMPLOYEES, DEPARTMENTS .

    fall of ;

    Rename emp_new to ;

    * constraints/indexes if necessary be supported...

    )

    E employees update

    Set e.dept_effect_date = (select d.dept_effect_date

    departments d

    where e.dept_id = d.dept_id);

    Concerning

    Biju

  • Loading data into the table by file name

    Hi all

    I am new to ODI. I have a requirement of loading a flat file in oracle, as well as the name of the file in a single column of the table. This means that, if there are 10 rows of data from this file, then the extra column "FileName" to the table will be the name of the active file written 10 times. Please suggest how this can be achieved. I am able to do half of it but the file name is not filled.

    Thank you.

    Hello

    See the link below for dynamic fair value can be useful for you

    http://blogs.Oracle.com/dataintegration/2009/04/using_parameters_in_odi_the_dy_1.html

    Thank you
    Merlina.

  • Write data into the table from the file

    Hi all

    We have a flat file and we want the data in this file to write to one of our tables. Is it possible through pl/sql.

    Thanks in advance.

    Kind regards

    Amrit

    User549949-Oracle wrote:

    Hi all

    We have a flat file and we want the data in this file to write to one of our tables. Is it possible through pl/sql.

    Thanks in advance.

    Kind regards

    Amrit

    Yes, but you need not of PL/SQL.

    See the information on the external Tables:

    http://docs.Oracle.com/database/121/CNCPT/tablecls.htm#CBBBCHFC

  • SQL Loader loading data into two Tables using a single CSV file

    Dear all,

    I have a requirement where in I need to load the data into 2 tables using a simple csv file.

    So I wrote the following control file. But it loads only the first table and also there nothing in the debug log file.

    Please suggest how to achieve this.

    Examples of data

    Source_system_code,Record_type,Source_System_Vendor_number,$vendor_name,Vendor_site_code,Address_line1,Address_line2,Address_line3

    Victor, New, Ven001, Vinay, Vin001, abc, def, xyz

    Control file script

    ================

    OPTIONS (errors = 0, skip = 1)
    load data
    replace
    in the table1 table:
    fields ended by ',' optionally surrounded "" "
    (
    Char Source_system_code (1) POSITION "ltrim (rtrim (:Source_system_code)),"
    Record_type tank "ltrim (rtrim (:Record_type)),"
    Source_System_Vendor_number tank "ltrim (rtrim (:Source_System_Vendor_number)),"
    $vendor_name tank "ltrim (rtrim (:Vendor_name)),"
    )
    in the Table2 table
    1 = 1
    fields ended by ',' optionally surrounded "" "
    (
    $vendor_name tank "ltrim (rtrim (:Vendor_name)),"
    Vendor_site_code tank "ltrim (rtrim (:Vendor_site_code)),"
    Address_line1 tank "ltrim (rtrim (:Address_line1)),"
    Address_line2 tank "ltrim (rtrim (:Address_line2)),"
    Address_line3 tank "ltrim (rtrim (:Address_line3)).
    )

    the problem here is loading into a table, only the first. (Table 1)

    Please guide me.

    Thank you

    Kumar

    When you do not provide a starting position for the first field in table2, it starts with the following after a last referenced in table1 field, then it starts with vendor_site_code, instead of $vendor_name.  So what you need to do instead, is specify position (1) to the first field in table2 and use the fields to fill.  In addition, he dislikes when 1 = 1, and he didn't need anyway.  See the example including the corrected below control file.

    Scott@orcl12c > test.dat TYPE of HOST

    Source_system_code, Record_type, Source_System_Vendor_number, $vendor_name, Vendor_site_code, Address_line1, Address_line2, Address_line3

    Victor, New, Ven001, Vinay, Vin001, abc, def, xyz

    Scott@orcl12c > test.ctl TYPE of HOST

    OPTIONS (errors = 0, skip = 1)

    load data

    replace

    in the table1 table:

    fields ended by ',' optionally surrounded "" "

    (

    Char Source_system_code (1) POSITION "ltrim (rtrim (:Source_system_code)),"

    Record_type tank "ltrim (rtrim (:Record_type)),"

    Source_System_Vendor_number tank "ltrim (rtrim (:Source_System_Vendor_number)),"

    $vendor_name tank "ltrim (rtrim (:Vendor_name)).

    )

    in the Table2 table

    fields ended by ',' optionally surrounded "" "

    (

    source_system_code FILL (1) POSITION.

    record_type FILLING,

    source_system_vendor_number FILLING,

    $vendor_name tank "ltrim (rtrim (:Vendor_name)),"

    Vendor_site_code tank "ltrim (rtrim (:Vendor_site_code)),"

    Address_line1 tank "ltrim (rtrim (:Address_line1)),"

    Address_line2 tank "ltrim (rtrim (:Address_line2)),"

    Address_line3 tank "ltrim (rtrim (:Address_line3)).

    )

    Scott@orcl12c > CREATE TABLE table1:

    2 (Source_system_code VARCHAR2 (13),)

    3 Record_type VARCHAR2 (11),

    4 Source_System_Vendor_number VARCHAR2 (27),

    5 $vendor_name VARCHAR2 (11))

    6.

    Table created.

    Scott@orcl12c > CREATE TABLE table2

    2 ($vendor_name VARCHAR2 (11),)

    3 Vendor_site_code VARCHAR2 (16).

    4 Address_line1 VARCHAR2 (13),

    5 Address_line2 VARCHAR2 (13),

    Address_line3 6 VARCHAR2 (13))

    7.

    Table created.

    Scott@orcl12c > HOST SQLLDR scott/tiger CONTROL = test.ctl DATA = test.dat LOG = test.log

    SQL * Loader: release 12.1.0.1.0 - Production on Thu Mar 26 01:43:30 2015

    Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

    Path used: classics

    Commit the point reached - the number of logical records 1

    TABLE1 table:

    1 row loaded successfully.

    Table TABLE2:

    1 row loaded successfully.

    Check the log file:

    test.log

    For more information on the charge.

    Scott@orcl12c > SELECT * FROM table1

    2.

    RECORD_TYPE SOURCE_SYSTEM_VENDOR_NUMBER $VENDOR_NAME SOURCE_SYSTEM

    ------------- ----------- --------------------------- -----------

    Victor Ven001 new Vinay

    1 selected line.

    Scott@orcl12c > SELECT * FROM table2

    2.

    $VENDOR_NAME VENDOR_SITE_CODE ADDRESS_LINE1 ADDRESS_LINE2 ADDRESS_LINE3

    ----------- ---------------- ------------- ------------- -------------

    Vinay Vin001 abc def xyz

    1 selected line.

    Scott@orcl12c >

  • To find common data in 2 columns from two different tables.

    Hello

    Could someone help me with a querry to discover common data of 2 columns from two different tables?

    Thank you
    Rajesh

    Try as below.

    select col1 ,col2 from tab1
    intersect
    select col1 ,col2 from tab2;
    
  • Reading file from the ftp server and importing data into the table

    Hi experts,

    Well, basically, I text with different layout files have been uploaded to an ftp server. Now, I must write a procedure to recover these files, read and insert data into a table... what to do?

    your help would be greatly helpful.

    Thank you

    user9004152 wrote:
    http://it.Toolbox.com/wiki/index.php/Load_data_from_a_flat_file_into_an_Oracle_table

    See the link, hope it will work.

    It is an old method, using the utl_file_dir parameter that is now obsolete and which is frankly a waste of space when external tables can do exactly the same thing much more easily.

  • Doubt about inserting data into a table

    Hi all, when I try to insert data into a table through an anonymous block, the pl/sql block runs successfully, but the data are not get inserted. Can someone please tell me where I am doing wrong?
    SQL> DECLARE
      2
      3  V_A NUMBER;
      4
      5  V_B NUMBER;
      6
      7  v_message varchar2(25);
      8
      9
     10  BEGIN
     11
     12
     13  select regal.regal_inv_landed_cost_seq.NEXTVAL into V_A from dual ;
     14
     15  select regal.regal_inv_landed_cost_seq.currval into V_B from dual ;
     16
     17  INSERT INTO rcv_transactions_interface
     18  (
     19               INTERFACE_TRANSACTION_ID,
     20               HEADER_INTERFACE_ID,
     21               GROUP_ID,
     22               TRANSACTION_TYPE,
     23               TRANSACTION_DATE,
     24               PROCESSING_STATUS_CODE,
     25               PROCESSING_MODE_CODE,
     26               TRANSACTION_STATUS_CODE,
     27               QUANTITY,
     28               LAST_UPDATE_DATE,
     29               LAST_UPDATED_BY,
     30               CREATION_DATE,
     31               CREATED_BY,
     32               RECEIPT_SOURCE_CODE,
     33               DESTINATION_TYPE_CODE,
     34               AUTO_TRANSACT_CODE,
     35               SOURCE_DOCUMENT_CODE,
     36               UNIT_OF_MEASURE,
     37               ITEM_ID,
     38               UOM_CODE,
     39               EMPLOYEE_ID,
     40               SHIPMENT_HEADER_ID,
     41               SHIPMENT_LINE_ID,
     42               TO_ORGANIZATION_ID,
     43               SUBINVENTORY,
     44               FROM_ORGANIZATION_ID,
     45               FROM_SUBINVENTORY
     46  )
     47
     48  SELECT
     49       regal.regal_inv_landed_cost_seq.nextval,      --Interface_transaction_
    id
     50       V_A,                                          --Header Interface ID
     51       V_B,                                          --Group ID
     52       'Ship',                                       --Transaction Type
     53       sysdate,                                      --Transaction Date
     54       'PENDING',                                    --Processing Status Code
    
     55       'BATCH',                                      --Processing Mode Code
     56       'PENDING',                                    --Transaction Status Cod
    e
     57       lc.quantity_received,                          --Quantity
     58       lc.last_update_date,                          --last update date
     59       lc.last_updated_by,                           --last updated by
     60       sysdate,                                      --creation date
     61       lc.created_by,                                --created by
     62       'INVENTORY',                                  --Receipt source Code
     63       'INVENTORY',                                  --Destination Type Code
     64       'DELIVER' ,                                    --AUT Transact Code
     65       'INVENTORY',                                  --Source Document Code
     66        msi.primary_uom_code ,                       --Unit Of Measure
     67        msi.inventory_item_id,                        --Item ID
     68        msi.primary_unit_of_measure,                  --UOM COde
     69        fnd.user_id,
     70        V_A,                                         --Shipment Header ID
     71        V_B,                                         --SHipment Line ID
     72        82,                                           --To Organization ID
     73        'Brooklyn',                                     --Sub Inventory ID
     74        81,                                            --From Organization
     75        'Vessel'                                       --From Subinventory
     76
     77    FROM
     78       regal.regal_inv_landed_cost_tab lc,
     79       fnd_user fnd,
     80       mtl_system_items msi
     81
     82    WHERE
     83       lc.organization_id = msi.organization_id
     84       AND  lc.inventory_item_id = msi.inventory_item_id
     85       AND  lc.created_by = fnd.created_by;
     86
     87  commit;
     88  v_message := SQL%ROWCOUNT;
     89  dbms_output.put_line('v_message');
     90  END;
     91  /
    v_message
    
    PL/SQL procedure successfully completed.
    SQL> select * from rcv_transactions_interface;
    
    no rows selected
    Thanks in advance!

    There is no problem with inserting data!
    Only there is no data! This means that your select statement retrieves no rows.
    You can see the output of your program (0). This means that there where no line in the result set.

    Please check the output of your tax return independently:

    SELECT
    --        regal.regal_inv_landed_cost_seq.nextval,      --Interface_transaction_id
     --       V_A,                                          --Header Interface ID
    --        V_B,                                          --Group ID
            'Ship',                                       --Transaction Type
            sysdate,                                      --Transaction Date
            'PENDING',                                    --Processing Status Code
            'BATCH',                                      --Processing Mode Code
            'PENDING',                                    --Transaction Status Code
            lc.quantity_received,                          --Quantity
            lc.last_update_date,                          --last update date
            lc.last_updated_by,                           --last updated by
            sysdate,                                      --creation date
            lc.created_by,                                --created by
            'INVENTORY',                                  --Receipt source Code
            'INVENTORY',                                  --Destination Type Code
            'DELIVER' ,                                    --AUT Transact Code
            'INVENTORY',                                  --Source Document Code
             msi.primary_uom_code ,                       --Unit Of Measure
             msi.inventory_item_id,                        --Item ID
             msi.primary_unit_of_measure,                  --UOM COde
             fnd.user_id,
      --       V_A,                                         --Shipment Header ID
    --         V_B,                                         --SHipment Line ID
             82,                                           --To Organization ID
             'Brooklyn',                                     --Sub Inventory ID
             81,                                            --From Organization
             'Vessel'                                       --From Subinventory
         FROM
            regal.regal_inv_landed_cost_tab lc,
            fnd_user fnd,
            mtl_system_items msi
         WHERE
            lc.organization_id = msi.organization_id
            AND  lc.inventory_item_id = msi.inventory_item_id
            AND  lc.created_by = fnd.created_by;
    

    Published by: hm on 13.10.2011 23:19

    I removed the references of the sequence and the variables V_A and YaeUb.
    BTW: Why do you want to include V_A and YaeUb in two different columns?

    The use of sequences in your code seems a bit strange to me. But this has nothing to do with your question.

  • How to load data into the App MVDEMO schema example

    Hi all

    I'm a POC on Oracle Mapviewer and try to build some reports in OBIEE using MApviewer.

    This POC, I use Oracle MVDEMO example Data (11g). I think that these sample data covers few countries like the USA.

    I need to make PDS for the Brazil, I downloaded data from the map of the site as Shapefiles Brazil

    http://GADM.org/country

    in these data of the Brazil, I got from .csv files 4 extensions, .dbf, .shp and SHX

    I need to know how can I load these files into my Oracle 11 g DB? Should I load data into the same pattern of mvdemo, if yes then which table?

    Any help will be appreciated a lot.

    Thank you

    Amit

    Use the Java shapefile Converter utility (http://www.oracle.com/technetwork/database/options/spatialandgraph/downloads/index-093371.html)

    GDAL (gdal.org) FME (Safe) or or MapBuilder.

    Specify the to SRID (i.e. the SRID for loading in Oracle geoms) 4326 or 8307.

    Load into a new table named anything you want. for example brazil_gadm with the geometry named GEOMETRY column

    Once it's loaded, verify that there is an entry for the table and column (BRAZIL_GADM, GEOMETRY) in user_sdo_geom_metadata

    Create a space on brazil_gadm.geometry index if the tool has not created a.

    Add the definitions of topic for the country, State or whatever the admin areas exist in the dataset.

    Import them as layers in OBIEE.

  • Loading XML into a Table

    Hi all
    I want to create a procedure in which, I provided the name of the table and the location of the XML file, the procedure goes to this place and pick the file XML and load it into the table. Can it is possible?

    Thank you

    Best regards


    Adil

    Finally, I got your issue! It is the use of DBMS_LOB. LOADFROMFILE, I used DBMS_LOB. LOADCLOBFROMFILE instead. It was actually loading the binary content!. This is a fully functional code based on your table and XML file structure.
    The XML file, I used:

    
    
    
    28004125
    251942
    05-SEP-92
    400
    513
    1
    0
    
    
    28004125
    251943
    04-OCT-92
    400
    513
    1
    0
    
    
    

    True PL/SQL code:

    SQL> /* Creating Your table */
    SQL> CREATE TABLE IBSCOLYTD
      2  (
      3  ACTNOI VARCHAR2 (8),
      4  MEMONOI NUMBER (7,0),
      5  MEMODTEI DATE,
      6  AMOUNTI NUMBER (8,0),
      7  BRCDSI NUMBER (4,0),
      8  TYPEI NUMBER (4,0),
      9  TRANSMONI NUMBER (6,0)
     10  );
    
    Table created.
    
    SQL> CREATE OR REPLACE PROCEDURE insert_xml_emps(p_directory in varchar2,
      2                                              p_filename  in varchar2,
      3                                              vtableName  in varchar2) as
      4    v_filelocator    BFILE;
      5    v_cloblocator    CLOB;
      6    l_ctx            DBMS_XMLSTORE.CTXTYPE;
      7    l_rows           NUMBER;
      8    v_amount_to_load NUMBER;
      9    dest_offset      NUMBER := 1;
     10    src_offset       NUMBER := 1;
     11    lang_context     NUMBER := DBMS_LOB.DEFAULT_LANG_CTX;
     12    warning          NUMBER;
     13  BEGIN
     14    dbms_lob.createtemporary(v_cloblocator, true);
     15    v_filelocator := bfilename(p_directory, p_filename);
     16    dbms_lob.open(v_filelocator, dbms_lob.file_readonly);
     17    v_amount_to_load := DBMS_LOB.getlength(v_filelocator);
     18    ---  ***This line is changed*** ---
     19    DBMS_LOB.LOADCLOBFROMFILE(v_cloblocator,
     20                              v_filelocator,
     21                              v_amount_to_load,
     22                              dest_offset,
     23                              src_offset,
     24                              0,
     25                              lang_context,
     26                              warning);
     27
     28    l_ctx := DBMS_XMLSTORE.newContext(vTableName);
     29    DBMS_XMLSTORE.setRowTag(l_ctx, 'ROWSET');
     30    DBMS_XMLSTORE.setRowTag(l_ctx, 'IBSCOLYTD');
     31    -- clear the update settings
     32    DBMS_XMLStore.clearUpdateColumnList(l_ctx);
     33    -- set the columns to be updated as a list of values
     34    DBMS_XMLStore.setUpdateColumn(l_ctx, 'ACTNOI');
     35    DBMS_XMLStore.setUpdateColumn(l_ctx, 'MEMONOI');
     36    DBMS_XMLStore.setUpdatecolumn(l_ctx, 'MEMODTEI');
     37    DBMS_XMLStore.setUpdatecolumn(l_ctx, 'AMOUNTI');
     38    DBMS_XMLStore.setUpdatecolumn(l_ctx, 'BRCDSI');
     39    DBMS_XMLStore.setUpdatecolumn(l_ctx, 'TYPEI');
     40    DBMS_XMLStore.setUpdatecolumn(l_ctx, 'TRANSMONI');
     41    -- Now insert the doc.
     42    l_rows := DBMS_XMLSTORE.insertxml(l_ctx, v_cloblocator);
     43    DBMS_XMLSTORE.closeContext(l_ctx);
     44    dbms_output.put_line(l_rows || ' rows inserted...');
     45    dbms_lob.close(v_filelocator);
     46    DBMS_LOB.FREETEMPORARY(v_cloblocator);
     47  END;
     48  /
    
    Procedure created.
    
    SQL> BEGIN
      2  insert_xml_emps('TEST_DIR','load.xml','IBSCOLYTD');
      3  END;
      4  /
    
    PL/SQL procedure successfully completed.
    
    SQL> SELECT * FROM ibscolytd;
    
    ACTNOI      MEMONOI MEMODTEI     AMOUNTI     BRCDSI      TYPEI  TRANSMONI
    -------- ---------- --------- ---------- ---------- ---------- ----------
    28004125     251942 05-SEP-92        400        513          1          0
    28004125     251943 04-OCT-92        400        513          1          0
    
    SQL> 
    

Maybe you are looking for