Savepoint help

I have a series of SQL statements in a script file. Need to commit only if all statements are executed successfully. (script will be executed in sqlplus) Is there a way I can execute without using begin... end. if we are using begin... end, if any one statement fails control will jump to exception para and a rollback to beginning can be done. But I want to see the result of all statement execution (spool output to a file), commit only if everything is successful.
savepoint a;
insert into mytest values ('brad', 15);
insert into mytest values ('tom', 11);
insert into mytest values ('sam, 12);
--- ??? savepoint b;
--- ???commit
Can someone help me
Thanks
Raj

Be sure in p2 procedure there are the required commit and rollback...

Similar Messages

  • Can't see the issue in code...please help

    I have this procedure within a package. Trying to compile and can't...get errors and I can't see why...any help???
    PROCEDURE KILL_ORPH_2PHASE_COMMITS (inLocal_tran_id IN varchar2) is
      tsql            VARCHAR2(256);
      v_local_tran_id varchar2(22 byte);
    BEGIN
    IF inLocal_tran_id is not null then
        tsql := 'ROLLBACK FORCE ''' || inLocal_tran_id || '''';
        dbms_output.put_line(tsql);
        EXECUTE IMMEDIATE tsql;
        RETURN;
    END IF;
        --open cursor
        open cur_2pc;
        loop
          --fetch cursor data
          fetch cur_2pc
            into v_local_tran_id;
          exit when cur_2pc%NOTFOUND;
          tsql := 'ROLLBACK FORCE ''' || v_local_tran_id || '''';
          dbms_output.put_line(tsql);
          EXECUTE IMMEDIATE tsql;
    EXCEPTION
      WHEN OTHERS
        THEN
          dbms_transaction.purge_lost_db_entry('''' || v_local_tran_id || '''');
    END;
    END LOOP;
    CLOSE cur_2pc;
    END KILL_ORPH_2PHASE_COMMITS;Error is:
    Compilation errors for PACKAGE BODY ADMIN.ADMIN_DBA_MAIN
    Error: PLS-00103: Encountered the symbol "EXCEPTION" when expecting one of the following:
    ( begin case declare end exit for goto if loop mod null
    pragma raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    continue close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe purge
    Line: 40
    Text: EXCEPTION
    Error: PLS-00103: Encountered the symbol "LOOP" when expecting one of the following:
    Line: 45
    Text: END LOOP;

    The BEGIN and END are not matching..??
    From your code, it looks like...you want each statement in your loop to have it's own begin..exception..end..
    BEGIN
    IF inLocal_tran_id is not null then
        tsql := 'ROLLBACK FORCE ''' || inLocal_tran_id || '''';
        dbms_output.put_line(tsql);
        EXECUTE IMMEDIATE tsql;
        RETURN;
    END IF;
        --open cursor
        open cur_2pc;
        loop
       BEGIN----------<<<<<<<<Begin for each iteration to have it's own loop...
       ------------>>>(this is for each statement in the loop...)
         --fetch cursor data
          fetch cur_2pc
            into v_local_tran_id;
          exit when cur_2pc%NOTFOUND;
          tsql := 'ROLLBACK FORCE ''' || v_local_tran_id || '''';
          dbms_output.put_line(tsql);
          EXECUTE IMMEDIATE tsql;
    EXCEPTION
      WHEN OTHERS
        THEN
          dbms_transaction.purge_lost_db_entry('''' || v_local_tran_id || '''');
    END;
    END LOOP;
    END KILL_ORPH_2PHASE_COMMITS; ----<<<Another End for the procedure....>>>

  • Use of savepoint and rollback in trigger of forms

    I have a button in forms with next code
    --savepoint   
    SAVEPOINT SAVEP1;
    --Call procedure of BBDD: Changed data of tables
    Packet.procedureexample(..., bResult);
    --If not correct the execution -> rollback to savepoint and exit form
    IF NOT bResult THEN
      ROLLBACK TO SAVEPOINT SAVEP1;
      Exit_Form(NO_VALIDATE);
    END IF;
    -- Othe savepoint
    SAVEPOINT SAVEP2;
    --Call other procedure of BBDD: Changed data of tables
    Packet.procedureexample2(..., bResult);
    --If not correct the execution -> rollback to savepoint and exit form
    IF NOT bResult THEN
      ROLLBACK TO SAVEPOINT SAVEP2;
      Exit_Form(NO_VALIDATE);
    END IF;
    --All correct -> COMMIT
    COMMIT;This question is: if execution of "Packet.procedureexample" is correct, but the execution of "Packet.procedureexample2" isn't correct, what happend with data changed for first procedure (Packet.procedureexample).
    Thnks.

    Hi Jortri,
    If execution of "Packet.procedureexample" is correct, but the execution of "Packet.procedureexample2" isn't correct,
    Nothing will happen to data changed for Packet.procedureexample because it has not yet been committed.
    It's because when you are giving rollback to save point, you've also done Exit_Form(NO_VALIDATE); COMMIT is only at the last.
    Hence, if Packet.procedureexample2" is not correct, it'll roll back to save point 2(SAVEP2) and exit the form without validating.
    Since, commit is not issued till now, whatever data modification were done using Packet.procedureexample, are lost.
    If both of the packages data are independent of each other and you don't want to lose the change then issue a commit before creating second savepoint.
    Hope it helps.
    +Please mark answer as helpful / correct, if it helps you+
    Navnit
    Edited by: Navnit Punj on 17-Jun-2009 02:10

  • Error while working with OracleApps Adapter please help mee

    <bindingFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="code"><code>1086</code>
    </part><part name="summary"><summary>file:/F:/product/10.1.3.1/OracleAS_2/bpel/domains/test/tmp/.bpel_RepairOrder_1.0_4bac0e828ef344d37656722b167615db.tmp/CreateRepairOrder.wsdl [ CreateRepairOrder_ptt::CreateRepairOrder(InputParameters,OutputParameters) ] - WSIF JCA Execute of operation 'CreateRepairOrder' failed due to: Error while trying to prepare and execute an API.
    An error occurred while preparing and executing the APPS.XX_BPEL_CREATEREPAIRORDER.CSD_REPAIRS_PUB$CREATE_REPAIR API. Cause: java.sql.SQLException: ORA-01086: savepoint 'CREATE_REPAIR_ORDER_PUB' never established
    ORA-06512: at "APPS.JTF_PLSQL_API", line 65
    ORA-06512: at "APPS.CSD_REPAIRS_PUB", line 144
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "APPS.XX_BPEL_CREATEREPAIRORDER", line 160
    ORA-06512: at line 1
    [Caused by: ORA-01086: savepoint 'CREATE_REPAIR_ORDER_PUB' never established
    ORA-06512: at "APPS.JTF_PLSQL_API", line 65
    ORA-06512: at "APPS.CSD_REPAIRS_PUB", line 144
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "APPS.XX_BPEL_CREATEREPAIRORDER", line 160
    ORA-06512: at line 1
    ; nested exception is:
         ORABPEL-11811
    Error while trying to prepare and execute an API.
    An error occurred while preparing and executing the APPS.XX_BPEL_CREATEREPAIRORDER.CSD_REPAIRS_PUB$CREATE_REPAIR API. Cause: java.sql.SQLException: ORA-01086: savepoint 'CREATE_REPAIR_ORDER_PUB' never established
    ORA-06512: at "APPS.JTF_PLSQL_API", line 65
    ORA-06512: at "APPS.CSD_REPAIRS_PUB", line 144
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "APPS.XX_BPEL_CREATEREPAIRORDER", line 160
    ORA-06512: at line 1
    [Caused by: ORA-01086: savepoint 'CREATE_REPAIR_ORDER_PUB' never established
    ORA-06512: at "APPS.JTF_PLSQL_API", line 65
    ORA-06512: at "APPS.CSD_REPAIRS_PUB", line 144
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "APPS.XX_BPEL_CREATEREPAIRORDER", line 160
    ORA-06512: at line 1
    Check to ensure that the API is defined in the database and that the parameters match the signature of the API. Contact oracle support if error is not fixable.
    </summary>
    </part><part name="detail"><detail>
    Internal Exception: java.sql.SQLException: ORA-01086: savepoint 'CREATE_REPAIR_ORDER_PUB' never established
    ORA-06512: at "APPS.JTF_PLSQL_API", line 65
    ORA-06512: at "APPS.CSD_REPAIRS_PUB", line 144
    ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "APPS.XX_BPEL_CREATEREPAIRORDER", line 160
    ORA-06512: at line 1
    Error Code: 1086</detail>
    </part></bindingFault>

    create or replace
    PACKAGE BODY CSD_REPAIRS_PUB as
    /* $Header: csdpdrab.pls 120.12 2006/09/05 11:57:18 vparvath noship $ */
    * This is the public interface for the Depot Repair API. It allows
    * execution of various Depot Repair APIs.
    * @rep:scope public
    * @rep:product CSD
    * @rep:displayname Depot Repair APIs
    * @rep:lifecycle active
    * @rep:category BUSINESS_ENTITY CSD_REPAIR_ORDER
    -- Package name : CSD_REPAIRS_PUB
    -- Purpose : This package contains the public APIs for creating
    -- and updating repair orders.
    -- History :
    -- Version Date Name Description
    -- 115.0 11/17/99 pkdas Created.
    -- 115.1 12/18/99 pkdas
    -- 115.2 01/04/00 pkdas
    -- 115.3 02/09/00 pkdas Added p_REPAIR_LINE_ID as IN parameter in the
    -- Create_Repairs procedure.
    -- Added p_REPAIR_NUMBER as OUT parameter in the
    -- Create_Repairs procedure.
    -- 115.4 02/29/00 pkdas Changed the procedure name
    -- Create_Repairs -> Create_Repair_Order
    -- Update_Repairs -> Update_Repair_Order
    -- Added p_validation_level to Create_Repair_Order and
    -- Update_Repair_Order
    -- NOTE :
    G_PKG_NAME CONSTANT VARCHAR2(30) := 'CSD_REPAIRS_PUB';
    G_FILE_NAME CONSTANT VARCHAR2(12) := 'csdpdrab.pls';
    g_debug NUMBER := csd_gen_utility_pvt.g_debug_level;
    * Create Repair Order
    * @param P_Api_Version_Number api version number
    * @param P_Init_Msg_List initial the message stack, default to false
    * @param P_Commit to decide whether to commit the transaction or not, default to false
    * @param p_validation_level validation level, default to full level
    * @param p_repair_line_id repair line id is unique id
    * @param P_REPLN_Rec repiar line record
    * @param p_create_default_logistics flag to create logistics lines, default to N
    * @param X_REPAIR_LINE_ID repair line id of the created repair order
    * @param X_REPAIR_NUMBER repair number of the created repair order which display on Depot UI
    * @param X_Return_Status return status
    * @param X_Msg_Count return message count
    * @param X_Msg_Data return message data
    * @rep:scope public
    * @rep:lifecycle active
    * @rep:displayname Create Repair Order
    PROCEDURE Create_Repair_Order(P_Api_Version_Number IN NUMBER,
    P_Init_Msg_List IN VARCHAR2 := FND_API.G_FALSE,
    P_Commit IN VARCHAR2 := FND_API.G_FALSE,
    p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
    P_REPAIR_LINE_ID IN NUMBER := FND_API.G_MISS_NUM,
    P_REPLN_Rec IN CSD_REPAIRS_PUB.REPLN_Rec_Type,
    p_create_default_logistics IN VARCHAR2 := 'N',
    X_REPAIR_LINE_ID OUT NOCOPY NUMBER,
    X_REPAIR_NUMBER OUT NOCOPY VARCHAR2,
    X_Return_Status OUT NOCOPY VARCHAR2,
    X_Msg_Count OUT NOCOPY NUMBER,
    X_Msg_Data OUT NOCOPY VARCHAR2) IS
    l_api_name CONSTANT VARCHAR2(30) := 'Create_Repair_Order';
    l_api_version_number CONSTANT NUMBER := 1.0;
    BEGIN
    -- Standard Start of API savepoint
    SAVEPOINT CREATE_REPAIR_ORDER_PUB;
    -- Standard call to check for call compatibility.
    IF NOT FND_API.Compatible_API_Call(l_api_version_number,
    p_api_version_number,
    l_api_name,
    G_PKG_NAME)
    THEN
    RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
    END IF;
    -- Initialize message list if p_init_msg_list is set to TRUE.
    IF FND_API.to_Boolean(p_init_msg_list)
    THEN
    FND_MSG_PUB.initialize;
    END IF;
    -- Initialize API return status to success
    x_return_status := FND_API.G_RET_STS_SUCCESS;
    -- API body
    CSD_REPAIRS_PVT.Create_Repair_Order(P_Api_Version_Number => 1.0,
    P_Init_Msg_List => p_init_msg_list,
    P_Commit => p_commit,
    P_Validation_Level => p_validation_level,
    P_REPAIR_LINE_ID => p_REPAIR_LINE_ID,
    P_REPLN_Rec => p_REPLN_Rec,
    X_REPAIR_LINE_ID => x_REPAIR_LINE_ID,
    X_REPAIR_NUMBER => x_REPAIR_NUMBER,
    X_Return_Status => x_return_status,
    X_Msg_Count => x_msg_count,
    X_Msg_Data => x_msg_data);
    -- Check return status from the above procedure call
    IF not (x_return_status = FND_API.G_RET_STS_SUCCESS)
    then
    ROLLBACK TO CREATE_REPAIR_ORDER_PUB;
    return;
    END IF;
    IF (P_CREATE_DEFAULT_LOGISTICS = 'Y') THEN
    CSD_LOGISTICS_PVT.Create_Default_Logistics
    ( p_api_version => P_Api_Version_Number,
    p_commit => P_Commit,
    p_init_msg_list => P_Init_Msg_List,
    p_validation_level => p_validation_level,
    p_repair_line_id => P_REPAIR_LINE_ID,
    x_return_status => X_Return_Status,
    x_msg_count => X_Msg_Count,
    x_msg_data => X_Msg_Data
    IF NOT(x_return_status = FND_API.G_RET_STS_SUCCESS) THEN
    RAISE FND_API.G_EXC_ERROR;
    END IF;
    END IF;
    -- End of API body.
    -- Standard check for p_commit
    IF FND_API.to_Boolean(p_commit)
    THEN
    COMMIT WORK;
    END IF;
    -- Standard call to get message count and if count is 1, get message info.
    FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
    p_data => x_msg_data);
    EXCEPTION
    WHEN FND_API.G_EXC_ERROR THEN
    JTF_PLSQL_API.HANDLE_EXCEPTIONS(P_API_NAME => L_API_NAME,-------------------------------line 144 error
    P_PKG_NAME => G_PKG_NAME,
    P_EXCEPTION_LEVEL => FND_MSG_PUB.G_MSG_LVL_ERROR,
    P_PACKAGE_TYPE => JTF_PLSQL_API.G_PUB,
    X_MSG_COUNT => X_MSG_COUNT,
    X_MSG_DATA => X_MSG_DATA,
    X_RETURN_STATUS => X_RETURN_STATUS);
    -- RAISE;
    WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
    JTF_PLSQL_API.HANDLE_EXCEPTIONS(P_API_NAME => L_API_NAME,
    P_PKG_NAME => G_PKG_NAME,
    P_EXCEPTION_LEVEL => FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR,
    P_PACKAGE_TYPE => JTF_PLSQL_API.G_PUB,
    X_MSG_COUNT => X_MSG_COUNT,
    X_MSG_DATA => X_MSG_DATA,
    X_RETURN_STATUS => X_RETURN_STATUS);
    -- RAISE;
    WHEN OTHERS THEN
    JTF_PLSQL_API.HANDLE_EXCEPTIONS(P_API_NAME => L_API_NAME,
    P_PKG_NAME => G_PKG_NAME,
    P_EXCEPTION_LEVEL => JTF_PLSQL_API.G_EXC_OTHERS,
    P_PACKAGE_TYPE => JTF_PLSQL_API.G_PUB,
    X_MSG_COUNT => X_MSG_COUNT,
    X_MSG_DATA => X_MSG_DATA,
    X_RETURN_STATUS => X_RETURN_STATUS);
    -- RAISE;
    End Create_Repair_Order;
    PROCEDURE Update_Repair_Order(P_Api_Version_Number IN NUMBER,
    P_Init_Msg_List IN VARCHAR2 := FND_API.G_FALSE,
    P_Commit IN VARCHAR2 := FND_API.G_FALSE,
    p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
    p_REPAIR_LINE_ID IN NUMBER,
    P_REPLN_Rec IN OUT NOCOPY CSD_REPAIRS_PUB.REPLN_Rec_Type,
    X_Return_Status OUT NOCOPY VARCHAR2,
    X_Msg_Count OUT NOCOPY NUMBER,
    X_Msg_Data OUT NOCOPY VARCHAR2) IS
    l_api_name CONSTANT VARCHAR2(30) := 'Update_Repair_Order';
    l_api_version_number CONSTANT NUMBER := 1.0;
    BEGIN
    -- Standard Start of API savepoint
    SAVEPOINT UPDATE_REPAIR_ORDER_PUB;
    -- Standard call to check for call compatibility.
    IF NOT FND_API.Compatible_API_Call(l_api_version_number,
    p_api_version_number,
    l_api_name,
    G_PKG_NAME)
    THEN
    RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
    END IF;
    -- Initialize message list if p_init_msg_list is set to TRUE.
    IF FND_API.to_Boolean(p_init_msg_list)
    THEN
    FND_MSG_PUB.initialize;
    END IF;
    -- Initialize API return status to SUCCESS
    x_return_status := FND_API.G_RET_STS_SUCCESS;
    -- API body
    CSD_repairs_PVT.Update_Repair_Order(P_Api_Version_Number => 1.0,
    P_Init_Msg_List => p_init_msg_list,
    P_Commit => p_commit,
    P_Validation_Level => p_validation_level,
    p_REPAIR_LINE_ID => p_repair_line_id,
    P_REPLN_Rec => p_REPLN_Rec,
    X_Return_Status => x_return_status,
    X_Msg_Count => x_msg_count,
    X_Msg_Data => x_msg_data);
    -- Check return status from the above procedure call
    IF not (x_return_status = FND_API.G_RET_STS_SUCCESS)
    then
    ROLLBACK TO UPDATE_REPAIR_ORDER_PUB;
    return;
    END IF;
    -- End of API body.
    -- Standard check for p_commit
    IF FND_API.to_Boolean(p_commit)
    THEN
    COMMIT WORK;
    END IF;
    -- Standard call to get message count and if count is 1, get message info.
    FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
    p_data => x_msg_data);
    EXCEPTION
    WHEN FND_API.G_EXC_ERROR THEN
    JTF_PLSQL_API.HANDLE_EXCEPTIONS(P_API_NAME => L_API_NAME,
    P_PKG_NAME => G_PKG_NAME,
    P_EXCEPTION_LEVEL => FND_MSG_PUB.G_MSG_LVL_ERROR,
    P_PACKAGE_TYPE => JTF_PLSQL_API.G_PUB,
    X_MSG_COUNT => X_MSG_COUNT,
    X_MSG_DATA => X_MSG_DATA,
    X_RETURN_STATUS => X_RETURN_STATUS);
    -- RAISE;
    WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
    JTF_PLSQL_API.HANDLE_EXCEPTIONS(P_API_NAME => L_API_NAME,
    P_PKG_NAME => G_PKG_NAME,
    P_EXCEPTION_LEVEL => FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR,
    P_PACKAGE_TYPE => JTF_PLSQL_API.G_PUB,
    X_MSG_COUNT => X_MSG_COUNT,
    X_MSG_DATA => X_MSG_DATA,
    X_RETURN_STATUS => X_RETURN_STATUS);
    -- RAISE;
    WHEN OTHERS THEN
    JTF_PLSQL_API.HANDLE_EXCEPTIONS(P_API_NAME => L_API_NAME,
    P_PKG_NAME => G_PKG_NAME,
    P_EXCEPTION_LEVEL => JTF_PLSQL_API.G_EXC_OTHERS,
    P_PACKAGE_TYPE => JTF_PLSQL_API.G_PUB,
    X_MSG_COUNT => X_MSG_COUNT,
    X_MSG_DATA => X_MSG_DATA,
    X_RETURN_STATUS => X_RETURN_STATUS);
    -- RAISE;
    End Update_Repair_Order;
    -- R12 Development Begin
    * Update Repair Order Status
    * @param P_Api_Version api version number
    * @param P_Commit to decide whether to commit the transaction or not, default to false
    * @param P_Init_Msg_List initial the message stack, default to false
    * @param X_Return_Status return status
    * @param X_Msg_Count return message count
    * @param X_Msg_Data return message data
    * @param P_Repair_status_rec repair status attributes record.
    * @param P_status_upd_control_rec repair status record control flags.
    * @param X_OBJECT_VERSION_NUMBER
    * @rep:scope public
    * @rep:lifecycle active
    * @rep:displayname Update Repair Order Status
    PROCEDURE Update_Ro_Status(P_Api_Version IN NUMBER,
    P_Commit IN VARCHAR2,
    P_Init_Msg_List IN VARCHAR2,
    X_Return_Status OUT NOCOPY VARCHAR2,
    X_Msg_Count OUT NOCOPY NUMBER,
    X_Msg_Data OUT NOCOPY VARCHAR2,
    P_REPAIR_STATUS_Rec IN REPAIR_STATUS_REC_TYPE,
    P_STATUS_UPD_CONTROL_REC IN STATUS_UPD_CONTROL_REC_TYPE,
    X_OBJECT_VERSION_NUMBER OUT NOCOPY NUMBER) IS
    l_api_name CONSTANT VARCHAR2(30) := 'Update_Ro_Status';
    l_api_version_number CONSTANT NUMBER := 1.0;
         l_msg_data varchar2(2000);
         l_msg_index_out NUMBER;
    BEGIN
    -- Standard Start of API savepoint
    SAVEPOINT UPDATE_RO_STATUS_PUB;
    -- Initialize message list if p_init_msg_list is set to TRUE.
    IF FND_API.to_Boolean(p_init_msg_list)
    THEN
    FND_MSG_PUB.initialize;
    END IF;
    -- Initialize API return status to success
    x_return_status := FND_API.G_RET_STS_SUCCESS;
    -- API body
    CSD_REPAIRS_PVT.UPDATE_RO_STATUS(P_Api_Version => p_api_version,
    P_Commit => p_commit,
    P_Init_Msg_List => p_init_msg_list,
    P_Validation_Level => FND_API.G_VALID_LEVEL_FULL,
    X_Return_Status => x_return_status,
    X_Msg_Count => x_msg_count,
    X_Msg_Data => x_msg_data,
    P_REPAIR_STATUS_REC => p_repair_status_rec,
    P_STATUS_CONTROL_REC => p_status_upd_control_rec,
    X_OBJECT_VERSION_NUMBER => x_object_Version_number);
    -- Check return status from the above procedure call
    IF not (x_return_status = FND_API.G_RET_STS_SUCCESS)
    then
    ROLLBACK TO UPDATE_RO_STATUS_PUB;
    return;
    END IF;
    -- End of API body.
    -- Standard check for p_commit
    IF FND_API.to_Boolean(p_commit)
    THEN
    COMMIT WORK;
    END IF;
    -- Standard call to get message count and if count is 1, get message info.
    FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
    p_data => x_msg_data);
         if(x_msg_count > 1) then
              FOR l_index IN 1 .. x_msg_count
              LOOP
              fnd_msg_pub.get (p_msg_index => l_index,
                        p_encoded => fnd_api.g_false,
                        p_data => l_msg_data,
                        p_msg_index_out => l_msg_index_out
              x_msg_data := x_msg_data ||'['||l_msg_data||']';
              END LOOP;
         end if;
    EXCEPTION
    WHEN Fnd_Api.G_EXC_ERROR THEN
    x_return_status := Fnd_Api.G_RET_STS_ERROR;
    ROLLBACK TO UPDATE_RO_STATUS_PUB;
    Fnd_Msg_Pub.Count_And_Get(p_count => x_msg_count,
    p_data => x_msg_data);
    IF (Fnd_Log.level_error >= Fnd_Log.g_current_runtime_level)
    THEN
    Fnd_Log.STRING(Fnd_Log.level_error,
    'csd.plsql.CSD_REPAIRS_PUB.Update_ro_status',
    'EXC_ERROR[' || x_msg_data || ']');
    END IF;
         if(x_msg_count > 1) then
              FOR l_index IN 1 .. x_msg_count
              LOOP
              fnd_msg_pub.get (p_msg_index => l_index,
                        p_encoded => fnd_api.g_false,
                        p_data => l_msg_data,
                        p_msg_index_out => l_msg_index_out
              x_msg_data := x_msg_data ||'['||l_msg_data||']';
              END LOOP;
         end if;
    WHEN Fnd_Api.G_EXC_UNEXPECTED_ERROR THEN
    x_return_status := Fnd_Api.G_RET_STS_UNEXP_ERROR;
    ROLLBACK TO UPDATE_RO_STATUS_PUB;
    Fnd_Msg_Pub.Count_And_Get(p_count => x_msg_count,
    p_data => x_msg_data);
    IF (Fnd_Log.level_exception >= Fnd_Log.g_current_runtime_level)
    THEN
    Fnd_Log.STRING(Fnd_Log.level_exception,
    'csd.plsql.CSD_REPAIRS_PUB.Update_ro_status',
    'EXC_UNEXP_ERROR[' || x_msg_data || ']');
    END IF;
         if(x_msg_count > 1) then
              FOR l_index IN 1 .. x_msg_count
              LOOP
              fnd_msg_pub.get (p_msg_index => l_index,
                        p_encoded => fnd_api.g_false,
                        p_data => l_msg_data,
                        p_msg_index_out => l_msg_index_out
              x_msg_data := x_msg_data ||'['||l_msg_data||']';
              END LOOP;
         end if;
    WHEN OTHERS THEN
    x_return_status := Fnd_Api.G_RET_STS_UNEXP_ERROR;
    Rollback TO UPDATE_RO_STATUS_PUB;
    IF Fnd_Msg_Pub.Check_Msg_Level(Fnd_Msg_Pub.G_MSG_LVL_UNEXP_ERROR)
    THEN
    Fnd_Msg_Pub.Add_Exc_Msg(G_PKG_NAME, l_api_name);
    END IF;
    Fnd_Msg_Pub.Count_And_Get(p_count => x_msg_count,
    p_data => x_msg_data);
    IF (Fnd_Log.level_exception >= Fnd_Log.g_current_runtime_level)
    THEN
    Fnd_Log.STRING(Fnd_Log.level_exception,
    'csd.plsql.CSD_REPAIRS_PUB.Update_ro_status',
    'SQL MEssage[' || SQLERRM || ']');
    END IF;
         if(x_msg_count > 1) then
              FOR l_index IN 1 .. x_msg_count
              LOOP
              fnd_msg_pub.get (p_msg_index => l_index,
                        p_encoded => fnd_api.g_false,
                        p_data => l_msg_data,
                        p_msg_index_out => l_msg_index_out
              x_msg_data := x_msg_data ||'['||l_msg_data||']';
              END LOOP;
         end if;
    End Update_ro_status;
    -- R12 Development End
    End CSD_REPAIRS_PUB;
    Plzz checkout help me out

  • ORA-00060 DEADLOCK DETECTED - Need Help

    Hi Gurus,
    I have a question on how to determine the trace log. Where the deadlock happen.
    Please help. I have no other hint on how to resolve the error.
    *** ACTION NAME:() 2008-08-06 03:34:21.740
    *** MODULE NAME:(OEM.SystemPool) 2008-08-06 03:34:21.740
    *** SERVICE NAME:(celcomdb) 2008-08-06 03:34:21.740
    *** CLIENT ID:() 2008-08-06 03:34:21.740
    *** SESSION ID:(113.3188) 2008-08-06 03:34:21.740
    DEADLOCK DETECTED ( ORA-00060 )
    [Transaction Deadlock]
    The following deadlock is not an ORACLE error. It is a
    deadlock due to user error in the design of an application
    or from issuing incorrect ad-hoc SQL. The following
    information may aid in determining the deadlock:
    Deadlock graph:
    ---------Blocker(s)-------- ---------Waiter(s)---------
    Resource Name process session holds waits process session holds waits
    TM-0000c45a-00000000 119 113 X 27 60 SX
    TX-0004002c-000269bc 27 60 X 119 113 X
    session 113: DID 0001-0077-00000028     session 60: DID 0001-001B-00000278
    session 60: DID 0001-001B-00000278     session 113: DID 0001-0077-00000028
    Rows waited on:
    Session 60: no row
    Session 113: obj - rowid = 0000C384 - AAAMOEAADAAAF99AAA
    (dictionary objn - 50052, file - 3, block - 24445, slot - 0)
    Information on the OTHER waiting sessions:
    Session 60:
    pid=27 serial=1313 audsid=0 user: 51/SYSMAN
    O/S info: user: oracle10, term: UNKNOWN, ospid: 14610456, machine: S63KLJ01
    program: oracle@S63KLJ01 (J000)
    application name: EM_PING, hash value=2147830874
    action name: AGENT_STATUS_MARKER, hash value=2850782869
    Current SQL information unavailable
    End of information on OTHER waiting sessions.
    Current SQL statement for this session:
    UPDATE MGMT_OMS_PARAMETERS SET VALUE=TO_CHAR(SYSDATE, 'DD-Mon-YYYY HH24:MI:SS') WHERE HOST_URL=:B1 AND NAME='TIMESTAMP'
    ----- PL/SQL Call Stack -----
    object line object
    handle number name
    70000006e5ab778 39 package body SYSMAN.MGMT_FAILOVER
    70000002e8aaf98 1 anonymous block
    ===================================================
    PROCESS STATE
    Process global information:
    process: 70000006f4b1598, call: 70000006a9c9320, xact: 70000006dedcf98, curses: 70000006f5a5a50, usrses: 70000006f5a5a50
    SO: 70000006f4b1598, type: 2, owner: 0, flag: INIT/-/-/0x00
    (process) Oracle pid=119, calls cur/top: 70000006a9c9320/70000006abfcaf8, flag: (0) -
    int error: 0, call error: 0, sess error: 0, txn error 0
    (post info) last post received: 0 0 9
    last post received-location: ksqrcl
    last process to post me: 70000006f484118 141 0
    last post sent: 0 0 0
    last post sent-location: No post
    last process posted by me: none
    (latch info) wait_event=0 bits=0
    Process Group: DEFAULT, pseudo proc: 70000006f50bcd0
    O/S info: user: oracle10, term: UNKNOWN, ospid: 11538508
    OSD pid info: Unix process pid: 11538508, image: oraclecelcomdb@S63KLJ01
    Dump of memory from 0x070000006F45FCD0 to 0x070000006F45FED8
    70000006F45FCD0 00000004 00000000 07000000 6A9ABD00 [............j...]
    70000006F45FCE0 00000010 0003139D 07000000 6ABFCAF8 [............j...]
    70000006F45FCF0 00000003 0003139D 07000000 6F8FD600 [............o...]
    70000006F45FD00 0000000B 0003139D 07000000 6F5A5A50 [............oZZP]
    70000006F45FD10 00000004 00031291 00000000 00000000 [................]
    70000006F45FD20 00000000 00000000 00000000 00000000 [................]
    Repeat 26 times
    70000006F45FED0 00000000 00000000 [........]
    SO: 70000006f5a5a50, type: 4, owner: 70000006f4b1598, flag: INIT/-/-/0x00
    (session) sid: 113 trans: 70000006dedcf98, creator: 70000006f4b1598, flag: (41) USR/- BSY/-/-/-/-/-
    DID: 0001-0077-00000028, short-term DID: 0000-0000-00000000
    txn branch: 0
    oct: 6, prv: 0, sql: 70000006e5a9140, psql: 70000006e5a9410, user: 51/SYSMAN
    O/S info: user: oracle10, term: unknown, ospid: 1234, machine: S63KLJ01
    program: OMS
    client info: S63KLJ01_Management_Service
    application name: OEM.SystemPool, hash value=2960518376
    last wait for 'enq: TX - row lock contention' blocking sess=0x70000006f5611e0 seq=322 wait_time=2929700 seconds since wait started=4
    name|mode=54580006, usn<<16 | slot=4002c, sequence=269bc
    Dumping Session Wait History
    for 'enq: TX - row lock contention' count=1 wait_time=2929700
    name|mode=54580006, usn<<16 | slot=4002c, sequence=269bc
    for 'enq: TM - contention' count=1 wait_time=224489
    name|mode=544d0006, object #=c45a, table/partition=0
    for 'enq: TM - contention' count=1 wait_time=2929708
    name|mode=544d0006, object #=c45a, table/partition=0
    for 'SQL*Net message from client' count=1 wait_time=35033
    driver id=28444553, #bytes=1, =0
    for 'SQL*Net message to client' count=1 wait_time=1
    driver id=28444553, #bytes=1, =0
    for 'SQL*Net message from client' count=1 wait_time=227
    driver id=28444553, #bytes=1, =0
    for 'SQL*Net message to client' count=1 wait_time=1
    driver id=28444553, #bytes=1, =0
    for 'latch: library cache' count=1 wait_time=96826
    address=70000006cf2f298, number=d6, tries=0
    for 'latch: library cache' count=1 wait_time=36929
    address=70000006cf2f0b8, number=d6, tries=0
    for 'SQL*Net message from client' count=1 wait_time=131974
    driver id=28444553, #bytes=1, =0
    temporary object counter: 0
    Virtual Thread:
    kgskvt: 70000006e82cd98, sess: 70000006f5a5a50, vc: 0, proc: 70000006f4b1598
    consumer group cur: OTHER_GROUPS (upd? 0), mapped: DEFAULT_CONSUMER_GROUP, orig:
    vt_state: 0x200, vt_flags: 0x30, blkrun: 0
    is_assigned: 1, in_sched: 0 (0)
    vt_active: 0 (pending: 1)
    used quanta: 0 (cg: 0)
    cpu start time: 0, quantum status: 0x0
    quantum checks to skip: 0, check thresh: 0
    idle time: 0, active time: 0 (cg: 0)
    cpu yields: 0 (cg: 0), waits: 0 (cg: 0), wait time: 0 (cg: 0)
    queued time outs: 0, time: 0 (cur 0, cg 0)
    calls aborted: 0, num est exec limit hit: 0
    undo current: 0k max: 0k
    UOL used : 0 locks(used=2, free=0)
    KGX Atomic Operation Log 70000002eb54978
    Mutex 0(0, 0) idn 0 oper NONE
    Cursor Parent uid 113 efd 15 whr 22 slp 0
    oper=NONE pt1=0 pt2=0 pt3=0
    pt4=0 u41=0 stt=0
    KGX Atomic Operation Log 70000002eb549c0
    Mutex 0(0, 0) idn 0 oper NONE
    Library Cache uid 113 efd 0 whr 0 slp 0
    KGX Atomic Operation Log 70000002eb54a08
    Mutex 0(0, 0) idn 0 oper NONE
    Library Cache uid 113 efd 0 whr 0 slp 0
    SO: 70000006ae53108, type: 53, owner: 70000006f5a5a50, flag: INIT/-/-/0x00
    LIBRARY OBJECT LOCK: lock=70000006ae53108 handle=70000002e8e8150 mode=N
    call pin=0 session pin=0 hpc=0000 hlc=0000
    htl=70000006ae53188[70000006a753478,70000006abaf090] htb=70000006abaf090 ssga=70000006abae018
    user=70000006f5a5a50 session=70000006f5a5a50 count=1 flags=CBK[0020] savepoint=0x0
    LIBRARY OBJECT HANDLE: handle=70000002e8e8150 mtx=70000002e8e8280(0) cdp=0
    namespace=CRSR flags=RON/KGHP/PN0/EXP/[10010100]
    kkkk-dddd-llll=0000-0001-0001 lock=N pin=S latch#=4 hpc=0000 hlc=0000
    lwt=70000002e8e81f8[70000002e8e81f8,70000002e8e81f8] ltm=70000002e8e8208[70000002e8e8208,70000002e8e8208]
    pwt=70000002e8e81c0[70000002e8e81c0,70000002e8e81c0] ptm=70000002e8e81d0[70000002e8e81d0,70000002e8e81d0]
    ref=70000002e8e8228[70000004ad30028,70000004ad30028] lnd=70000002e8e8240[70000002e8e8240,70000002e8e8240]
    LIBRARY OBJECT: object=70000004ad2f990
    type=CRSR flags=EXS[0001] pflags=[0000] status=VALD load=0
    DEPENDENCIES: count=1 size=16
    AUTHORIZATIONS: count=1 size=16 minimum entrysize=16
    ACCESSES: count=1 size=16
    TRANSLATIONS: count=1 size=16
    DATA BLOCKS:
    data# heap pointer status pins change whr
    0 70000006eada130 70000004ad2faa8 I/P/A/-/- 0 NONE 00
    6 70000004ad2fec8 700000040f57a78 I/P/A/-/E 0 NONE 00
    ----------------------------------------

    Oracle handles dead lock by its own. but to resolve the issue u can try following things.
    1. take explain for UPDATE MGMT_OMS_PARAMETERS SET VALUE=TO_CHAR(SYSDATE, 'DD-Mon-YYYY HH24:MI:SS') WHERE HOST_URL=:B1 AND NAME='TIMESTAMP';
    2. analyze above explain plan and try to tune it.
    i think, its because of missing indexes.

  • Please help me regarding the running of a sql file

    Hi I downloaded one sql file from
    http://www.cs.uwf.edu/~sbagui/db/practical_oracle.htm
    But i am unable to run it successfully...please help me regarding this... thanking you
    Edited by: SowmyRaj on Dec 24, 2009 5:24 AM

    Hi vali thanks for your reply...
    I am using Windows XP sp2 Os.
    and Oracle database 11g ...
    when executing this file the follwing error is occuring
    Enter value for user_name: system
    old 2: uname VARCHAR(50) := '&user_name';
    new 2: uname VARCHAR(50) := 'system';
    **MOBILE CODE** immediate 'drop user ' ||uname;
    ERROR at line 13:
    ORA-06550: line 13, column 1:
    PLS-00103: Encountered the symbol "*" when expecting one of the following:
    ( begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    continue close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe purge

  • Want to feel like an Oracle god?  Help a confused student...please!

    I'm three hours from an assignment deadline, and I'm stuck on something so simple that I'm embarrassed to post it here, but I'm desperate.
    One of my lab assignments is to create a procedure that calculates the tax owed by passing in state and subtotal values, and returning the tax amount to a host variable (g_tax). Can someone look this code over and tell me why I keep getting the 'Bad Bind Variable' error (and whatever else they see that I'm doing wrong)?
    I would appreciate any help I can get.
    Thanks in advance,
    Diane
    SQL> SET SERVEROUTPUT ON
    SQL> VARIABLE g_tax NUMBER
    SQL> BEGIN
    2 :g_tax := 0;
    3 END;
    4 /
    PL/SQL procedure successfully completed.
    SQL> CREATE OR REPLACE PROCEDURE tax_cost_sp
    2 (p_state IN bb_basket.billstate%TYPE,
    3 p_subtotal IN bb_basket.subtotal%TYPE,
    4 p_tax OUT bb_basket.tax%TYPE)
    5 IS
    6 BEGIN
    7 :g_tax := (p_tax * p_subtotal);
    8 WHERE p_state = bb_basket.billstate
    9 --DBMS_OUTPUT.PUT_LINE('Tax for this order is $' :g_tax);
    10 END;
    11 /
    Warning: Procedure created with compilation errors.
    SQL> SHOW ERRORS
    Errors for PROCEDURE TAX_COST_SP:
    LINE/COL ERROR
    7/2 PLS-00049: bad bind variable 'G_TAX'
    8/5 PLS-00103: Encountered the symbol "WHERE" when expecting one of
    the following:
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted delimited-identifier>
    <a bind variable> << close current delete fetch lock insert
    open rollback savepoint set sql execute commit forall merge
    <a single-quoted SQL string> pipe
    10/1 PLS-00103: Encountered the symbol "END" when expecting one of the
    following:
    . ( * @ % & - + ; / at for mod rem <an exponent (**)> and or
    group having intersect minus order start union where connect
    ||
    SQL>

    Thanks, Tom. I removed the colon from in front of g_tax and that reduced my error count to only one. (These globals are going to be the death of me!)
    355099--thanks for your reply as well. In response to your question, the description for the bb_basket table an the data in the bb_tax table are provided below. I see where you are going with your question--it doesn't appear that I've made any correlation between the tax table and the basket table, hence my WHERE clause problem.
    I'll keep working here, but do appreciate your help.
    Diane
    SQL> CREATE OR REPLACE PROCEDURE tax_cost_sp
    2 (p_state IN bb_basket.billstate%TYPE,
    3 p_subtotal IN bb_basket.subtotal%TYPE,
    4 p_tax OUT bb_basket.tax%TYPE)
    5 IS
    6 BEGIN
    7 g_tax := (p_tax * p_subtotal)
    8 WHERE p_state = bb_basket.billstate;
    9 --DBMS_OUTPUT.PUT_LINE('Tax for this order is $' :g_tax);
    10 END;
    11 /
    Warning: Procedure created with compilation errors.
    SQL> show errors
    Errors for PROCEDURE TAX_COST_SP:
    LINE/COL ERROR
    8/5 PLS-00103: Encountered the symbol "WHERE" when expecting o
    the following:
    * & = - + ; < / > at in is mod not rem <an exponent (**)>
    <> or != or ~= >= <= <> and or like between overlaps || ye
    DAY_
    SQL> desc bb_basket
    Name
    IDBASKET
    QUANTITY
    IDSHOPPER
    ORDERPLACED
    SUBTOTAL
    TOTAL
    SHIPPING
    TAX
    DTCREATED
    PROMO
    SHIPFIRSTNAME
    SHIPLASTNAME
    SHIPADDRESS
    SHIPCITY
    SHIPSTATE
    SHIPZIPCODE
    SHIPPHONE
    SHIPFAX
    SHIPEMAIL
    BILLFIRSTNAME
    BILLLASTNAME
    BILLADDRESS
    BILLCITY
    BILLSTATE
    BILLZIPCODE
    BILLPHONE
    BILLFAX
    BILLEMAIL
    DTORDERED
    SHIPPROVINCE
    SHIPCOUNTRY
    BILLPROVINCE
    BILLCOUNTRY
    CARDTYPE
    CARDNUMBER
    EXPMONTH
    EXPYEAR
    CARDNAME
    SHIPBILL
    SQL> select * from bb_tax;
    IDSTATE ST TAXRATE
    1 VA .045
    2 NC .03
    3 SC .06
    SQL>

  • Popup content not displaying after doing a rollback using savepoint feature

    Hello everyone,
    I have a pop up window which has a taskflow embedded as a region. This taskflow has an activity which does the rolling back of changes done in the task flow using the restore save point feature.
    I have a cancel button on the pop up and it is bound to the cancel activity so that when the user clicks on the cancel button, the changes are discarded and the popup is closed(using a managed bean).
    I am able to discard the changes using this feature.
    My problem is when I try to invoke the same popup in the same session, only a very small panel window appears and nothing else.
    This happens only if I do the rollback feature. Just closing the pop up without any changes and reopening works.
    I tried several ways and can't find a solution to this problem. Can any one help ?
    thanks
    AC
    Edited by: user723140 on Nov 25, 2008 1:27 PM

    Hi,
    restore to savepoints happens when you exit the bounded taskflow with a return. So in your case you are actually closing the taskflow, which is not what you should do in a region. This is why it comes up empty. What you can try is to
    - set the popup loading to lazyUncached
    - set the refresh on the region container to ifNeeded
    - set the refresh condition to some value reference that changes with each call to region (e.g. a managed bean that returns the time in ms)
    Not sure if this will re-create the taskflow, but chances are that it does
    Frank

  • How to create a savepoint in "BC4J transaction" from a struts Action

    Hello,
    I need to create a kind of savepoint in a transaction object in BC4J
    [    BC4JContext context = BC4JContext.getContext(request);
    context.getApplicationModule().getTransaction()."savepoint()" ]
    but it seems to me that it doesn't exist!!
    How can I do this.
    Thanks for help
    Mehdi

    Mehdi:
    BC4J does not support creation of savepoints in its transaction object. Savepoint support is quite tricky in that if we were to support it... If the transaction is rolled back to the SP, we would have to sync the cache back to the state when the SP was taken. And, this can be quite an expensive operation.
    Thanks.
    Sung

  • The import java.sql.Savepoint cannot be resolved

    i am unable how to resolve this problem please anyone can help me about this

    Which version of Java are you using? Class java.sql.Savepoint was introduced in version 1.4. If you're using an older version, it won't work.

  • Error in cursor help me out

    hi,
    i have error at the cursor at the end and can u tell me is the pacakage correct which i have written can any one change as per the syntax and to get the correct out put
    create or replace
    PACKAGE BODY SF_CSD_CreateOrder
    AS
    G_PKG_NAME CONSTANT VARCHAR2(30) :='SF_CSD_CreateOrder';
    PROCEDURE Create_Order
    p_api_version_number IN NUMBER,
    p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
    p_commit IN VARCHAR2 := FND_API.G_FALSE,
    x_return_status OUT NOCOPY VARCHAR2,
    x_msg_count OUT NOCOPY NUMBER,
    x_msg_data OUT NOCOPY VARCHAR2,
    p_order_rec IN ORDER_HDR_REC,
    p_order_lines IN ORDER_LINE_REC_TBL )
    IS
    l_api_name CONSTANT VARCHAR2(30) := 'Create_Order';
    l_api_version_number CONSTANT NUMBER := 1.0;
    lx_incident_id NUMBER(10);
    lx_incident_number VARCHAR2(50);
    lx_return_status VARCHAR2(1);
    lx_msg_count NUMBER(10);
    lx_msg_data VARCHAR2(2000);
    l_incident_id NUMBER;
    l_repair_line_id NUMBER;
    l_repair_number NUMBER;
    x_ro_status VARCHAR2;
    xl_return_status VARCHAR2(1);
    xl_msg_count NUMBER;
    xl_msg_data VARCHAR2(2000);
    l_order_line_id NUMBER;
    l_order_header_id NUMBER;
    xx_return_status VARCHAR2(1);
    xx_msg_count NUMBER;
    xx_msg_data VARCHAR2(2000);
    BEGIN
    -- Standard Start of API savepoint
    SAVEPOINT Create_Order;
    -- Standard call to check for call compatibility.
    IF NOT FND_API.Compatible_API_Call(l_api_version_number, p_api_version_number, l_api_name, G_PKG_NAME) THEN
    RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
    END IF;
    -- Initialize message list if p_init_msg_list is set to TRUE.
    IF FND_API.to_Boolean(p_init_msg_list) THEN
    FND_MSG_PUB.initialize;
    END IF;
    -- Initialize API return status to success
    x_return_status := FND_API.G_RET_STS_SUCCESS;
    -- call SF_CSD_CREATEORDER_UTIL.Create_SR
    -- this outputs incident_id (l_incident_id)
    l_createsr_rec :=SF_CSD_CREATEORDER_UTIL.CREATESR_REC;
    l_sr_notes_tbl :=cs_servicerequest_pub.notes_table;
    l_createsr_rec.party_id :=p_order_rec.party_id;
    l_createsr_rec.cust_account_id :=p_order_rec.cust_account_id;
    SF_CSD_CREATEORDER_UTIL.create_sr (
    P_createsr_rec =>l_createsr_rec,
    P_sr_notes_tbl =>l_sr_notes_tbl,
    X_incident_id =>lx_incident_id,
    X_incident_number =>lx_incident_number,
    X_return_status =>lx_return_status,
    X_msg_count =>lx_msg_count,
    X_msg_data =>lx_msg_data
    l_incident_id :=lx_incident_id;
    l_order_lines :=SF_CSD_CreateOrder.ORDER_LINE_REC_TBL;
    FOR I IN l_order_line
    LOOP
    --- Use the incidentid returned by the above call (l_incident_id)
    -- Create RO
    l_createro_rec :=SF_CSD_CREATEORDER_UTIL.CREATERO_REC;
    l_createro_rec.INVENTORY_ITEM_ID :=p_order_lines.inventory_item_id;
    l_createro_rec.SERIAL_NUMBER :=p_order_lines.serial_number;
    l_createro_rec.PROBLEM_DESCRIPTION :=p_order_lines.PROBLEM_DESCRIPTION;
    SF_CSD_CREATEORDER_UTIL.create_ro (
    p_CREATERO_REC =>l_createro_rec,
    x_repair_line_id =>l_repair_line_id,
    x_repair_number =>l_repair_number,
    x_ro_status => x_ro_status,
    x_return_status => xl_return_status,
    x_msg_count => xl_msg_count,
    x_msg_data =>xl_msg_data
    -- Call SF_CSD_CREATEORDER_UTIL.Create_repair_order
    --- This outputs repair line id.(l_repair_line_id)
    l_repair_line_id :=lx_repair_line_id;
    l_auto_rcv :=SF_CSD_CREATEORDER_UTIL.AUTORCV_REC;
    CURSOR c_get_rma(p_repair_line_id) IS
    SELECT cpt.order_line_id,
    cpt.ORDER_HEADER_ID
    FROM csd_product_transactions cpt,
    csd_repairs cr
    WHERE cpt.repair_line_id=p_repair_line_id
    AND cr.repair_line_id= cpt.repair_line_id
    AND cpt.action_type='RMA';
    l_order_line_id :=null;
    l_order_header_id :=null;
    OPEN c_get_rma(l_auto_rcv.REPAIR_LINE_ID);
    FETCH c_get_rma INTO l_order_line_id, l_order_header_id;
    CLOSE c_get_rma;
    l_auto_rcv.REPAIR_LINE_ID :=l_repair_line_id;
    l_auto_rcv.ORDER_LINE_ID := l_order_line_id;
    l_auto_rcv.ORDER_HEADER_ID := l_order_header_id;
    SF_CSD_CREATEORDER_UTIL.auto_receive (
    p_autorcv_tbl => l_auto_rcv,
    x_return_status => xx_return_status,
    x_msg_count => xx_msg_count,
    x_msg_data => xx_msg_data );
    -- Get the order line id for the RMA created above. use query to select from csd_product_txns table.
    -- Select order_line_id from csd_product_txns where repair_line_Id = l_repair_line_id and action_type = 'RMA'
    --- Call SF_CSD_CREATEORDER_UTIL.Auto_receive to receive the item for the rma created above
    END LOOP;
    END;
    END SF_CSD_CreateOrder;

    hi this is the latest code plzzz help me i am new to PL/SQL
    create or replace
    PACKAGE BODY SF_CSD_CreateOrder
    AS
    G_PKG_NAME CONSTANT VARCHAR2(30) :='SF_CSD_CreateOrder';
    PROCEDURE Create_Order
    p_api_version IN NUMBER,
    p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
    p_commit IN VARCHAR2 := FND_API.G_FALSE,
    x_return_status OUT NOCOPY VARCHAR2,
    x_msg_count OUT NOCOPY NUMBER,
    x_msg_data OUT NOCOPY VARCHAR2,
    p_order_rec IN ORDER_HDR_REC,
    p_order_lines IN ORDER_LINE_REC_TBL)
    IS
    l_api_name CONSTANT VARCHAR2(30) := 'Create_Order';
    l_api_version_number CONSTANT NUMBER := 1.0;
    /*lx_incident_id NUMBER(10);
    lx_incident_number VARCHAR2(50);
    lx_return_status VARCHAR2(1);
    lx_msg_count NUMBER(10);
    lx_msg_data VARCHAR2(2000);
    l_incident_id NUMBER;
    l_repair_line_id NUMBER;
    l_repair_number NUMBER;
    xx_ro_status VARCHAR2(1);
    xl_return_status VARCHAR2(1);
    xl_msg_count NUMBER;
    xl_msg_data VARCHAR2(2000);
    xx_return_status VARCHAR2(1);
    xx_msg_count NUMBER;
    xx_msg_data VARCHAR2(2000);*/
    l_order_line_id NUMBER;
    l_order_header_id NUMBER;
    l_incident_id NUMBER;
    l_order_line ORDER_LINE_REC_TBL;
    l_createsr_rec SF_CSD_CREATEORDER_UTIL.CREATESR_REC;
    l_sr_notes_tbl cs_servicerequest_pub.notes_table;
    l_order_lines SF_CSD_CreateOrder.ORDER_LINE_REC_TBL;
    CURSOR c_get_rma(p_repair_line_id NUMBER) IS
    SELECT cpt.order_line_id,
    cpt.ORDER_HEADER_ID
    FROM csd_product_transactions cpt,
    csd_repairs cr
    WHERE cpt.repair_line_id=p_repair_line_id
    AND cr.repair_line_id= cpt.repair_line_id
    AND cpt.action_type='RMA';
    BEGIN
    -- Standard Start of API savepoint
    SAVEPOINT Create_Order;
    -- Standard call to check for call compatibility.
    IF NOT FND_API.Compatible_API_Call(l_api_version_number, p_api_version, l_api_name,G_PKG_NAME) THEN
    RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
    END IF;
    -- Initialize message list if p_init_msg_list is set to TRUE.
    IF FND_API.to_Boolean(p_init_msg_list) THEN
    FND_MSG_PUB.initialize;
    END IF;
    -- Initialize API return status to success
    x_return_status := FND_API.G_RET_STS_SUCCESS;
    -- call SF_CSD_CREATEORDER_UTIL.Create_SR
    -- this outputs incident_id (l_incident_id)
    l_createsr_rec.party_id :=p_order_rec.party_id;
    l_createsr_rec.cust_account_id :=p_order_rec.cust_account_id;
    SF_CSD_CREATEORDER_UTIL.create_sr (
    p_createsr_rec =>l_createsr_rec,
    p_sr_notes_tbl =>l_sr_notes_tbl,
    x_incident_id =>X_incident_id,
    x_incident_number =>X_incident_number,
    x_return_status =>X_return_status,
    x_msg_count =>X_msg_count,
    x_msg_data =>X_msg_data
    l_incident_id :=x_incident_id;
    FOR I IN l_order_line
    LOOP
    --- Use the incidentid returned by the above call (l_incident_id)
    -- Create RO
    l_createro_rec :=SF_CSD_CREATEORDER_UTIL.CREATERO_REC;
    l_createro_rec.INVENTORY_ITEM_ID :=p_order_lines.inventory_item_id;
    l_createro_rec.SERIAL_NUMBER :=p_order_lines.serial_number;
    l_createro_rec.PROBLEM_DESCRIPTION :=p_order_lines.PROBLEM_DESCRIPTION;
    SF_CSD_CREATEORDER_UTIL.create_ro (
    p_CREATERO_REC =>l_createro_rec,
    x_repair_line_id =>x_repair_line_id,
    x_repair_number =>x_repair_number,
    x_ro_status => x_ro_status,
    x_return_status => x_return_status,
    x_msg_count => x_msg_count,
    x_msg_data =>x_msg_data
    -- Call SF_CSD_CREATEORDER_UTIL.Create_repair_order
    --- This outputs repair line id.(l_repair_line_id)
    l_repair_line_id :=x_repair_line_id;
    l_auto_rcv :=SF_CSD_CREATEORDER_UTIL.AUTORCV_REC;
    l_order_line_id :=null;
    l_order_header_id :=null;
    OPEN c_get_rma(l_auto_rcv.REPAIR_LINE_ID);
    FETCH c_get_rma INTO l_order_line_id, l_order_header_id;
    CLOSE c_get_rma;
    l_auto_rcv.REPAIR_LINE_ID :=l_repair_line_id;
    l_auto_rcv.ORDER_LINE_ID := l_order_line_id;
    l_auto_rcv.ORDER_HEADER_ID := l_order_header_id;
    SF_CSD_CREATEORDER_UTIL.auto_receive (
    p_autorcv_tbl => l_auto_rcv,
    x_return_status => x_return_status,
    x_msg_count => x_msg_count,
    x_msg_data => x_msg_data );
    -- Get the order line id for the RMA created above. use query to select from csd_product_txns table.
    -- Select order_line_id from csd_product_txns where repair_line_Id = l_repair_line_id and action_type = 'RMA'
    --- Call SF_CSD_CREATEORDER_UTIL.Auto_receive to receive the item for the rma created above
    END LOOP;
    END;
    END SF_CSD_CreateOrder;
    Error(72,17): PLS-00201: identifier 'X_INCIDENT_ID' must be declared
    Error(79,17): PLS-00201: identifier 'X_INCIDENT_ID' must be declared
    Error(80,10): PLS-00456: item 'L_ORDER_LINE' is not a cursor
    plzzz can anyone give the code without errors
    plz help me its urgent

  • ORA-55714: savepoint savepoint disabled with interleaved changes across..

    We have a PL/SQL program that is called by OAF page and has savepoint logic used in it.
    We are getting the below error when we call the OAF page.
    ***Error***
    ***ORA-01086: savepoint 'START_ATP' never established in this session or is invalid ORA-06512: at "APPS.XXMRPAVAIL", line 1061 ORA-55714: savepoint 'START_CALL_ATP' disabled with interleaved changes across Oracle RAC instances***
    Below is the sample logic which we have written.
    SAVEPOINT start_call_atp ;
    MRP_ATP_PUB.Call_ATP_no_commit
    (l_session_id,
    l_atp_rec,
    x_atp_rec ,
    x_atp_supply_demand ,
    x_atp_period,
    x_atp_details,
    x_return_status,
    x_msg_data,
    x_msg_count
    ROLLBACK TO start_call_atp ;
    Let me know for any additional information. Thanks in advance for your help.

    Please find the complete code below.
    PROCEDURE Call_ATP (p_sequence_id IN NUMBER
    ,p_requested_ship_date IN DATE
    ,p_mfg_source_code_list IN VARCHAR2
    ,p_plan_name IN VARCHAR2
    ,p_requested_quantity IN NUMBER DEFAULT 100000000
    ,p_debug_flag IN VARCHAR2 DEFAULT 'N'
    ,p_week_no IN NUMBER DEFAULT 0
    ,p_prodFamily_clause IN VARCHAR2
    ,p_typetabatp IN typetabatp_g          
    IS
    -- If profile MSC: ATP Debug = Debug and Database Trace, it will only provide the Debug session file
    -- So if tracing is desired, then Remove the -- from the 'ALTER SESSION ...' line below.
    -- ALSO remove -- from 'ALTER SESSION ...' statement at the end of this file that turns trace off.
    -- If you fail to turn off the trace then the resulting trace file cannot be analyzed properly
    -- ALTER SESSION SET EVENTS = '10046 TRACE NAME CONTEXT FOREVER, LEVEL 12' ;
    lv_program_name VARCHAR2(150) := gv_package_name || '.Call_ATP' ;
    lv_message VARCHAR2(4000) ;
    lv_resource_org_id NUMBER;
    lv_resource_org_code VARCHAR(100);
    l_atp_rec MRP_ATP_PUB.ATP_Rec_Typ;
    p_atp_rec MRP_ATP_PUB.ATP_Rec_Typ;
    x_atp_rec MRP_ATP_PUB.ATP_Rec_Typ;
    x_atp_supply_demand MRP_ATP_PUB.ATP_Supply_Demand_Typ;
    x_atp_period MRP_ATP_PUB.ATP_Period_Typ;
    x_atp_details MRP_ATP_PUB.ATP_Details_Typ;
    x_return_status VARCHAR2(2000);
    x_msg_data VARCHAR2(500);
    x_msg_count NUMBER;
    l_session_id NUMBER;
    l_error_message VARCHAR2(250);
    x_error_message VARCHAR2(80);
    v_file_dir VARCHAR2 (80);
    i NUMBER := 0;
    ln_quantity NUMBER := p_requested_quantity;
    ld_request_ship_date DATE := p_requested_ship_date;
    ln_instance_id NUMBER;
    TYPE TypCurRef IS REF CURSOR ;
    CurRef TypCurRef ;
    lv_Cur VARCHAR2(32767) ;
    atp_details_tab TypRecATPDetails;
    atp_details_rec MRP_ATP_PUB.ATP_Rec_Typ;
    lv_rep_item VARCHAR2(40);
    lv_rep_item_id NUMBER;
    lv_user_id NUMBER;
    TYPE TypRecCur IS RECORD
    (inventory_item_id NUMBER
    ,ItemNo VARCHAR2(30)
    ,source_whse_code VARCHAR2(30)
    ,source_organization_id NUMBER
    ,family VARCHAR2(150)
    ,demand_class VARCHAR2(30)
    ,family_order_by NUMBER
    RecCur TypRecCur ;
    ln_plan_id NUMBER ;
    k NUMBER ;
    s NUMBER := 0 ;
    lv_prodFamily_clause VARCHAR2(32767);
    BEGIN
    SAVEPOINT start_ATP ;
    lv_user_id := fnd_profile.value('USER_ID');
    SELECT plan_id
    INTO
    ln_plan_id
    FROM msc_plans@APS_DBLINK
    WHERE compile_designator = p_plan_name ;
    SELECT MAX(instance_id)
    INTO
    ln_instance_id
    FROM apps.mrp_ap_apps_instances_all
    WHERE NVL(a2m_dblink, 'APS_DBLINK') = 'APS_DBLINK';
    MSC_ATP_GLOBAL.Extend_ATP(l_atp_rec, x_return_status, 1);
    FOR x IN p_typetabatp.first .. p_typetabatp.last
    LOOP
    lv_rep_item := NULL;
    lv_rep_item_id := NULL;
    BEGIN
    SELECT rep.rep_item,msib.inventory_item_id
    INTO lv_rep_item, lv_rep_item_id
    FROM xxmrp_ctp_rep_items rep,
    mtl_system_items_b msib,
         org_organization_definitions ood
    WHERE rep.plant_code = p_typetabatp(x).source_whse_code
    AND rep.prod_family = p_typetabatp(x).Family
         AND msib.segment1 = rep.rep_item
         AND msib.organization_id = ood.organization_id
         AND ood.organization_code = rep.plant_code;
    EXCEPTION
    WHEN OTHERS THEN
    lv_rep_item := NULL;
    lv_rep_item_id := NULL;
    END;
    SELECT OE_ORDER_SCH_UTIL.Get_Session_Id
    INTO l_session_id
    FROM dual;
    IF p_debug_flag <> 'N' THEN
    order_sch_wb.mr_debug := 'Y' ;
    order_sch_wb.file_or_terminal := 1 ;
    order_sch_wb.debug_session_id := l_session_id;
    FND_PROFILE.put('MSC_ATP_DEBUG', 'C');
    SELECT xxau_util.getDefaultDirectory
    INTO v_file_dir
    FROM dual ;
    order_sch_wb.file_dir := v_file_dir ;
    END IF;
    i := 1;
    s := s + 1 ;
    l_atp_rec.identifier(i) := -TO_NUMBER(TO_CHAR(p_sequence_id) || TO_CHAR(p_week_no) || TO_CHAR(s)) ;
    l_atp_rec.Inventory_Item_Id(i) := nvl(lv_rep_item_id,p_typetabatp(x).Inventory_Item_Id) ;
    l_atp_rec.vendor_name(i) := p_typetabatp(x).Family ;
    l_atp_rec.Inventory_Item_Name(i) := NVL(lv_rep_item,p_typetabatp(x).ItemNo);
    l_atp_rec.Quantity_Ordered(i) := ln_quantity;
    l_atp_rec.Quantity_UOM(i) := 'Ea';
    l_atp_rec.Requested_Ship_Date(i) := p_requested_ship_date;
    l_atp_rec.Action(i) := 100; --ATP inquiry
    l_atp_rec.Source_Organization_Id(i) := p_typetabatp(x).source_organization_id ;
    l_atp_rec.OE_Flag(i) := 'N';
    l_atp_rec.Insert_Flag(i) := 0;
    l_atp_rec.Customer_Id(i) := null;
    l_atp_rec.Customer_Site_Id(i) := null;
    l_atp_rec.Calling_Module(i) := null;
    l_atp_rec.Row_Id(i) := null;
    l_atp_rec.Source_Organization_Code(i) := null;
    l_atp_rec.Organization_Id(i) := null;
    --l_atp_rec.demand_class(i)              := RecCur.demand_class;
    l_atp_rec.demand_class(i) := p_typetabatp(x).demand_class;
    l_error_message := null;
    SAVEPOINT start_call_atp ;
    MRP_ATP_PUB.Call_ATP_no_commit
    (l_session_id,
    l_atp_rec,
    x_atp_rec ,
    x_atp_supply_demand ,
    x_atp_period,
    x_atp_details,
    x_return_status,
    x_msg_data,
    x_msg_count
    ROLLBACK TO start_call_atp ;
    IF (x_return_status = 'S') THEN
    IF x_atp_rec.Inventory_item_id.count > 0 THEN
    --============ Show capacity even if there is no supply/demand =======================================
    FOR j IN 1..x_atp_rec.Inventory_item_id.count
    LOOP
    lv_resource_org_id := xxmrpavail.get_resource_org_id (x_atp_rec.Source_Organization_Id(j));
    --lv_resource_org_code := xxmrpavail.get_resource_org_id (x_atp_rec.Source_Organization_Id(j));
    IF SQL%ROWCOUNT = 0 THEN
    IF atp_details_rec.Source_Organization_Id.count > 0 THEN
    NULL;
    ELSE
    MSC_ATP_GLOBAL.Extend_ATP(atp_details_rec, x_return_status, 1);
    END IF;
    atp_details_rec.Source_Organization_Id(atp_details_rec.Source_Organization_Id.count) := x_atp_rec.Source_Organization_Id(j) ;
    atp_details_rec.vendor_name(atp_details_rec.vendor_name.count) := x_atp_rec.vendor_name(j) ;
    atp_details_rec.Requested_Date_Quantity(atp_details_rec.Requested_Date_Quantity.count) := x_atp_rec.Requested_Date_Quantity(j) ;
    atp_details_rec.Error_Code(atp_details_rec.Error_Code.count) := x_atp_rec.Error_Code(j) ;
    atp_details_rec.Inventory_Item_Name(atp_details_rec.Inventory_Item_Name.count) := x_atp_rec.Inventory_Item_Name(j) ;
    END IF;
    END LOOP;
    IF atp_details_rec.Inventory_Item_Name.count > 0 THEN
    --custom logic
    END IF;
    END IF;
    ELSE
    RAISE e_ErrATP ;
    END IF; -- after calling api
    l_error_message := '';
    l_session_id := '' ;
    x_return_status := '' ;
    x_msg_data := '' ;
    x_msg_count := '' ;
    END LOOP; -- main loop
    EXCEPTION
    WHEN e_ErrATP THEN
    --IF CurRef%ISOPEN THEN CLOSE CurRef ; END IF;
    IF x_atp_rec.Error_Code.count > 0 AND (x_atp_rec.Error_Code(1) <> 0) THEN
    SELECT meaning
    INTO x_error_message
    FROM mfg_lookups
    WHERE lookup_type = 'MTL_DEMAND_INTERFACE_ERRORS'
    AND lookup_code = x_atp_rec.Error_Code(1);
    lv_message := lv_message || x_error_message ;
    END IF;
    xxau_util.log(lv_program_name, 'SQLERROR', lv_message, xxau_util.c_TraceLevelException) ;
    raise_application_error(c_ErrATP,'ERROR: ' || lv_program_name || ': ' || lv_message) ;
    WHEN OTHERS THEN
    --IF CurRef%ISOPEN THEN CLOSE CurRef ; END IF;
    ROLLBACK TO start_ATP;
    lv_message := lv_message || substr(SQLERRM,1,4000) ;
    xxau_util.log(lv_program_name, 'SQLERROR', lv_message, xxau_util.c_TraceLevelException) ;
    raise_application_error(c_ErrGeneric,'ERROR: ' || lv_program_name || ': ' || lv_message) ;
    END Call_ATP;

  • Help in OPen Cursor select

    Hi,Anyone please help me in this code to rectify errors

    Hi,
    DECLARE
      ERRBUF VARCHAR2(200);
      RETCODE NUMBER;
      P_FROMDATE DATE;
      P_TODATE DATE;
      X_RETURN_STATUS VARCHAR2(200);
      X_MSG_COUNT NUMBER;
      X_MSG_DATA VARCHAR2(200);
    BEGIN
    --  P_FROMDATE :='2010-02-01';
    --  P_TODATE :='2010-03-20';
      XXTNT_CSD_CREATEORDER.SUBMIT_CREATE_ORDER(
        P_FROMDATE => '01-FEB-2010',
        P_TODATE => '20-MAR-2010',
        X_RETURN_STATUS => X_RETURN_STATUS,
        X_MSG_COUNT => X_MSG_COUNT,
        X_MSG_DATA => X_MSG_DATA
    --  DBMS_OUTPUT.PUT_LINE('ERRBUF = ' || ERRBUF);
    --  DBMS_OUTPUT.PUT_LINE('RETCODE = ' || RETCODE);
      DBMS_OUTPUT.PUT_LINE('X_RETURN_STATUS = ' || X_RETURN_STATUS);
      DBMS_OUTPUT.PUT_LINE('X_MSG_COUNT = ' || X_MSG_COUNT);
      DBMS_OUTPUT.PUT_LINE('X_MSG_DATA = ' || X_MSG_DATA);
    END;
    before header query..
    after header query..
    X_RETURN_STATUS = S
    X_MSG_COUNT =
    X_MSG_DATA = why the code is executing up to that line
    PROCEDURE submit_Create_order(--errbuf OUT VARCHAR2,
                                    --retcode OUT NUMBER,
                                    p_fromDate IN date,
                                    p_toDate IN date,
                                    x_return_status OUT NOCOPY VARCHAR2,
                                    x_msg_count OUT NOCOPY     NUMBER,
                                    x_msg_data OUT NOCOPY      VARCHAR2) as
    CURSOR C_GET_HDR_DATA (p_fromDate IN date,p_toDate IN date)
                                            IS
        SELECT A.TRACKING_NUMBER,
          B.CUST_ACCOUNT_ID,
          B.PARTY_ID,
          A.INCIDENT_NUMBER,
          C.INCIDENT_ID,
          A.CUST_PO_NUMBER,
          A.SHIP_METHOD_CODE,
          A.CARRIER_NAME,
          A.CREATION_DATE
        FROM XXTNT_CSD_INBOUND_TRACKING A,
          HZ_CUST_ACCOUNTS B,
          CS_INCIDENTS_ALL C
        WHERE A.CREATION_DATE between to_date(p_fromDate,'DD-MON-YYYY')
        AND to_date(p_toDate,'DD-MON-YYYY')
        AND B.ACCOUNT_NUMBER(+)    = A.ACCOUNT_NUMBER
        --AND a.source='external'
        AND A.INCIDENT_NUMBER   = C.INCIDENT_NUMBER(+)
        AND EXISTS
          (SELECT 'x'
          FROM xxtnt_csd_inbound_ord_lines_b C
          WHERE C.TRACKING_NUMBER = a.tracking_number
          AND repair_line_id     IS NULL
      l_hdr_rec         ORDER_HDR_REC;
      l_lines_Tbl       ORDER_LINE_REC_TBL;
      l_lines_tbl_tbl   ORDER_LINE_REC_TBL_TBL;
      l_index           NUMBER;
      l_ret_status      VARCHAR2(10);
      l_msg_count       NUMBER;
      l_incident_number VARCHAR2(64);
      l_incident_id     NUMBER;
      l_msg_data        VARCHAR2(2000);
      l_api_name        CONSTANT VARCHAR2(30) := 'submt_Create_order';
      l_curr_po         VARCHAR2(80);
      l_prev_po         VARCHAR2(80);
      l_hdr_po          VARCHAR2(80);
      l_super_index     NUMBER;
      l_super_index1    NUMBER;
      l_line_count      NUMBER;
      l_tracking_num varchar2(80);
      TYPE c_Get_Line_data IS REF CURSOR;
      r_Get_Line_data c_Get_Line_data;
    BEGIN
      SAVEPOINT submit_Create_Order;
      x_return_status             := FND_API.G_RET_STS_SUCCESS;
      IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
        fnd_log.STRING (fnd_log.level_procedure, 'CSD.PLSQL.XXTNT_CSD_CREATEORDER.SUBMIT_CREATE_ORDER.BEGIN', 'Enter - Submit_Create_order');
      END IF;
      --mo_global.set_policy_context('S', 81);
        dbms_output.put_line('before header query..');
      OPEN C_GET_HDR_DATA (p_fromDate,p_toDate) ;
      FETCH C_GET_HDR_DATA
      INTO l_hdr_Rec.Tracking_number,
        l_hdr_Rec.cust_account_id,
        l_hdr_Rec.party_id,
        l_hdr_Rec.incident_number,
        l_hdr_Rec.incident_id,
        l_hdr_rec.Customer_po_number,
        l_hdr_rec.SHIP_METHOD_CODE,
        l_hdr_Rec.CARRIER_NAME,
        l_hdr_Rec.CREATION_DATE;
        l_tracking_num :=l_hdr_Rec.Tracking_number;
        *dbms_output.put_line('after header query..');*
      CLOSE C_GET_HDR_DATA;
      IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
        fnd_log.STRING (fnd_log.level_statement, 'CSD.PLSQL.XXTNT_CSD_CREATEORDER.SUBMIT_CREATE_ORDER', 'trackingnumber['||l_hdr_Rec.Tracking_number||']');
        fnd_log.STRING (fnd_log.level_statement, 'CSD.PLSQL.XXTNT_CSD_CREATEORDER.SUBMIT_CREATE_ORDER', 'cust_account['||l_hdr_Rec.cust_account_id||']');
        fnd_log.STRING (fnd_log.level_statement, 'CSD.PLSQL.XXTNT_CSD_CREATEORDER.SUBMIT_CREATE_ORDER', 'party_id['||l_hdr_Rec.party_id||']');
      END IF;
      IF( l_hdr_rec.tracking_number IS NOT NULL) THEN
        l_index                     := 1;
        l_super_index               := 1;
        l_prev_po                   := nvl(l_hdr_rec.customer_po_number,'0');
        l_hdr_po                    := nvl(l_hdr_rec.customer_po_number,'0');
        l_super_index1              := 1;
        l_line_count                := 0;
        dbms_output.put_line('before  line query loop..');
        Open r_Get_Line_data for
    SELECT A.ORDER_LINE_ID ORDER_LINE_ID, A.CUSTOMER_REF_NUMBER CUSTOMER_REF_NUMBER,
                  A.INVENTORY_ITEM_ID INVENTORY_ITEM_ID, A.SERIAL_NUMBER SERIAL_NUMBER,
                  A.UNIT_OF_MEASURE UNIT_OF_MEASURE,
                  A.repair_type_id repair_type_id, A.REPAIR_ORG_ID REPAIR_ORG_ID,
                  A.WARRANTY_FLAG WARRANTY_FLAG, A.WARRANTY_EXP_DATE WARRANTY_EXP_DATE,
                  A.VENDOR_WARRANTY_FLAG VENDOR_WARRANTY_FLAG, A.VENDOR_WARRANTY_EXP_DATE VENDOR_WARRANTY_EXP_DATE,
                  A.PRIMARY_VENDOR PRIMARY_VENDOR, A.SECONDARY_VENDOR SECONDARY_VENDOR,
                  A.NORTEL_WARRANTY_FLAG NORTEL_WARRANTY_FLAG, A.NORTEL_WARRANTY_EXP_DATE NORTEL_WARRANTY_EXP_DATE,
                  A.SCRAP_DEFECTIVE_ITEM SCRAP_DEFECTIVE_ITEM, A.INVENTORY_ORG_ID INVENTORY_ORG_ID,
                  A.SUB_INVENTORY SUB_INVENTORY, B.INCIDENT_ID INCIDENT_ID,
                  A.repair_quantity repair_quantity, a.problem_description problem_description,
                  a.same4same_flag, A.CTRACS_CONTRACT_FLAG CTRACS_CONTRACT_FLAG,
                  A.CONTRACT_LINE_ID CONTRACT_LINE_ID, nvl(A.CUST_PO_NUMBER, C.CUST_PO_NUMBER) CUST_PO_NUMBER,
                  A.REV_IN,  A.WARRANTY_QUANTITY FROM xxtnt_csd_inbound_ord_lines_vl A,
                  CS_INCIDENTS_ALL B,  XXTNT_CSD_INBOUND_TRACKING C 
                  WHERE A.TRACKING_NUMBER = l_tracking_num
                   AND A.INCIDENT_NUMBER   = B.INCIDENT_NUMBER(+)
                   AND A.REPAIR_LINE_ID is NULL AND nvl(A.DISCREP_FLAG,'N') != 'Y'
                   AND C.TRACKING_NUMBER = A.TRACKING_NUMBER ORDER BY CUST_PO_NUMBER;
        LOOP
          l_line_count := l_line_count + 1;
          l_curr_po := nvl(l_lines_tbl_tbl(l_super_index)(l_super_index1).CUSTOMER_PO_NUMBER,l_hdr_po);
          if(l_curr_po <> l_prev_po) then
               if(l_super_index1 <> 1) then
                    l_super_index := l_super_index +1;
                    l_super_index1 := 1;
               end if;
               l_prev_po     := l_curr_po;
          end if;
    FETCH r_Get_Line_data INTO
         l_lines_tbl_tbl(l_super_index)(l_super_index1).LINE_ID,
                    l_lines_tbl_tbl(l_super_index)(l_super_index1).CUSTOMER_REF_NUMBER,
                    l_lines_tbl_tbl(l_super_index)(l_super_index1).INVENTORY_ITEM_ID,
                    l_lines_tbl_tbl(l_super_index)(l_super_index1).SERIAL_NUMBER,
                    l_lines_tbl_tbl(l_super_index)(l_super_index1).UNIT_OF_MEASURE,
                    l_lines_tbl_tbl(l_super_index)(l_super_index1).repair_type_id,
                    l_lines_tbl_tbl(l_super_index)(l_super_index1).REPAIR_ORG_ID,
                    l_lines_tbl_tbl(l_super_index)(l_super_index1).TELMAR_WARRANTY_FLAG,
                    l_lines_tbl_tbl(l_super_index)(l_super_index1).TELMAR_WARRANTY_EXP_DATE,
                    l_lines_tbl_tbl(l_super_index)(l_super_index1).VENDOR_WARRANTY_FLAG,
                    l_lines_tbl_tbl(l_super_index)(l_super_index1).VENDOR_WARRANTY_EXP_DATE,
                    l_lines_tbl_tbl(l_super_index)(l_super_index1).PRIMARY_VENDOR,
                    l_lines_tbl_tbl(l_super_index)(l_super_index1).SECONDARY_VENDOR,
                    l_lines_tbl_tbl(l_super_index)(l_super_index1).NORTEL_WARRANTY_FLAG,
                    l_lines_tbl_tbl(l_super_index)(l_super_index1).NORTEL_WARRANTY_EXP_DATE,
                    l_lines_tbl_tbl(l_super_index)(l_super_index1).SCRAP_DEFECTIVE_ITEM,
                    l_lines_tbl_tbl(l_super_index)(l_super_index1).INVENTORY_ORG_ID,
                    l_lines_tbl_tbl(l_super_index)(l_super_index1).SUB_INVENTORY,
                    l_lines_tbl_tbl(l_super_index)(l_super_index1).INCIDENT_ID,
                    l_lines_tbl_tbl(l_super_index)(l_super_index1).repair_quantity,
                    l_lines_tbl_tbl(l_super_index)(l_super_index1).problem_description,
                    l_lines_tbl_tbl(l_super_index)(l_super_index1).s4s_flag,
                    l_lines_tbl_tbl(l_super_index)(l_super_index1).CTRACS_CONTRACT_FLAG,
                    l_lines_tbl_tbl(l_super_index)(l_super_index1).CONTRACT_LINE_ID,
                    l_lines_tbl_tbl(l_super_index)(l_super_index1).CUSTOMER_PO_NUMBER,
                    l_lines_tbl_tbl(l_super_index)(l_super_index1).REV_IN,
                    l_lines_tbl_tbl(l_super_index)(l_super_index1).WARRANTY_QUANTITY;
          l_super_index1                                := l_super_index1 + 1;
        END LOOP;
        dbms_output.put_line('after  line query loop..');

  • HELP!!! Problems in using PostgreSQL in jdk1.4.2

    Hi,
    Can anybody help me with my problem. i am using jdk1.4.2 and have a database connection with PostgreSQL Driver. I have connection to the Driver using the following code.
    Class.forName("org.postgresql.Driver");
    Connection conn = DriverManager.getConnection("jdbc:postgresql:SchoolA","janeve.george","l0ngl1veme");
    Statement stmt = conn.createStatement();
    But an exception is thrown when the code in bold is executed. The exception is as follows:
    Exception in thread "main" java.lang.NoClassDefFoundError: java/sql/Savepoint
    at org.postgresql.Driver.makeConnection(Driver.java:382)
    at org.postgresql.Driver.connect(Driver.java:260)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at Sample.main(Sample.java:7)
    But when i go to java profile i get the following:
    D:\Personals\Java Programs>javap java.sql.Savepoint
    Compiled from null
    interface java.sql.Savepoint{
    public abstract int getSavepointId();
    throws java/sql/SQLException
    public abstract java.lang.String getSavepointName();
    throws java/sql/SQLException
    I have downloaded Driver for PostgreSQL for jdk1.4 but still there is this problem.
    There is no problem when i use the jdbc:odbc Bridge for any other Database. Please Solve this problem of mine.
    Regards,
    Janeve

    http://forum.java.sun.com/thread.jspa?threadID=735750&messageID=4227871

  • What is wrong with this!! please help

    Hello friends,
    I'm a learner and I have done lot of JDBC connectivity with Acess database, and now I want to connect java program with oracle database, but the problem is I have downloaded the oracle driver, set the classpath, and I have created the DataSource Name with MS-ODBC, I could able to compile but I'm getting run time exception, please help me with this. regards, shabeer.
    the program is
    import java.sql.*;
    public class ShabeerJdbc {
    public static void main(String args[]) {
    // String url = "jdbc:oracle:thin:@imran:3339:shabeerjdbc";
    Connection con;
    String createString;
    createString = "create table COFFEES " +
    "(COF_NAME VARCHAR(32), " +
    "SUP_ID INTEGER, " +
    "PRICE FLOAT, " +
    "SALES INTEGER, " +
    "TOTAL INTEGER)";
    Statement stmt;
    try {
    System.out.println("shabeer1");
    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    System.out.println("shabeer2");
    } catch(java.lang.Exception e) {
    System.out.println("shabeer3");
    System.err.print("ClassNotFoundException: ");
    System.out.println("shabeer4");
    System.err.println(e.getMessage());
    try {
    System.out.println("shabeer55");
    con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:shabeerjdbc", "system", "mehar");
    System.out.println("shabeer6");
    stmt = con.createStatement();
    System.out.println("shabeer7");
    stmt.executeUpdate(createString);
    stmt.close();
    con.close();
    } catch(SQLException ex) {
    System.err.println("SQLException: " + ex.getMessage());
    the run time error is ......
    C:\JavaPractice>java ShabeerJdbc
    shabeer1
    shabeer2
    shabeer55
    Exception in thread "main" java.lang.NoClassDefFoundError: java/sql/Savepoint
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
    va:468)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at ShabeerJdbc.main(ShabeerJdbc.java:38)
    ****************************************

    HI Deriderj, thanks for your response, well I have changed the Datasourse name to SID which is "Imran" and still it is not working....do I need to download anymore driver or whether they be bundled with the ojdbc.jar, please advice me. What if I want to use another driver as you mentioned...not to use thin: what other drivers will be available for the Oracle9.2.0.1.0 please advice me, thanks a lot
    My SID name is "Imran"
    listening port is is 1521
    odbc datasource name is "shabeerjdbc"
    I'm a very biginner and I'm facing too much problem, please help me. Well I have got Oracle9.2.0.1.0 loaded as the database and soon after I intstalled it I have copied ojdbc14.jar into my java classpath and I'm trying to connect to this data base. I dont know what driver I should use, neither I downloaded any. I'm just mentioning thin: in my URL. But It is giving error, can u please tell me what driver should I mention in the URL, and why I'm getting this error, Here is the code that is compiling without errors.
    import java.sql.*;
    public class ShabeerJdbc {
    public static void main(String args[]) {
    Connection con;
    String createString;
    createString = "create table COFFEES " +
    "(COF_NAME VARCHAR(32), " +
    "SUP_ID INTEGER, " +
    "PRICE FLOAT, " +
    "SALES INTEGER, " +
    "TOTAL INTEGER)";
    Statement stmt;
    try {
         System.out.println("shabeer1");
    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
         System.out.println("shabeer2");
    } catch(java.lang.Exception e) {
         System.out.println("shabeer3");
    System.err.print("ClassNotFoundException: ");
         System.out.println("shabeer4");
    System.err.println(e.getMessage());
    try {
         System.out.println("shabeer55");
    con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:Imran", "system", "mehar");
         System.out.println("shabeer6");
         stmt = con.createStatement();
         System.out.println("shabeer7");
         stmt.executeUpdate(createString);
    stmt.close();
    con.close();
    } catch(SQLException ex) {
    System.err.println("Sql Exception" + ex.getMessage());
    ************The runtime Error it is giving is *********************
    C:\JavaPractice>java ShabeerJdbc
    shabeer1
    shabeer2
    shabeer55
    Exception in thread "main" java.lang.NoClassDefFoundError: java/sql/Savepoint
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
    va:468)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at ShabeerJdbc.main(ShabeerJdbc.java:38)
    ***************************** please help me....

Maybe you are looking for

  • Activate network in Solaris 10

    Hi All, I install my solaris 10, nonnetworked system, now I need activate nework in it. i would like know, how I do this? Thanks...

  • UDF error in single stack PO

    I got this error in single stack PI the length 0 of the array 'sortedFunctionKeys' is not equal to the number 1 of functions. See error logs for detail I

  • Dynex 32 Inch TV Help

    I recently got a Dynex 32 inch tv because it got good reviews online and because it was advertised as being able to connect to computers with an HDMI cable. I have a Macbook Pro laptop from early 2011. I bought the HDMI cable and the HDMI to displayp

  • User details in respect of roles assigned to them

    Hi Experts, Sorry if i am posting thread on wrong category. Can you tell me any table that contains the list of users against roles assigned to them? Or just guide me to post the thread to correct category if I am wrong. Thanks and regards, Shikha Gu

  • Getting user roles/credentials? (TOMCAT web auth)

    Hi all ! I need a way to retreive the roles/credentals that a user has assigned in the tomcat web auth. I was using request.getUserPrincipal(), but that returns a string thats not really what Im looking for: *GenericPrincipal[manusan(Gerencia,)]* Her