Update Statement in ODI Procedure

Hi All,
I want to update a value in a table through ODI procedure
I Created a procedure,added new step,given details like Technology,Context,Schema in Command on target
on the command:
i was trying with:-
update table_name
set column_name1='value1'
where column_name2='value2'
and also i tried with:-
begin
UPDATE Schema_name.Table_name SET column_name1='value1' WHERE column_name2='value2';
end;
in both cases i am unable to update the value in the table
Please suggest me
Thanks in Advance

Hi,
Thanks for the reply
I fixed that problem
It was caused due to Database error
Thanks

Similar Messages

  • How to use Update Statement in ODI Procedure

    Hi,
    How can I use an update statement inside an ODI procedure.
    Thanks

    Hi,
    You do not need the BEGIN and END. ODI procedures are free text, so you can simply write your update statement, as you would in toad/sql developer etc etc. Just make sure you set the Technology and the logical schema. It is how ever best practice to also use the API:
    <%=odiRef.getSchemaName("YOUR_LOGICAL_SCHEMA_NAME", "D")%>. to prefix tables. This way, you select data from different schema's in the same instance (as long a your user has the correct privs).
    Cheers
    Bos
    Edited by: Bos on Jun 22, 2011 3:09 PM

  • Update statement in a procedure

    update pol_notification a
    set obj_id = v_presv_client_id
    where a.obj_id=v_client_id and a.obj_type='client' ;
    update pol_notification a
    set obj_id = v_address_id
    where a.obj_id=v_address_id and a.obj_type='address' ;
    I am using these two update statements in one procedure but the tables are not being updated.
    Any reason for that. Am i using the right statements?

    Here is the procedure.....
    CREATE OR REPLACE PROCEDURE SP_LOAD_CLIDUPDATA( )
         BEGIN
    DECLARE v_client_id integer ;
    DECLARE v_presv_client_id integer ;
    DECLARE v_processed_client_id integer;
         DECLARE v_address_id integer;
    DECLARE V_NUMBER integer;
    DECLARE v_counter integer DEFAULT 0;
    DECLARE cur_update CURSOR FOR
    SELECT client_id,presv_client_id,nvl(processed_client_id,0),nvl(address_id,0)
    FROM cli_dup_data ;
    DECLARE cur_num CURSOR FOR
    SELECT count(*) FROM cli_dup_data ;
    open cur_num;
    fetch cur_num into V_NUMBER;
    close cur_num;
    OPEN cur_update;
    loop
    IF v_counter = V_NUMBER THEN
    end loop;
    END IF;
    FETCH cur_update INTO v_client_id,v_presv_client_id,v_processed_client_id,v_address_id;     
    if v_client_id = 0 then
    COMMIT; --Commit transactions at batch level only
    ELSE
    If v_processed_client_id <> v_client_id then -- client_id is already processed
                   update pol_notification a set obj_id = v_presv_client_id --Update client_id
         where a.obj_id=v_client_id and a.obj_type='client';
         update pol_notification a set obj_id = v_address_id -- Update address_id
         where a.obj_id=v_address_id and a.obj_type='address';
    update pol_notify_history b set obj_id=v_presv_client_id,
    client_seq_nbr_i = 1
    where b.obj_id = v_client_id and b.obj_type='client';
    update pol_notify_history b set obj_id = v_address_id
    where b.obj_id = v_client_id and b.obj_type = 'address';
    update pol_int_name set client_id = v_presv_client_id --Update client_id
         where client_id=v_client_id;
         update cli_dup_data set processed_client_id=v_client_id --Keep a record of updated client_id in processed_client_id
         where client_id=v_client_id;
    end if;
              END IF;
    set v_counter = v_counter+1;
    END loop ;
    CLOSE cur_update;

  • How to add the update statement in this procedure?

    I have one table usersubscription (userid,newsletterid,deleted)
    I got one string from user e.g. ('1,2,3') and userid = 14
    I wrote proceduer that will insert this records in to usersubscription table;
    userid     newsletterid     deleted
    14     1          n
    14     2          n
    14     3          n
    default value of deleted column is 'n'.
    my procedure is as follows;
    CREATE OR REPLACE PROCEDURE usersubscription_procd1 (vuserid in number, vnewsletterid IN VARCHAR2)
    AS
    I NUMBER;
    J NUMBER;
    VAL VARCHAR2(100);
    BEGIN
         I := 1;
         J := 1;
         WHILE INSTR(vnewsletterid,',',I) != 0 LOOP
         VAL := SUBSTR(vnewsletterid,I,INSTR(vnewsletterid,',',I)-J);
         I := INSTR(vnewsletterid,',',I)+1;
         J := I;
         INSERT INTO usersubscription (usersubcriptionid,userid,newsletterid)
         VALUES (usersubscription_seq.nextval,vuserid,VAL);
         END LOOP;
         VAL := SUBSTR(vnewsletterid,I,LENGTH(vnewsletterid));
         INSERT INTO usersubscription (usersubcriptionid,userid,newsletterid)
         VALUES (usersubscription_seq.nextval,vuserid,VAL);
    END;
    Now one requirement is that when new string comes for same userid e.g.('1,4,5') userid = 14
    then the deleted column for 1 and 2 newsletterid changes to 'y';
    please tell me the solution.
    Prathamesh.

    Hi,
    Before your loop, you can make something else like :
    SQL> select * from test;
        USERID NEWSLETTERID D
            14            1 n
            14            2 n
            14            3 n
    SQL> update test
      2  set deleted = 'y'
      3  where instr('1,4,5',newsletterid,1) = 0
      4  and userid = 14;
    2 ligne(s) mise(s) à jour.
    SQL> select * from test;
        USERID NEWSLETTERID D
            14            1 n
            14            2 y
            14            3 y
    SQL> HTH,
    Nicolas.

  • About update statement in procedure

    I have one table usersubscription (userid,newsletterid,deleted)
    I got one string from user e.g. ('1,2,3') and userid = 14
    I wrote proceduer that will insert this records in to usersubscription table;
    userid newsletterid deleted
    14 1 n
    14 2 n
    14 3 n
    default value of deleted column is 'n'.
    my procedure is as follows;
    CREATE OR REPLACE PROCEDURE usersubscription_procd1 (vuserid in number, vnewsletterid IN VARCHAR2)
    AS
    I NUMBER;
    J NUMBER;
    VAL VARCHAR2(100);
    BEGIN
    I := 1;
    J := 1;
    WHILE INSTR(vnewsletterid,',',I) != 0 LOOP
    VAL := SUBSTR(vnewsletterid,I,INSTR(vnewsletterid,',',I)-J);
    I := INSTR(vnewsletterid,',',I)+1;
    J := I;
    INSERT INTO usersubscription (usersubcriptionid,userid,newsletterid)
    VALUES (usersubscription_seq.nextval,vuserid,VAL);
    END LOOP;
    VAL := SUBSTR(vnewsletterid,I,LENGTH(vnewsletterid));
    INSERT INTO usersubscription (usersubcriptionid,userid,newsletterid)
    VALUES (usersubscription_seq.nextval,vuserid,VAL);
    END;
    Now one requirement is that when new string comes for same userid e.g.('1,4,5') userid = 14
    then the deleted column for 2 and 3 newsletterid changes to 'y';
    please tell me the solution.
    Prathamesh.

    Read my suggestion into your other post : Re: how to add the update statement in this procedure?
    And please, for more readable forum, do not post twice the same subject, use reply button (or edit) to discuss.
    Nicolas.

  • What will happen if i have given an update statement?

    hi
    If i have given an update statement in a procedure will exceptions work on it and what is the back ground process if I give an update statement?
    regds
    Chandra

    Hello
    If you create a procedure that performs a table update, the update is subject to the same transaction model as it would be if you just executed the sql statement on it's own. Exceptions will be raised in the same way as they would if you executed the statement on it's own. You can however handle the exceptions in whatever way you see fit by using the EXCEPTION keyword in your procedure. As for the background process, it depends what you mean. In your procedure, when the update statement is executed, control will not return to the procedure until the statement has finished, so if the update takes 5 seconds to run, your procedure will be waiting 5 seconds for it complete before it can continue with any other statements.
    HTH

  • UPDATE statement in procedure

    Hi,
    I'm having trouble getting my SP to work. I've searched this forum for a similar post, but haven't found it.
    Can anyone please let me know what I'm doing wrong here?
    Thanks!
    CREATE OR REPLACE PROCEDURE updadminproc
    (pdate   IN CHANGE_CONTROL_ADMIN.CLOSEDATE%TYPE,
    pact   IN CHANGE_CONTROL_ADMIN.ACTIVE%TYPE,
    pstat1   IN CHANGE_CONTROL_ADMIN.STATUS1%TYPE,
    pstat2   IN CHANGE_CONTROL_ADMIN.STATUS2%TYPE,
    padmcomm   IN CHANGE_CONTROL_ADMIN.ADM_NOAPROVE%TYPE)
    (cctrlid IN NUMBER)
    IS
    BEGIN
      -- UPDATE STATEMENT
    UPDATE CHANGE_CONTROL_ADMIN
       SET CLOSEDATE = pdate, ACTIVE = pact, STATUS1 = pstat1, STATUS2 = pstat2, ADM_NOAPROVE = padmcomm
       WHERE CHANGE_CTRL_ID = cctrlid;
    COMMIT;
    END updadminproc;
    /Here are the errors I get that it's showing:
    LINE/COL ERROR
    7/2      PLS-00103: Encountered the symbol "(" when expecting one of the
             following:
             ; is with authid as cluster order using external
             deterministic parallel_enable pipelined
    8/2      PLS-00103: Encountered the symbol "IS" when expecting one of the
             following:
             returnMessage was edited by:
    user515689

    when I change it accordingly as to how you suggest, the procedure (in SQL Plus) gets created just fine, but then I get an Oracle error when calling the SP.
    PLS-00306: wrong number or types of arguments in call to 'UPDADMINPROC'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
            at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
            at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)Any ideas? Since it reads wrong no. of arguments?
    My Java call statement looks like the following:
    CallableStatement cstmt = connection.prepareCall("{call updadminproc (?,?,?,?,?)}");
       cstmt.setDate(1,cldt);
       cstmt.setInt(2,actboxval);
       cstmt.setString(3,status1);
       cstmt.setString(4,status2);
       cstmt.setString(5,fincomments);
       cstmt.executeUpdate();I mean, I'm not trying to update the ID no., just associate the record with the ID number (cctrlid).
    Thanks.
    Ok, I got it....even though not updating the ID # itself, I had to add it to the cstmt object.
    As in ....
    cstmt.setString(5,fincomments);
    cstmt.setInt(6,ctid2);
    cstmt.executeUpdate();
    Message was edited by:
    user515689

  • Executing a Variable in a Stored Procedure containing an Update Statement

    Hi,
    I have created a Stored Procedure, it has one input parameter. Inside the Stored Procedure there are 5 other variables are declared, based on the input parameter 4 of these variables are populated.
    Fifth variable is a a concatenation of text and some of these variables and creates a dynamic Update Statement. Once it is created I want to execute this variable but it is not executing.
    Could someone please help me in knowing how to execute a variable within a stored procedure that contains an update statement.
    Thanks for your help.
    Thanks
    Vineesh
    vineesh1701

    If you have set up the variable so that it contains a valid sql update, it should work.  For example, see below, which does do an update
    use tempdb
    go
    Create Table #Test(i int);
    Insert #Test(i) Values(1);
    go
    Create Procedure TestProc As
    Begin
    Declare @SQL nvarchar(250);
    Set @SQL = 'Update #Test Set i = 2';
    --Print @SQL;
    Exec sp_executesql @SQL;
    End
    go
    Exec TestProc
    -- Test Result
    Select * From #Test;
    go
    Drop Procedure TestProc;
    go
    Drop Table #Test;
    One thing I would recommend while testing is that you print out or select the variable that contains the dynamic sql.  (Like the above code where I have a print statement.  That lets you see exactly what you are executing and if there is any problem
    with the update command. 
    As Naomi said, to get anything more than general help, you will probably have to show us your code and the parameter values you are passing when you execute the stored proc.
    Tom

  • Importing ODI Procedure in Insert/Insert-Update mode

    Can we import an ODI procedure from one project to another in INSERT or INSERT-UPDATE mode?
    We are getting xml import error while doing this. But when we do the import in DUPLICATION mode, it successfully does so.
    The issue is that we have an ODI procedure in INT environment which is been used by several other packages. We changed the code of it in our DEV environment and when we tried to import it in INT environment through INSERT-UPDATE mode so that the the changes gets effected, we got error.
    This is quite obvious that the folder/sub-folder IDs are different in both environment and this is causing trouble.
    So, is there any other way, we can reflect the change in the INT environment with minimum effort? I mean, we don't want to import it in DUPLICATION mode....if we do so, we will have to re-map that procedure in all the packages and regenerate them.

    You can use variable to replace the value at runtime in the query but you need to either pass the variable value at startup or you can refresh variable value. But I dont think you can directly retrieve any topology setting as the variable value to be substituted in the query.

  • How to read I$ table using ODI procedure

    Hi
    Can any one help me how to drop a I$ table from out sie of interface.
    I have tried below approches but no luck
    I have created ODI procedure with technology oracle and target logical schema (I$ tables are creating on target DB) with and with out begin and end;
    Approch 1:
    Given below code in ODi procedure
    drop table <%=odiRef.getTable("L", "INT_NAME", "W")%> <% if (new Integer(odiRef.getOption( "COMPATIBLE" )).intValue() >= 10 ) { out.print( "purge" ); }; %>
    Approch 2:
    drop table I$_<%=odiRef.getTable("L", "TARG_NAME", "A") %>;
    Approch 3:
    drop table <%=odiRef.getTable("L", "INT_NAME", "W")%> (but it is fetching target dtabase schema anme not I$ table)
    Please help me any other alternative way to drop a I$ table, more over this code should be unique for all interface
    Regards,
    Phanikanth

    Thanks bhabani,
    Actaul my requirement is some time my scenario is stoping due some issue at Merge Rows Step (I am using IKM Oracle Incremental Update(Merge) KM) when the next iteration starts it is thwoing and error at create flow table I$ step and error is table name is already exists, so i am doing is if the interface went failed I am storing those information in one table using ODI procedure (INF--ko-->ODI procedure) in same ODI procedure I want to call a I$ table to drop.
    Can you please provide the steps so it will very useful for me using Java variable.
    I have gievn a step as below on create I$ table step (after create I$ statement)
    <@ java.lang.String Idollertable = <%=odiRef.getTable("L", "INT_NAME", "W")%> ; @>
    I am calling Idollertable variable in ODI procedure which is ko>* of INF as <@=Idollertable@>
    Note: I have followed below approch
    ODI Procedure Code:
    drop table <@=Idollertable@>; --> *2nd approch*
    begin
    insert into ODI_EXECUTION_ERROR_DETAILS
    (SESSION_NO,
    SCENARIO_NAME,
    CONTEXT_NAME,
    ERR_MESSAGE,
    INSERT_COUNT,
    ERROR_COUNT)
    values
    <%=snpRef.getSession("SESS_NO")%>,
    '<%=odiRef.getPrevStepLog("STEP_NAME")%>',
    '<%=odiRef.getContext( "CTX_NAME" )%>',
    '<%=odiRef.getPrevStepLog("MESSAGE")%>',
    '<%=odiRef.getPrevStepLog("INSERT_COUNT")%>',
    '<%=odiRef.getPrevStepLog("ERROR_COUNT")%>'
    commit;
    drop table <@=Idollertable@>; --> * first approch *
    end;
    Please help me
    Regards,
    Phanikanth
    Edited by: Phanikanth on Mar 3, 2013 9:52 PM
    Edited by: Phanikanth on Mar 3, 2013 9:52 PM

  • ODI Procedure - updting the source table

    Hi,
    I need to call a PL/SQL package via ODI. I used ODI procedure to do the task.
    In source tab - select empid from employee
    In target tab -
    decalre
    ab varchar2(25);
    begin
    pack1.proced1(:empid,ab);
    update success1 set val1 = ab where empid = *:empid;*
    commit;
    end;
    But when i execute the procedure, its giving the error as missing parameter empid. It could not recognise the bolded part. When i give the direct value in the cmd,
    update success1 set val1 = ab where empid = *101;* its working fine.
    Any idea to resove this issue.
    Thanks in Advance,
    Ram Mohan T

    Vijay,
    1. Do you expect a single record to be returned by your source query?
    No. My source query returns with multiple records.
    2. What is the signature of your procedure? Does it accept a list of Id's or a single number.
    My procedure accepts only one id at a time. After that is processed, the next id will be passed to the procedure.
    Vijay, one thing i am confused is when I use a insert statement after the procedure its working fine (insert into success1 values(:empid,ab)).
    When i use the update stmt without where condition after the procedure also working fine (update success1 set empid1 = :empid).
    But when i use the where condition, update success1 set empid1 = ab where empid1=:empid its not working fine. Error is "Missing Parameter empid"
    Thanks in Advance,
    Ram Mohan T

  • How to run dynamic SQL from an ODI procedure step

    I am on ODI 11.1.1.6.4. From within an ODI IKM step I have no problem running a procedure step like the following which calls a pl/sql procedure to get SQL text then later runs that code. Is there anyway to do the same from within an ODI procedure? I've tried a couple of variations and can not seem to get the parsing levels to resolve within a procedure like they resolve from within a KM step.
    <@
    /* Setup Java variables */
    String out_SQL = "";
    try
    java.sql.Connection sourceConnection = odiRef.getJDBCConnection("SRC");
    String sqltxt = "{call set_sql(?)}";
    java.sql.CallableStatement pstmt = sourceConnection.prepareCall(sqltxt);
         try
         pstmt.registerOutParameter( 1, java.sql.Types.VARCHAR);
         pstmt.execute();
    out_SQL = pstmt.getString(1);
         catch(java.sql.SQLException ex)
              errMessage = ex.getMessage();
              errMessage = errMessage.replace("'","");
         finally
              pstmt.close();
    catch(java.lang.Exception e)
         errMessage = e.getMessage();
         errMessage = errMessage.replace("'","");
    @>
    BEGIN
    -- The SQL that I want to run
    <@
    out.println(out_SQL);
    @>
    -- Error handling
    <@ if ( out_SQL.length() ==0 ) { @>
         raise_application_error(-20101, '<@=errMessage@>');
    <@ } else { @>
         dbms_output.put_line('Successful.');
    <@ } @>     
    END;
    ------

    Please understand that I know that I can do this all within PL/SQL -- I am explicitly doing it the way I have outlined because I want to better understand the parsing levels/behavior within ODI procedures and I want to understand why KMs steps behave differently.
    Another observation -- putting this all within a pl/sql block prevents ODI from properly capturing insert/update/delete row counts like it would if it were running a SQL statement.
    So the question remains -- is there a way to run a dynamic SQL statement in an ODI procedure where the SQL statement is generated from within an Oracle procedure call and then run as SQL within an ODI procedure step? Best would be if there is an example of how this can be done.

  • Dynamic SQL statement in a Procedure

    Hi,
    is it possible to use a variable in place of a column name in a sql statement inside a procedure. Or to create the whole statement as a sql statement and execute it (preferrably with parameters - rather than concatinating the values).
    Thanks for any help or direction
    Elliot

    Turns out you can do the following very nicely (dynamic sql with parameterized values)
    Declare
    id number(10,0);
    sql_stmt varchar2(300);
    fieldName varchar2(30);
    fieldValue varchar2(100);
    id := 30;
    fieldName := 'somecolumn';
    fieldValue := 'some value';
    sql_stmt := 'UPDATE myTable SET ' || fieldName || ' = :1 WHERE id = :2';
    EXECUTE IMMEDIATE sql_stmt USING fieldValue, id;

  • Error in ODI procedure

    Hi Experts,
    I have created following procedure and triyng to get column value by using rownum. When I run the scenario, I am getting following exception at ODI Procedure step. Can any one please help me on it
    I have created loop package to fetch column value until loop end.
    Please let me know if you are not clear my query
    ODI Procedure:
    begin
    select a.eno into '#EMPNO' from (select rownum r,e.* from trg_emp_01 e) a where a.r=#Counter;
    end;
    #EMPNO variable created as alphanumeric datatype and
    #Counter variable created as alphanumic datatype and it is assign with '1' value
    Exception:
    6550 : 65000 : java.sql.SQLException: ORA-06550: line 1, column 25:
    PLS-00220: simple name required in this context
    ORA-06550: line 1, column 28:
    PL/SQL: ORA-00904: : invalid identifier
    ORA-06550: line 1, column 7:
    PL/SQL: SQL Statement ignored
    java.sql.SQLException: ORA-06550: line 1, column 25:
    PLS-00220: simple name required in this context
    ORA-06550: line 1, column 28:
    PL/SQL: ORA-00904: : invalid identifier
    ORA-06550: line 1, column 7:
    PL/SQL: SQL Statement ignored
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:185)
         at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:633)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1086)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2984)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3057)
         at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execSrcOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlS.treatTaskTrt(SnpSessTaskSqlS.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandScenario.treatCommand(DwgCommandScenario.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Thread.java:595)
    ODI Procedure:
    begin
    select a.eno into #EMPNO from (select rownum r,e.* from trg_emp_01 e) a where a.r=#Counter;
    end;
    Exception:
    6550 : 65000 : java.sql.SQLException: ORA-06550: line 1, column 26:
    PL/SQL: ORA-00936: missing expression
    ORA-06550: line 1, column 7:
    PL/SQL: SQL Statement ignored
    java.sql.SQLException: ORA-06550: line 1, column 26:
    PL/SQL: ORA-00936: missing expression
    ORA-06550: line 1, column 7:
    PL/SQL: SQL Statement ignored
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:185)
         at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:633)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1086)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2984)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3057)
         at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execSrcOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlS.treatTaskTrt(SnpSessTaskSqlS.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandScenario.treatCommand(DwgCommandScenario.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Thread.java:595)
    Thanks
    Phani
    Edited by: Phanikanth on Jul 9, 2010 1:25 AM
    Edited by: Phanikanth on Jul 9, 2010 2:08 AM

    Good point - In my case, these are single executable statements. These have been saved in ODI and executed successfully. Just no using my machine.
    EXAMPLE 1------------
    DECLARE
    RetVal ;
    I_STRING VARCHAR2(200);
    BEGIN
    I_STRING := '';
    RetVal := XXX.PKG_XXX.SF_COMMA_TO_TABLE ( I_STRING );
    COMMIT;
    END;
    EXAMPLE 2------------
    SELECT C.COL1, B.COL2, B.COL3,TO_CHAR(B.EFFDT,'YYYY-MM-DD') COL4,B.COL5,B.COL6
    FROM TABLE1 A, TABLE2 B, TABLE3 C
    WHERE
    and A.ID = 'XXX'
    and a.setcntrlvalue = ' '
    AND A.NAME = 'XXX'
    AND A.EFFDT =
    (SELECT MAX(A_ED.EFFDT) FROM TABLE1 A_ED
    WHERE A.SETID = A_ED.SETID
    AND A_ED.EFFDT <= SYSDATE)
    AND B.EFFDT =
    (SELECT MAX(B_ED.EFFDT) FROM TABLE2 B_ED
    WHERE B.SETID = B_ED.SETID
    AND B.ACCOUNT = B_ED.ACCOUNT
    AND B_ED.EFFDT <= SYSDATE)
    AND A.SETID = B.SETID
    AND A.RANGE_FROM = A.RANGE_TO
    AND B.ACCOUNT = A.RANGE_FROM
    AND A.SETID = C.SETID
    AND A.TREE_NAME = C.TREE_NAME
    AND A.TREE_NODE_NUM = C.TREE_NODE_NUM
    AND C.EFFDT =
    (SELECT MAX(C_ED.EFFDT) FROM TABLE3 C_ED
    WHERE C.SETID = C_ED.SETID
    AND C_ED.EFFDT <= A.EFFDT)
    ------------------

  • Where clause in UPDATE statement is ignored

    I have the following procedure that updates a field in a table. The only problem is that all rows in the table are updated like the update statement doesn't have a where clause. When I hard code the number (733) in the where clause it works as expected. Even if I don't alias the table name it still updates all rows in the table. Any ideas?
    DECLARE
    extlinkid CONSTANT NUMBER := 733;
    newURL CONSTANT VARCHAR2(250) := 'mailto:[email protected]';
    BEGIN
    UPDATE SCHEMA.TABLE A
    SET A.URL = newURL
    WHERE (A.EXTLINKID = extlinkid);
    commit;
    END;

    Oracle is resolving your variable extlinkid as the column in the table, so your UPDATE statement is equivalent to:
    UPDATE schema.table a
    SET a.url = newurl
    WHERE (a.extlinkid = a.extlinkid);Which, of course, matches every record in the table. You need to change the name of your variable to something that is not a column name.
    TTFN
    John

Maybe you are looking for

  • How do I send an email to a group address using my iPad

    I use and IPad Air 2 with latest IOS and am trying to send and email to a group.  How do I do this?  I simply type in the group name when I'm sending the message from my iMac, however that doesn't work on my iPad.  I have the group set up on my iClou

  • Can I get a refund for my iPad if it's faulty?

    I have the original iPad that I bought at the end of august last year. But it thinks that there are headphone plugged in when the clearly isn't. I have booked a genius bar appointment for Friday and was wondering if the fault is a legitimate one if I

  • Error in PI 7.0 not connect to go.bat & Post installation errors

    im completed installation of PI 7.0 SYSTEM NAME : BIW7 System ID   : BI7 DB ID       : BIW Instance No : 04 for post installation unable tp connect  go.bat im giving right password http://biw7:50400/ExchangeProfile   = it gives error 404 not found ht

  • Best Practice for Creating JAR File

    I have my first java program all done (Yipee!) and I have created the .jar file but I don't think I am really creating it like I should. When I ran it on another machine it had problems because I think it couldn't find all the other classes like the

  • How to edit Excel files in MacBook Pro

    I just got my first Mac and I am wondering if there are any programs/apps other than numbers or excel for Mac that I can use to edit excel files I have stored in my Dropbox account.  I only have a few files and don't really want to spend alot of mone