Updating target table with date in owb using mapping

I want to update the effetive begin date (month begin date) when we load the target table. I have field in target table has Eff_updated_dt defined as DATE.
If I use the Data generator operator and then expression operator (trunc (sysdate,'mm' ) it giving error. It says data generator operator should be connected to flat file .
What other operators can I use to update the column with month begin data.
Also which operator I have use to have sequence key in the table.
Thanks

you can always use a constant for the date field.
just create a constant of type date and give it the value you want, trunc (sysdate,'mm' ) and connect it to your target column, Eff_updated_dt defined.
you have a sequence operator that you can use to link to your "sequence key" as well.
Borkur

Similar Messages

  • Update a table with data from another table

    Hi to All,
    I have in my 'schema' 2 tables:
    CREATE TABLE T_ITEMS
    ITEM_GROUP VARCHAR2(10 BYTE) NOT NULL,
    ITEM_CODE VARCHAR2(25 BYTE) NOT NULL,
    ITEM_DESCRIPTION VARCHAR2(40 BYTE) NOT NULL,
    ITEM_QTA NUMBER(16,4),
    ITEM_PRICE NUMBER(18,5)
    TABLESPACE DOM8DATI
    PCTUSED 0
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 2M
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    LOGGING
    NOCOMPRESS
    NOCACHE
    NOPARALLEL
    MONITORING;
    CREATE TABLE T_PRICES
    ITEM_GROUP VARCHAR2(10 BYTE) NOT NULL,
    ITEM_CODE VARCHAR2(25 BYTE) NOT NULL,
    ITEM_PRICE NUMBER(18,5)
    TABLESPACE DOM8DATI
    PCTUSED 0
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 2M
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    LOGGING
    NOCOMPRESS
    NOCACHE
    NOPARALLEL
    MONITORING;
    I need to create a script that for each record in T_ITEMS, read if exist the code (ITEM_GROUP,ITEM_CODE) in T_PRICES and update ITEM_PRICE in T_ITEMS.
    Can anyone help me?
    Thank You and Best Regards
    Gaetano

    MERGE INTO T_ITEMS B USING (
    SELECT
    ITEM_GROUP ,
    ITEM_CODE,
    ITEM_PRICE
    FROM T_PRICES) E
    ON (B.ITEM_CODE= E.ITEM_CODE)
    WHEN MATCHED THEN
    UPDATE SET B.ITEM_PRICE= E.ITEM_PRICE
    WHEN NOT MATCHED THEN
    INSERT (ITEM_GROUP ,
    ITEM_CODE,
    ITEM_DESCRIPTION ,
    ITEM_QTA ,
    ITEM_PRICE )
    VALUES (E.ITEM_GROUP,
    E.ITEM_CODE,
    'UNKNOWN',
    'UNKNOWN',
    E.ITEM_PRICE);
    COMMIT;

  • Updating a table with data from another table with joins involving 3 other

    update party_relship pr
    set pr.COMMENT_TEXT = temp.notes
    from party p,
    party p1,
    party_reference pref,
    TEMP_DEPT_NOTE temp
    where pr.FROM_PARTY_ID = p.PARTY_ID
    and p.CMA_CUSTOMER_NUMBER = temp.cma_num
    and pr.TO_PARTY_ID = p1.PARTY_ID
    and p1.PARTY_ID = pref.PARTY_ID
    and pref.REFERENCE_VALUE = temp.deptnum
    ORA-00933: SQL command not properly ended
    What is the problem here.
    Thanks !

    There are a few issues here 1) no from clause is directly part of the update stmt,
    2) temp.notes is not available directly
    I am not 100% sure this update is correct since I am selecting temp.notes using the same query as the in the where clause but I wanted to show the complete syntax. Basically if you need to limit the number of updates done then change the select that is part of the exists clause, if you need to change the way the pr.comment_text is being set then to need to change the sub_query.
    update party_relship pr
    set pr.comment_text =
                     (select temp.notes
                      from   party p,
                             party p1,
                             party_reference pref,
                             temp_dept_note temp
                      where  pr.from_party_id = p.party_id
                      and    p.cma_customer_number = temp.cma_num
                      and    pr.to_party_id = p1.party_id
                      and    p1.party_id = pref.party_id
                      and    pref.reference_value = temp.deptnum)
    where  exists(select 1
                  from   party p,
                         party p1,
                         party_reference pref,
                         temp_dept_note temp
                  where  pr.from_party_id = p.party_id
                  and    p.cma_customer_number = temp.cma_num
                  and    pr.to_party_id = p1.party_id
                  and    p1.party_id = pref.party_id
                  and    pref.reference_value = temp.deptnum)Message was edited by:
    Bob C

  • In OWB I need to update the target table with same field for match/update

    In OWb I am trying to update the target table with the match and the update on the same field can this be done. I am getting a error match merge error saying you cannot update and match on the same field. But in SQl my select is
    Update table
    set irf = 0
    where irf = 1
    and process_id = 'TEST'
    Hwo do i do this in OWB.

    table name is temp
    fields in the table
    field1 number
    field2 varchar2(10)
    field3 date
    values in the table are example
    0,'TEST',05/29/2009
    9,'TEST',05/29/2009
    0,'TEST1',03/01/2009
    1,'TEST1',03/01/2009
    In the above example I need to update the first row field1 to 1.
    Update temp
    set field1 = 1
    where field1 = 0
    and field2 = 'TEST'
    when I run this I just need one row to be updated and it should look like this below
    1,'TEST',05/29/2009
    9,'TEST',05/29/2009
    0,'TEST1',03/01/2009
    1,'TEST1',03/01/2009
    But when I run my mapping I am getting the rows like below the second row with 9 also is getting updated to 1.
    1,'TEST',05/29/2009
    1,'TEST',05/29/2009
    0,'TEST1',03/01/2009
    1,'TEST1',03/01/2009

  • Updating target table in OWB

    I have target table with columns structure_id,case_num,user_id,user_name,eff_beg_dt,eff_end_dt . I have to update the eff_end_dt in target table and insert a new row with new eff_beg_dt if any of the info in the column changes like user_id or User_name based on case_num.
    I have in source table case_num,user_id,user_name only which I got from previous process (delta change rows only). Now for all this case_num in source_table I want to update the eff_end_dt to current months end date and insert a new row with source tables case_num,user_id,user_name with eff_beg_dt with next month start date.
    How to achive this in OWB . I am very new to OWB and when I try to put loading type has update what should be the match by contraint.
    I have to match case_num in source to case_num in target and update the eff_end_date . But case_num in not a unique key
    Can you pl walk me thr the process
    thanks

    Hi,
    As I understand the problem looks straightforward.
    1. First make a mapping where you drag all the fields from the source table to the target table. The target table loading type should be set to UPDATE. The update matching condition should be set to case_num = case_num from the source table. The field that needs to be updated is you eff_end_date. Update it with the appropriate value. Set the match by constraints to "No Constraints" and set the matching conditions in the target table field level.
    2. Then make a second mapping which will do just the inserts. All the rows appearing in the source (which is your delta rows I think) should be mapped to the respective fields in the target table. The target table load type should be set to INSERT. Set the eff_beg_date as per your logic.
    The above two steps can be done within one mapping I believe, by setting the target load order.
    Hope this helps
    -AP

  • Updating base table with Materialized View's data

    Hi,
    In order to update base table with MVs data, I am trying real time data transfer between two databases. One is Oracle 8i and other is Oracle 9i. I have created an updatable MV in 9i on a base table using database link. The base table is in 8i. Materialized View log is created in 8i on base table. MV has to be associated to some replication group, but I am not able to create replication group in 9i to which MV has to be associated. The required packages are not installed.
    Replication packages are to be used to create replication group are :
    /*Create Materialized View replication group*/
    BEGIN
    DBMS_REPCAT.CREATE_MVIEW_REPGROUP (
    gname => 'TEST_MV_GRP',
    master => 'TEST_DATA_LINK',
    propagation_mode => 'ASYNCHRONOUS');
    END;
    But above block is giving error.
    Can anyone suggest how to resolve this, or are there any other approaches (by not using replication packages) to update base table with MVs data ?
    Thanks,
    Shailesh

    Yes, I created link between two databases and was able to update tables on 8i from 9i database using that link.
    The error I am getting while creating replication group is :
    ORA-06550
    PLS-00201 : identifier 'SYS.DBMS_REPCAT_UTL2@'TEST_DATA_LINK' must be declared
    ORA-06550
    PLS-00201 : identifier 'SYS.DBMS_REPCAT_UNTRUSTED@'TEST_DATA_LINK' must be declared
    ORA-06512 : at "SYS.DBMS_REPCAT_UTL", line 2394
    ORA-06512 : at "SYS.DBMS_REPCAT_SNA_UTL", line 1699
    ORA-06512 : at "SYS.DBMS_REPCAT_SNA", line 64
    ORA-06512 : at "SYS.DBMS_REPCAT", line 1262
    Is there any other approach which can be used to update base table with MVs data instead of using replication packages ?
    Thanks,
    Shailesh

  • Recordset - updating 2 tables with 1 recordset using application object update record

    I have a recordset that uses a field from 2 different tables
    with a select statement where clause that joins a userid. I can
    display the field’s data just fine. Now I want to use the
    Application object “update record” so I can modify
    either of the fields. The problem is the Application object
    “update record” only allows you to update one table.
    How does Dreamweaver mx 2004 allow me to update 2 tables with one
    recordset and 1 submit button? Currently using php.
    Example of where:
    Where member.userid = member_detail.userid
    I tried creating the one form with the field from the first
    table and that works just fine. I added the other field from the
    other table into the form but ofcourse there isn’t any code
    that will update the second table so it won’t work.
    My application requires me to update alot of fields between 2
    tables at the same time.
    Does anyone know a way using Dreamweaver mx 2004 to do this?
    I don’t have much php experience.

    jon-rookie wrote:
    > DreamerJim,
    >
    > I am sorry but I don't think you are correct. I just
    can't believe that with
    > all the powers to be at Macromedia and now Adobe can't
    figure out how to update
    > two tables at once. There are millions of db's out there
    that require this. I
    > spent several hours today perusing lots of posts on the
    internet. It seems I
    > am not the only one out there that has asked this
    question. Unfortunately
    > there are no good answers yet to my surprise.
    >
    > I did find a Dreamweaver extension that does exactly
    what I myself and many
    > others want. The problem is it is no longer available
    unless you purchase a
    > bundle of software from Adobe.
    >
    > I have not looked into it in detail so I am not 100%
    sure that is accurate!
    >
    > Still, alot of php programmers do this all the time
    without much trouble. I
    > just want to know if Dreamweaver mx 2004 has the
    capability if a person knows
    > the right steps.
    >
    > Hopefully a Dreamweaver expert will post something to
    let us know for sure.
    > Until then I am stuck.
    >
    Not even CS3 has this built in, you will either have to code
    it yourself
    or buy the extension you have found. Dreamweaver gives you
    basic
    features to help you develop applications, but if you want to
    do
    anything really clever you have to do it yourself.
    One thing to consider is maybe creating an SQL view that is
    can be
    updated. I am pretty sure it exists, then you use the view
    instead of
    the table in the update behaviour. I have never done it
    myself, but I am
    sure it can be done.
    Steve

  • Using expdp to export a mix of tables with data and tables without data

    Hi,
    I would like to create a .dmp file using expdp, exporting a set of tables with data and another set without data. Is there a way to do this in a single .dmp file? For example, I want all the tables in a schema with data, but for the fact tables in that schema, I only want the fact table objects, not the data. I thought it might be easier to create two separate .dmp files, one for each scenario, but would be nice to have one .dmp file that satisfies my requirement. Any help is appreciated.
    Thanks,
    -Rodolfo
    Edited by: user6902559 on May 11, 2010 12:05 PM

    You could do this with where clauses. Let's say you have 10 tables to export, 5 with data and 5 without data. I would do it like this
    tab1_w_data
    tab2_w_data
    tab3_w_data
    tab4_w_data
    tab5_w_data
    tab1_wo_data
    tab2_wo_data
    tab3_wo_data
    tab4_wo_data
    tab5_wo_data
    I would make one generic query
    query="where rownum = 0"
    and I would make 5 specific queries
    query=tab1_w_data:"where rownum > 0"
    query=tab2_w_data:"where rownum > 0"
    query=tab3_w_data:"where rownum > 0"
    query=tab4_w_data:"where rownum > 0"
    query=tab5_w_data:"where rownum > 0"
    The first query will be applied to all tables that don't have their own specific query and it will export no rows, the next 5 will apply to each of the corresponding table.
    Dean

  • How can I update the table with a single query for...

    I have a table with columns C1 and C2.
    C1 C2
    A1 null
    A1 null
    A1 null
    A1 null
    A2 null
    A2 null
    A2 null
    A3 null
    A4 null
    A4 null
    I want to update my table with a single query so that I would have data like
    C1 C2
    A1 1
    A1 2
    A1 3
    A1 4
    A2 1
    A2 2
    A2 3
    A3 1
    A4 1
    A4 2
    The updated column C2 has the values like serial no grouped on the column C1.

    SQL> create table mytable
      2  ( c1 varchar2(2)
      3  , c2 number(2)
      4  )
      5  /
    Tabel is aangemaakt.
    SQL> insert into mytable (c1)
      2  select 'A1' from dual union all
      3  select 'A1' from dual union all
      4  select 'A1' from dual union all
      5  select 'A1' from dual union all
      6  select 'A2' from dual union all
      7  select 'A2' from dual union all
      8  select 'A2' from dual union all
      9  select 'A3' from dual union all
    10  select 'A4' from dual union all
    11  select 'A4' from dual
    12  /
    10 rijen zijn aangemaakt.
    SQL> select * from mytable
      2  /
    C1                                     C2
    A1
    A1
    A1
    A1
    A2
    A2
    A2
    A3
    A4
    A4
    10 rijen zijn geselecteerd.
    SQL> merge into mytable t1
      2  using (select c1
      3              , row_number() over (partition by c1 order by null) rn
      4              , rowid rid
      5           from mytable
      6        ) t2
      7     on (t1.rowid = t2.rid)
      8   when matched then
      9        update set c2 = rn
    10   when not matched then
    11        insert values (null,null)
    12  /
    10 rijen zijn samengevoegd.
    SQL> select * from mytable
      2  /
    C1                                     C2
    A1                                      1
    A1                                      2
    A1                                      3
    A1                                      4
    A2                                      1
    A2                                      2
    A2                                      3
    A3                                      1
    A4                                      1
    A4                                      2
    10 rijen zijn geselecteerd.Regards,
    Rob.

  • Updating Oracle table with info from Sybase query

    I hope this is the correct forum for this question.
    I am fairly new to Java and JDBC. I am trying to figure out what the best method for updating information in Oracle tables with data from a Sybase table. I would prefer to use Oracle’s transparent gateway but this is not an option my company will pay for so I am creating a java stored procedure and using JDBC to connect to the Sybase database.
    The process I think I need to go thru is
    1.     Query an Oracle table to get the records that need to be updated and the “key” information to query the Sybase table with.
    2.     Use that result to query the Sybase database to get the fields that need to be updated in the Oracle table for those records.
    3.     Update the records on the Oracle table with the data from the Sybase query.
    I know I can just do this procedurally, row-by-row, but I was wondering if anyone knows of a way to accomplish this with SQL and no loops. Is there a way to make a result set available as a “SQL table” for another JDBC query?
    Basically what I would like to do is:
    OraQuery = “ select sybinfo from sometable where updated_date = null”;
    Statement orastmt1 = OraConn.createStatement();
    ResultSet Orars1 = orastmt1.executeQuery (OraQuery);
    SybQuery = “select update_date, sybinfo from sybtable where sybinfo = Orars1.sybinfo”;
    Statement sybstmt = SybConn.createStatement();
    ResultSet Sybrs = sybstmt1.executeQuery (SybQuery);
    OraUpdate = “update (select update_date from sometable, Sybrs where sometable.sybinfo = Sybrs.sybinfo) set update_date = Sybrs.update_date”;
    Statement orastmt2 = OraConn.createStatement();
    ResultSet Orars2 = orastmt2.executeQuery (OraUpdate);
    This may not be possible but if anyone has done something similar and wouldn’t mind sharing I would appreciate it. If there is a “better” way of accomplishing this I am open to suggestions.
    Thanks

    you can try using cachedRowSet() for the Oracle side query.
    The rows in this could be populated using the sybase side query's resultset and then all of this could updated into Oracle in one shot.

  • ODP OracleCommandBuilder. Updating a table including DATE columns.

    Hi
    I have a problem with the OracleCommandBuilder not creating the correct update commands when I have DATE type columns in the table.
    I have created a test table (called DATETEST) with three columns:
    STRINGCOLUMN     VARCHAR2 10
    DATECOLUMN DATE
    NUMBERCOLUMN     NUMBER
    The STRINGCOLUMN is the primary key.
    Then I created a typed dataset that looks like this:
    STRINGCOLUMN     string
    DATECOLUMN string
    NUMBERCOLUMN     long
    This is the XML schema for the typed dataset:
    <?xml version="1.0" encoding="utf-8" ?>
    <xs:schema id="DateDS" targetNamespace="http://tempuri.org/DateDS.xsd" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns="http://tempuri.org/DateDS.xsd" xmlns:mstns="http://tempuri.org/DateDS.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
         <xs:element name="DateDS" msdata:IsDataSet="true">
              <xs:complexType>
                   <xs:choice maxOccurs="unbounded">
                        <xs:element name="DATETEST">
                             <xs:complexType>
                                  <xs:sequence>
                                       <xs:element name="DATECOLUMN" type="xs:string" minOccurs="0" />
                                       <xs:element name="STRINGCOLUMN" type="xs:string" minOccurs="0" />
                                       <xs:element name="NUMBERCOLUMN" type="xs:long" minOccurs="0" />
                                  </xs:sequence>
                             </xs:complexType>
                        </xs:element>
                   </xs:choice>
              </xs:complexType>
         </xs:element>
    </xs:schema>
    And this is the test code:
    Dim connection As Oracle.DataAccess.Client.OracleConnection
    Dim adapter As New Oracle.DataAccess.Client.OracleDataAdapter()
    Dim dbCommand As New Oracle.DataAccess.Client.OracleCommand()
    Dim sqlstring As String
    Dim data As New DateDS() 'Typed dataset
    Const ConnectionString As String = "User Id=............."
    Try
    'Connect to database
    connection = New OracleConnection(ConnectionString)
    connection.Open()
    'Get data from table DATETEST
    dbCommand.CommandText = "SELECT STRINGCOLUMN, TO_CHAR(DATECOLUMN) AS DATECOLUMN, NUMBERCOLUMN FROM DATETEST"
    dbCommand.Connection = connection
    adapter.SelectCommand = dbCommand
    adapter.Fill(data, "DATETEST")
    'Make changes to dataset
    data.DATETEST(0).DATECOLUMN = Now()
    data.DATETEST(0).NUMBERCOLUMN = data.DATETEST(0).NUMBERCOLUMN + 1
    'Update database
    sqlstring = "SELECT * FROM DATETEST"
    adapter.SelectCommand = New OracleCommand(sqlstring, connection)
    Dim custCB As New Oracle.DataAccess.Client.OracleCommandBuilder()
    custCB.DataAdapter = adapter
    adapter.Update(data, "DATETEST")
    'Disconnect
    connection.Close()
    connection.Dispose()
    Catch exc As Exception
    MessageBox.Show(exc.Message)
    End Try
    Getting the data from the database is not a problem.
    The dataset contains the correct information.
    But updating the database is impossible.
    I get errors like:
    ORA-01861: literal does not match format string
    And if I don't specify a DATE format in the TO_CHAR statement I get this error:
    Concurrency violation: the UpdateCommand affected 0 records.
    I think I've tried everything.
    I've used the OracleGlobalization class, with the SetSessionInfo method.
    I've tried all different types of date conversions to make sure that
    the date format on the database is the same as in the dataset.
    I've tried to change the NLS parameters on the DB server and in the registry on the client.
    I've tried to change the DATECOLUMN type in the typed dataset from string to Oracle.DataAccess.Types.OracleDate
    But it still doesn't work.
    The default date format on the DB 9i server is AMERICAN,(DD-MON-RR).
    A strange thing is that when I instead of using the ODP classes use
    the System.Data.OracleClient and its OracleCommandBuilder
    the code works perfectly without any errors.
    This is the test code that works:
    Dim connection As System.Data.OracleClient.OracleConnection
    Dim adapter As New System.Data.OracleClient.OracleDataAdapter()
    Dim dbCommand As New System.Data.OracleClient.OracleCommand()
    Dim data As New DateDS()
    Dim sqlstring As String
    Const ConnectionString As String = "User Id=......."
    Try
    'Connect to database
    connection = New System.Data.OracleClient.OracleConnection(ConnectionString)
    connection.Open()
    'Get data from table DATETEST
    dbCommand.CommandText = "SELECT STRINGCOLUMN, TO_CHAR(DATECOLUMN,'YYYY-MM-DD HH24:MI:SS') AS DATECOLUMN, NUMBERCOLUMN FROM DATETEST"
    dbCommand.Connection = connection
    adapter.SelectCommand = dbCommand
    adapter.Fill(data, "DATETEST")
    'Make changes to dataset
    data.DATETEST(0).DATECOLUMN = Now()
    data.DATETEST(0).NUMBERCOLUMN = data.DATETEST(0).NUMBERCOLUMN + 1
    'Update database
    sqlstring = "SELECT * FROM DATETEST"
    adapter.SelectCommand = New System.Data.OracleClient.OracleCommand(sqlstring, connection)
    Dim custCB As New System.Data.OracleClient.OracleCommandBuilder()
    custCB.DataAdapter = adapter
    adapter.Update(data, "DATETEST")
    'Disconnect
    connection.Close()
    connection.Dispose()
    Catch exc As Exception
    MessageBox.Show(exc.Message)
    End Try
    My experience until this came up is that the ODP provider is better on everything
    than the microsoft Oracle provider so I don't want to switch unless I have to.
    Could someone that have used the ODP OracleCommandBuilder for updating a table including DATE columns with a typed dataset please give me some tips on how to make this work?
    I would be the happiest man on earth if someone had a solution :-)
    Erik

    Don't convert the dates to strings. Ever.
    The command builder uses the metadata returned from the select command to build the insert/update commands. Using to_char in the query tells ODP that that is a varchar2 column. If you omit the to_char the commandBuilder will know to bind a date parameter in that spot.
    Also in your typed dataset you should change the type from a string to a date.
    David

  • Best way to update a table with disinct values

    Hi, i would really appreciate some advise:
    I need to reguarly perform a task where i update 1 table with all the new data that has been entered from another table. I cant perform a complete insert as this will create duplicate data every time it runs so the only way i can think of is using cursors as per the script below:
    CREATE OR REPLACE PROCEDURE update_new_mem IS
    tmpVar NUMBER;
    CURSOR c_mem IS
    SELECT member_name,member_id
    FROM gym.members;
    crec c_mem%ROWTYPE;
    BEGIN
    OPEN c_mem;
    LOOP
    FETCH c_mem INTO crec;
    EXIT WHEN c_mem%NOTFOUND;
    BEGIN
    UPDATE gym.lifts
    SET name = crec.member_name
    WHERE member_id = crec.member_id;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN NULL;
    END;
    IF SQL%NOTFOUND THEN
    BEGIN
    INSERT INTO gym.lifts
    (name,member_id)
    VALUES (crec.member_name,crec.member_id);
    END;
    END IF;
    END LOOP;
    CLOSE c_mem;
    END update_new_mem;
    This method works but is there an easier (faster) way to update another table with new data only?
    Many thanks

    >
    This method works but is there an easier (faster) way to update another table with new data only?
    >
    Almost anything would be better than that slow-by-slow loop processing.
    You don't need a procedure you should just use MERGE for that. See the examples in the MERGE section of the SQL Language doc
    http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_9016.htm
    MERGE INTO bonuses D
       USING (SELECT employee_id, salary, department_id FROM employees
       WHERE department_id = 80) S
       ON (D.employee_id = S.employee_id)
       WHEN MATCHED THEN UPDATE SET D.bonus = D.bonus + S.salary*.01
         DELETE WHERE (S.salary > 8000)
       WHEN NOT MATCHED THEN INSERT (D.employee_id, D.bonus)
         VALUES (S.employee_id, S.salary*.01)
         WHERE (S.salary <= 8000);

  • Populate target table with default value

    I have a query like this:
    SELECT 0 AS ID,
    9999999999 AS CODE
    FROM DUAL
    UNION ALL
    SELECT VEH.TP_ID AS ID,
    VEH.VEH_ID AS CODE
    FROM TB_VEHICLE;
    So I have an interface with two data sets, one for each query.
    The first data set represents the "select from dual" "constant values" and the second represents the "select * from tb_vehicle".
    In the first data set I don´t have a source, then ODI generates a select without a table "select 0 AS ID, 99999 AS CODE FROM".
    Any ideas on how can I achieve my objective? I need to populate one row on target table with constant values.
    Thanks

    Alternatively , try this :
    Duplicate the LKM and IKM you are using, create copies , something like LKM xyz (No Source) , IKM xyz (No Source).
    Then adust the KM steps accordingly, remove the 'FROM' part and replace with VALUES ( ) , keeping the odiref substitution call in the parenthesis.
    So you basically have a knowlede module that accepts no source data, generating :
    insert into C$
    (col 1, col 2, col 3 etc)
    VALUES
    (Target mapping 1, target mapping 2, target mapping 3 etc)
    I've seen it done, nice and tidy, keeps all the lineage in ODI etc.

  • Transfer a table with data from 1 client to another client

    Hi experts please focus on this issue.  what is table maintainance generator? what is the main advantages of it.
    how can we transfer a table with data from 1 client to another client.
    Thanks  in advance
    vamsi.

    Table maintenance generator can be generated via se11 on your table.
    The advantage is that the table can manaully be updated via SM30.
    If you want to transport to another client the table content, I think you can :
    - Generate a transport request in SM30 ( Transport button)
    - use SCC1 to transport from a client to another.
    Regards,
    Erwan

  • Populate SQL table with data from Oracle DB in ODI

    Hi,
    I am trying to populate a source SQL table with fields from an Oracle db in ODI. I am trying to perform this using a procedure and I am am getting the following error:
    ODI-1226: Step PROC_1_Contract_Sls_Person_Lookup fails after 1 attempt(s).
    ODI-1232: Procedure PROC_1_Contract_Sls_Person_Lookup execution fails.
    ODI-1228: Task PROC_1_Contract_Sls_Person_Lookup (Procedure) fails on the target MICROSOFT_SQL_SERVER connection Phys_HypCMSDatamart.
    Caused By: weblogic.jdbc.sqlserverbase.ddc: [FMWGEN][SQLServer JDBC Driver][SQLServer]Invalid object name 'C2C_APP.CON_V'.
    My question is what is the best method to populate SQL db with data from an Oracle db? Using a procedure? A specific LKM?
    I found threads referring to using an LKM to populate Oracle tables with data from a SQL table....but nothing for the opposite.
    Any information would help.
    thanks,
    Eric

    Hi Eric,
    If using an Interface, I would recommend the LKM SQL to MSSQL (BULK) knowledge module. This will unload the data from Oracle into a file, then bulk load the staging db on the target using a BULK INSERT.
    Regards,
    Michael Rainey

Maybe you are looking for

  • Looking for a MP3 player for audiobo

    I am looking for an mp3 player that meets these requirements. Creative Labs lists like 50 mp3 plays and no easy way to compare features. So does anyone know if anyone sells anything with these features:?- bookmarking: where I can 'save' a place in a

  • Can I take screenshot of my ADF Mobile Screen or Send HTML email containing pics

    I'm using Jdeveloper 11.1.2.4 with the latest Adf mobile extension in my mobile application I've an amx page that contains some data and i need to take printscreen of this page and save to the mobile or Send this page with the pictures appear on it a

  • How to print HTML contents

    can anyone tell me how to print HTML contents...i needed it urgently Thanks

  • No drilldown in Crystal ReportViewer

    We bought Crystal 2008 a month ago.  Using Visual Studio 2005, I dropped a Crystal Viewer on a form and wrote some code around it to logon to the database and view reports.  Everything is working fine, except drilldown reports.  They display the firs

  • Updated Firefox and lost all toolbars, Hotmail, EVERYTHING!! How do I fix this?

    Updated Firefox last evening. Got up this morning to a whole new page on the computer. Clicked on Firefox and got a blank page with just a Firefox logo and a Google search line. There are no toolbars for me to use to get to my e mail, pictures or oth