Getting Invalid Cursor error in a procedure

Hi,
I have a procedure(1) which inturn calls another procedure(2) which does some task.
Procedure(1) accepts response from Procedure(2).
The error code of procedure(2) is *0* which is the success response.
Iam getting 0 from Procedure(2).
But still Procedure(1) gives me a Invalid cursor error ( eventhough all the cursors are closed and opened ).
Any suggestion on this????

procedure p_create_conn -- Procedure(1) which is the calling proc
is
begin
connectivity_api.p_create_connection -- Procedure(2) called proc
in_scheme_number => in_scheme_number
,in_a_lp_sysid => in_a_lp_sysid
,in_z_lp_sysid => in_z_lp_sysid
,in_interconnect_name => in_interconnect_name
,in_mux_usage => in_mux_usage
,in_mux_type => in_mux_type
,out_a_end_sne => v_out_a_sne_id
,out_z_end_sne => v_out_z_sne_id
,out_sss_id => v_out_sss_id
,out_error_code => out_error_code
,out_error_message => out_error_message
,in_a_port_name => in_a_port_name
,in_a_port_signal => in_a_port_signal
,in_z_port_name => in_z_port_name
,in_z_port_signal => in_z_port_signal
,in_trs_area => in_trs_area
,in_alternate_id => in_alternate_id
,in_dcn_equipment_name => in_dcn_equipment_name
,in_dcn_equipment_id => in_dcn_equipment_id
,in_dcn_equipment_notes => in_dcn_equipment_notes
,in_tcode => in_tcode
if out_error_code != 0 --- Error code from Procedure(2) is 0 in my case
then
raise ex_p_create_connection;
end if;
-- Faliing after success response here
workflow_utils.create_link
in_link_type => 'A'
,in_source_workflow_name => con_wf_scheme_type
,in_source_record_id => in_scheme_number
,in_trigger_state => 'initial'
,in_dest_workflow_name => con_wf_connectivity
,in_dest_record_id => v_out_sss_id
,in_dest_from_state => null
,in_dest_to_state => null
,in_terminate_source => 'N'
,in_terminate_dest => 'N'
,in_user_account_name => v_user
-- in this proc all the cursors have been closed properly.
exception
when ex_p_create_connection
then
null;
when others
then
out_error_code := sqlcode;
out_error_message := sqlerrm;
end p_create_connection;
Is that fine with you????

Similar Messages

  • Getting Invalid Cursor Error

    Hi, I am having trouble with my code and it is generating an error in the alert logs and trace files. Can i ask for help?
    Fri Sep 02 19:20:33 2011
    Errors in file D:\oracle\dumps\prod_ora_5312.trc:
    ORA-00600: internal error code, arguments: [17281], [1001], [0x680CAB34], [], [], [], [], []
    ORA-01001: invalid cursor
    The trace file says:
    TraceFiles:
    Oracle process number: 20
    Windows thread id: 5312, image: ORACLE.EXE (SHAD)
    *** SERVICE NAME:(PROD) 2011-09-02 10:43:22.592
    *** SESSION ID:(133.14370) 2011-09-02 10:43:22.592
    *** 2011-09-02 10:43:22.592
    ksedmp: internal or fatal error
    ORA-00600: internal error code, arguments: [17281], [1001], [0x680CAB34], [], [], [], [], []
    ORA-01001: invalid cursor
    Current SQL statement for this session:
    declare  cursor NlsParamsCursor is    SELECT FROM nls_session_parameters;begin SELECT Nvl(Lengthb(Chr(65536)), Nvl(Lengthb(Chr(256)), 1)) INTO :CharLength FROM dual; for NlsRecord in NlsParamsCursor loop if NlsRecord.parameter = 'NLS_DATE_LANGUAGE' then :NlsDateLanguage := NlsRecord.value; elsif NlsRecord.parameter = 'NLS_DATE_FORMAT' then :NlsDateFormat := NlsRecord.value; elsif NlsRecord.parameter = 'NLS_NUMERIC_CHARACTERS' then :NlsNumericCharacters := NlsRecord.value; elsif NlsRecord.parameter = 'NLS_TIMESTAMP_FORMAT' then :NlsTimeStampFormat := NlsRecord.value; elsif NlsRecord.parameter = 'NLS_TIMESTAMP_TZ_FORMAT' then :NlsTimeStampTZFormat := NlsRecord.value; end if; end loop;end;*
    What is wrong with this code and how can i resolve this? Thanks!
    Edited by: gab-gab on Sep 2, 2011 7:36 PM

    maybe (bind variables :CharLength etc. belong to SQL not PL/SQL)
    declare
      cursor NlsParamsCursor is SELECT * FROM nls_session_parameters;
      CharLength number;
      NlsDateLanguage varchar2(40);
      NlsDateFormat varchar2(40);
      NlsNumericCharacters varchar2(40);
      NlsTimeStampFormat varchar2(40);
      NlsTimeStampTZFormat varchar2(40);
    begin
      SELECT Nvl(Lengthb(Chr(65536)), Nvl(Lengthb(Chr(256)), 1))
        INTO CharLength
        FROM dual;
      for NlsRecord in NlsParamsCursor
      loop
        if NlsRecord.parameter = 'NLS_DATE_LANGUAGE' then
          NlsDateLanguage := NlsRecord.value;
        elsif NlsRecord.parameter = 'NLS_DATE_FORMAT' then
          NlsDateFormat := NlsRecord.value;
        elsif NlsRecord.parameter = 'NLS_NUMERIC_CHARACTERS' then
          NlsNumericCharacters := NlsRecord.value;
        elsif NlsRecord.parameter = 'NLS_TIMESTAMP_FORMAT' then
          NlsTimeStampFormat := NlsRecord.value;
        elsif NlsRecord.parameter = 'NLS_TIMESTAMP_TZ_FORMAT' then
          NlsTimeStampTZFormat := NlsRecord.value;
        end if;
      end loop;
    end;Regards
    Etbin
    Edited by: Etbin on 3.9.2011 8:48
    comment about probable reason of the exception raised
    Edited by: Etbin on 4.9.2011 11:58
    or you had in mind this http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/expressions012.htm#i1033659

  • Invalid cursor error in procedure

    i am writing a procedure in which i have make use of cursor........it is giving me error INVALID CURSOR
    on running
    i have used this cursor with WITH CLAUSE....
    when i am executing or running this procedure this giving me invalid cursor error
    create or replace
    procedure USP_UPDATEDRUGORDERDTL
    v_pServiceid IN NUMBER DEFAULT NULL ,
    v_pServRendered IN NUMBER DEFAULT NULL ,
    v_pSchDateTime IN DATE DEFAULT NULL ,
    v_pOrdQty IN FLOAT DEFAULT NULL ,
    v_billingclassid IN NUMBER DEFAULT NULL ,
    v_pOrdID IN NUMBER DEFAULT NULL ,
    v_UpdatedBy IN NUMBER DEFAULT NULL ,
    v_prender IN NUMBER DEFAULT 0 ,
    v_pInsertedByUserID IN VARCHAR2 DEFAULT NULL ,
    v_pInsertedON IN DATE DEFAULT NULL ,
    v_pDrugID IN NUMBER DEFAULT 0 ,
    v_pRate IN FLOAT DEFAULT 0 ,
    v_pBatchId IN NUMBER DEFAULT 0 ,
    v_OrderSource IN VARCHAR2 DEFAULT NULL ,
    v_pInsertedMacID IN VARCHAR2 DEFAULT NULL ,
    v_pInsertedIPAddress IN VARCHAR2 DEFAULT NULL ,
    v_pOldOrdID IN NUMBER DEFAULT NULL,
    v_plocid in char DEFAULT NULL
    AS
    vr_pConsumptionID NUMBER(10,0);
    vr_pSavedQty NUMBER(10,3);
    vr_pReturnQty NUMBER(10,3);
    vr_Qty NUMBER(10,3);
    begin
    vr_pSavedQty := 0;
    vr_pReturnQty := v_pOrdQty;
    declare
    cursor ordDtl_cur is -----cursor declaration
    with --- with clause used with cursor
    Q1 AS
    Select NVL(ConsumptionID,0) As ConsumptionID,Sum(OrdQty) As OrdQty,
    OrdID,DrugID,BatchID, locid from Orderdtl
    Where OrdID = v_pOldOrdID and DrugID = v_pDrugID And BatchID = v_pBatchID and NVL(Cancelled,0) = 0
    Group By OrdID,DrugID,BatchID,ConsumptionID
    Order By ConsumptionID asc
    Q2 AS
    SELECT NVL(OrderDtl.ConsumptionID,0) As ConsumptionID,(SUM(OrderDtl.OrdQty)) As OrdQty,
    IvPatientIssueReturnDtl.OrderID as OrdID,OrderDtl.DrugID,OrderDtl.BatchID,OrderDtl.locid
    FROM OrderDtl INNER JOIN
    IvPatientIssueReturnDtl ON OrderDtl.OrdID = IvPatientIssueReturnDtl.NewOrderId AND
    OrderDtl.DrugId = IvPatientIssueReturnDtl.ItemId AND OrderDtl.BatchId = IvPatientIssueReturnDtl.BatchId
    WHERE (OrderDtl.BatchId = v_pBatchID) AND (IvPatientIssueReturnDtl.OrderId = v_pOldOrdID)
    AND (OrderDtl.DrugID = v_pDrugID) and NVL(OrderDtl.Cancelled,0) = 0
    Group By IvPatientIssueReturnDtl.OrderID,OrderDtl.DrugID,OrderDtl.BatchID,OrderDtl.ConsumptionID
    Order By OrderDtl.ConsumptionID asc
    Select
    Q1.ConsumptionID,(Sum(NVL(Q1.OrdQty,0)) + Sum(NVL(Q2.OrdQty,0))) As OrdQty,
    Q1.OrdID,Q1.DrugID,Q1.BatchID,Q1.locid
    from
    Q1 ,Q2
    where
    Q1.OrdID =Q2.OrdID(+)
    and
    Q1.BatchID =Q2.BatchID(+)
    and
    Q1.DrugID =Q2.DrugID(+)
    and
    Q1.ConsumptionID =Q2.ConsumptionID(+)
    Group By Q1.OrdID,Q1.BatchID,Q1.DrugID,Q1.ConsumptionID;
    TYPE ordDtl_trec is TABLE of ordDtl_cur%ROWTYPE index by PLS_INTEGER;
    l_ordDtl ordDtl_trec; ---- cursor syntax
    begin
    if ordDtl_cur%ISOPEN then
    open ordDtl_cur; --------------opening cursor
    end if;
    loop
    -- fetch data into cursor---
    fetch ordDtl_cur
    bulk collect into
    l_ordDtl;
    -----perform logic--------------------
    for indx IN 1..l_ordDtl.COUNT loop
    if vr_pSavedQty <> vr_pReturnQty then
    If v_pOrdQty <= (vr_pReturnQty - vr_pSavedQty) then
    vr_pSavedQty := vr_pSavedQty + v_pOrdQty;
    vr_Qty := v_pOrdQty;
    else
    vr_Qty := (vr_pReturnQty - vr_pSavedQty);
    vr_pSavedQty := vr_pSavedQty + (vr_pReturnQty - vr_pSavedQty);
    end if;
    end if;
    end loop;
    exit when ordDtl_cur%NOTFOUND;
    end loop;
    CLOSE ordDtl_cur; ---- closing cursor
    end;
    end;

    Hello.
    Very simple.
    You are using cursor name before opening it.
    Here is the problem.
      if ordDtl_cur%ISOPEN then
       open ordDtl_cur; --------------opening cursor
      end if;
    end if;Please change your code like this
    comment IF statement use only OPEN  ordDtl_cur;
      ---- if ordDtl_cur%ISOPEN then
         open ordDtl_cur; --------------opening cursor
      --- end if;Thanks,
    Suri

  • Invalid Cursor error when modifying Assignment details - Transfer workflow

    Hi,
    We're trying to submit a Transfer transaction but if we try to modify any field in the Assignment details screen, we're getting a system error, and sometimes we see ORA-01001: invalid cursor error. We have already checked the database objects (procedures, packages, triggers) and we don't see any code which has an invalid use of a cursor. Does anyone have a clue on the cause of this error?

    This is just a guess,
    all you cursors are being opened regardless of any condition, for example;
    OPEN CUT(:NEW.LAYOUT_NO);
    OPEN DET(:NEW.LAYOUT_NO);
    OPEN ITM(:NEW.LAYOUT_NO);
    OPEN LOT(:NEW.LAYOUT_NO);
    OPEN DTN(:NEW.LAYOUT_NO, :NEW.CUT_NO, :NEW.NOTE);UNA however is opened after a condition;
    IF DTN%NOTFOUND THEN
      /** start --added for cha 2011-3172 6/14/2011 **/
          OPEN UNA(:NEW.LAYOUT_NO, :NEW.ACCOUNT_NO);All cursors arel however closed regardless, i.e. they are all assumes to be open;
      CLOSE CUT;
      CLOSE DET;
      CLOSE DTN;
      CLOSE ITM;
      CLOSE LOT;
      CLOSE STAT;
      CLOSE UNA;So I think you are closing the UNA cursors wen it is in fact not open.
    So, move the "CLOSE UNA;" line of code to before the END IF; on line 278, since that is when it will definitely be open.

  • Invalid Cursor Error

    I have a table called cdd_merge_children where the comments field contains the following SQL.
    SELECT EVENT_ID FROM EVENT WHERE ACCOUNT_ID = :ACCOUNT_NO
    In my procedure I am doing the following:
    --get the comments from the cdd_merge_children table where CDD_MERGE_CHILDREN_TYPE
    --is of type 3. type 3 are a replica of type 2's for audit/history purposes 
    SELECT DISTINCT COMMENTS
    INTO ls_comments
    FROM CDD_MERGE_CHILDREN
    where table_name = ps_tablename
    and CDD_MERGE_CHILDREN_TYPE = 3 ;
    --get the comments from the table and execute the dynamic sql using the looser.
    OPEN col_cv FOR ls_comments USING gvloosingaccount ;
    --dump the curosr values in the table
    FETCH col_cv BULK COLLECT INTO loosingvals ;
    For some reason or the other when I try doing the fetch I am getting invalid cursor or ORA-01001: invalid cursor error. WHY WHY
    Please help !

    You cannot bulk-fetch from a cursor into a collection of records, you can only bulk-fetch from a cursor into one or
    more collections:
    DECLARE
    TYPE NameList IS TABLE OF emp.ename%TYPE;
    TYPE SalList IS TABLE OF emp.sal%TYPE;
    CURSOR c1 IS SELECT ename, sal FROM emp WHERE sal > 1000;
    names NameList;
    sals SalList;
    BEGIN
    OPEN c1;
    FETCH c1 BULK COLLECT INTO names, sals;
    END;
    You cannot however,
    DECLARE
    TYPE NameList IS TABLE OF emp.ename%TYPE;
    names NameList;
    salary emp.sal%TYPE;
    TYPE DeptRecTab IS TABLE OF dept%ROWTYPE;
    dept_recs DeptRecTab;
    CURSOR c1 IS
    SELECT deptno, dname, loc FROM dept WHERE deptno > 10;
    BEGIN
    SELECT ename, sal BULK COLLECT INTO names, salary; -- illegal target
    BEGIN
    OPEN c1;
    FETCH c1 BULK COLLECT INTO dept_recs; -- illegal
    END;
    Ok I have a table called cdd_merge_children which has a column called comments. In this column I am storing dynamic SQL such as
    SELECT EVENT_ID FROM EVENT WHERE ACCOUNT_ID = :ACCOUNT_NO
    Now in my code I retrieve this SQL statement and use it as follows:
    --get the comments from the table and execute the dynamic sql using the looser.
    OPEN col_cv FOR ls_comments USING gvloosingaccount ;
    --col_cv is a reference cursor BTW
    --dump the curosr values in the table
    FETCH col_cv BULK COLLECT INTO loosingvals ;
    Ok at this fetch is where I am getting the following error
    ORA-01001: invalid cursor
    Why ? Anyhelp would be great
    Thank's
    Sameer Handa

  • "Invalid Cursor" Error in Form

    Hi,
    I wrote a procedure that take a REF CURSOR as an IN OUT argument. This procedure does an "OPEN cursor FOR qry" with a dynamic query:
    OPEN l_cursor FOR
           'SELECT A '||
             'FROM B '||
            'WHERE C = :l_var'
         USING myVar;After calling the procedure, I do a LOOP with FETCH.
    It works well when I use it in SQL*Plus with DBMS_OUTPUT but it returns a "ORA-01001 invalid cursor" error in Forms.
    Any help is welcome!
    Regards,
    Olivier.

    I found a solution on Metalink:
    Note:170881.1
    Note: 1007395.6
    Olivier.

  • "ORA-01001 Invalid Cursor" error

    Platform: oracle 8.X on ibm aix and java client code from
    windows NT.
    JDBC DRIVER: JDBC Oracle thin driver version 1.2.
    when i execute a Sql satement with Cursor expression from the
    java client code with XSU it returns an XML DOM But if the
    CURSOR EXPRESSION IN THE SQL QUERY RETURNS EMPTY ROWS i get
    back an error node with "ORA-01001 Invalid Cursor" error
    message.i had aslo set the setNullAttributes(true) property
    on oraclexmlquery.
    Interestingly, if i exceute the same query in the SQL plus
    it returns the column names with no rows.
    is there any way where i can get xml document with table
    structure, when there are no rows instead of ORA error message.
         

    This is just a guess,
    all you cursors are being opened regardless of any condition, for example;
    OPEN CUT(:NEW.LAYOUT_NO);
    OPEN DET(:NEW.LAYOUT_NO);
    OPEN ITM(:NEW.LAYOUT_NO);
    OPEN LOT(:NEW.LAYOUT_NO);
    OPEN DTN(:NEW.LAYOUT_NO, :NEW.CUT_NO, :NEW.NOTE);UNA however is opened after a condition;
    IF DTN%NOTFOUND THEN
      /** start --added for cha 2011-3172 6/14/2011 **/
          OPEN UNA(:NEW.LAYOUT_NO, :NEW.ACCOUNT_NO);All cursors arel however closed regardless, i.e. they are all assumes to be open;
      CLOSE CUT;
      CLOSE DET;
      CLOSE DTN;
      CLOSE ITM;
      CLOSE LOT;
      CLOSE STAT;
      CLOSE UNA;So I think you are closing the UNA cursors wen it is in fact not open.
    So, move the "CLOSE UNA;" line of code to before the END IF; on line 278, since that is when it will definitely be open.

  • Getting invalid password error while logging onto application from frontend

    Hi Guys
    I am trying to login to one of our clones and i am getting invalid password error.
    I ran fndcpass and change my username's password which got changed successfully
    But still when i login to application using my username i am getting invalid password error
    I am getting the same error if i login as sysadmin
    Please suggest to resolve this
    thanks !!

    Hi,
    I am trying to login to one of our clones and i am getting invalid password error.What is the application release?
    Please post the complete error message -- Also, check Apache log files for details (error_log* and access_log*).
    I ran fndcpass and change my username's password which got changed successfullyWhat username password have you changed?
    But still when i login to application using my username i am getting invalid password error
    I am getting the same error if i login as sysadminDoes this happen when login as any application user?
    Please verify that none of those users are end-dated.
    Regards,
    Hussein

  • Trying to update to itunes 11.1 getting invalid signature error message

    getting invalid signature error message when trying to upgrade itunes 11.1...help me please?

    iTunes: Specific update-and-restore error messages and advanced troubleshooting
    http://support.apple.com/kb/TS3694
    Try this - Disable your firewall and anitvirus software temporarily.  Then download and install the iOS update.
     Cheers, Tom

  • TO_CHAR to convert date getting 'Invalid number' error

    I am trying to convert a static date value using TO_CHAR function but I can't believe I am not able to do it such a simple conversion.
    //Obviously this is easy and everyone would like to give this as an example and this is what I see everwhere on Google and it works.
    SELECT TO_CHAR(sysdate, 'YYYY-MM-DD') FROM DUAL;
    How can I make it work like this?
    SELECT TO_CHAR('2010-JUN-23', 'YYYY-MM-DD') FROM DUAL;
    I keep getting "Invalid number" error. I changed my constant date to different formats but none works.

    Your first literal is not a date, assuming you didn't set NLS_DATE_FORMAT.
    So the code should have been
    SELECT TO_CHAR(to_date('2010-JUN-23','YYYY-MON-DD'), 'YYYY-MM-DD') FROM DUAL;
    Please note DATEs are always converted to VARCHAR2 when you SELECT them, using NLS_DATE_FORMAT.
    When you use a DATE string literal it ias always implicitly converted to a real date, by using NLS_DATE_FORMAT.
    So if you want all your dates formatted as YYYY-MON-DD, you need to set NLS_DATE_FORMAT to that mask.
    Sybrand Bakker
    Senior Oracle DBA

  • TO_NUMBER getting invalid number error

    I want to use TO_NUMBER function to converse some float number,
    but the following query always gets invalid number error:
    select to_number('12.1073') from dual;
    but if I add the format in, it runs as expected:
    select to_number('12.1073', '99.9999') from dual;
    From the syntax, the format parameter is optional, is it only optional for integers?
    Thanks!

    Same here.
    So, or you replace dot by comma, or you change the territory (or nls_numeric_characters) defined for your session :
    SQL> select to_number('12.1073') from dual;
    select to_number('12.1073') from dual
    ERROR at line 1:
    ORA-01722: invalid number
    Elapsed: 00:00:00.00
    SQL> alter session set nls_territory='america';
    Session altered.
    Elapsed: 00:00:00.00
    SQL> select to_number('12.1073') from dual;
    TO_NUMBER('12.1073')
                 12.1073
    Elapsed: 00:00:00.00
    SQL> alter session set nls_territory='france';
    Session altered.
    Elapsed: 00:00:00.00
    SQL> select to_number('12.1073') from dual;
    select to_number('12.1073') from dual
    ERROR at line 1:
    ORA-01722: invalid number
    Elapsed: 00:00:00.00
    SQL> alter session set nls_numeric_characters='.,';
    Session altered.
    Elapsed: 00:00:00.00
    SQL> select to_number('12.1073') from dual;
    TO_NUMBER('12.1073')
                 12.1073
    Elapsed: 00:00:00.00
    SQL> Nicolas.

  • Please help getting invalid number error.

    Hi Experts,
    My requirement is
    If DT_ID value of xmlmsg existed in the DT_ID of PART_ID_COLLES table then that record should be processd else should be skipped.
    And xmlmsg of PART_ID should start with "A" and followed only by the number then that record should be processed else should be skipped.
    And xmlmsg of DD_DAYS should contain only  the number and grater than or equal to 0 ,then that record should be processed else should be skipped.
    For that I have written this code.
    But if I pass dt_id as string value in xmlmsg I am getting invalid number error.
    DT_ID of PART_ID_COLLES table is number data type.
    SELECT xmlmsg.part_id part_id,xmlmsg.dd_days dd_days,xmlmsg.dt_id dt_id
                      FROM XMLTABLE(
                            XMLNAMESPACES(
                                'urn:schemas-microsoft-com:rowset' as "rs"
                              , '#RowsetSchema' as "z"
                            '/z:row[not(@dt_id=following-sibling::z:row/@dt_id and @part_id=following-sibling::z:row/@part_id)]'
                            PASSING p_dd_days_vals
                            COLUMNS
                                ITEM_NO             for ordinality
                              , dt_id    VARCHAR2 (20) path '@dt_id'
                              , part_id  VARCHAR2 (25) path '@part_id'
                              , dd_days  VARCHAR2 (20) path '@dd_days'
                           ) xmlmsg,
                           part_id_colles pic
                           WHERE REGEXP_REPLACE(TRIM(xmlmsg.dt_id),'^([0-9]+)$|.','\1') = pic.dt_id
                                 AND REGEXP_LIKE (UPPER(TRIM(xmlmsg.part_id)),'^[A][0-9]+$')
                                 AND (TO_NUMBER(REGEXP_REPLACE(TRIM(xmlmsg.dd_days),'^([0-9]+)$|.','\1')) >=0
                                 AND REGEXP_LIKE(TRIM(xmlmsg.dd_days), '^-?[[:digit:],.]*$') ;
    Sample message is
    <MESSAGES>
    <MESSAGE ID="12345">
      <MSG_ID>3026900</MSG_ID>
      <DT_POSTED>6/20/2013 08:15:48</DT_POSTED>
      <POSTED_BY>GPD_MSG_EXTRACTOR</POSTED_BY>
      <DT_LAST_QUEUED />
    <MSG>
    <WORK_SET TRANSACTION_ID="@TRANS_ID" TRANSACTION_TYPE="Batch" IS_ACID="@IS_ACID">
    <WORK_UNIT GROUP="dd_days" ACTION="ADD" AFFECTED="dd_days">
    <RECORDSET TABLE_NAME="dd_days">
    <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
    <rs:data>
      <z:row dt_id="430" part_id="A5556689" dd_days="10"/>
      <z:row dt_id="550A" part_id="A8889965" dd_days="20"/>
      </rs:data>
      </xml>
      </RECORDSET>
      </WORK_UNIT>
      </WORK_SET>
      </MSG>
      </MESSAGE>
      </MESSAGES>
    Please help me.
    Thanks.

    Your code has ton of errors. Anyway:
    with part_id_colles as (
                            select 430 dt_id,xmltype('<MESSAGES>
    <MESSAGE ID="12345">
      <MSG_ID>3026900</MSG_ID>
      <DT_POSTED>6/20/2013 08:15:48</DT_POSTED>
      <POSTED_BY>GPD_MSG_EXTRACTOR</POSTED_BY>
      <DT_LAST_QUEUED />
    <MSG>
    <WORK_SET TRANSACTION_ID="@TRANS_ID" TRANSACTION_TYPE="Batch" IS_ACID="@IS_ACID">
    <WORK_UNIT GROUP="dd_days" ACTION="ADD" AFFECTED="dd_days">
    <RECORDSET TABLE_NAME="dd_days">
    <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
    <rs:data>
      <z:row dt_id="430" part_id="A5556689" dd_days="10"/>
      <z:row dt_id="550A" part_id="A8889965" dd_days="20"/>
      </rs:data>
      </xml>
      </RECORDSET>
      </WORK_UNIT>
      </WORK_SET>
      </MSG>
      </MESSAGE>
      </MESSAGES>') p_dd_days_vals from dual)
    SELECT  xmlmsg.part_id part_id,
            xmlmsg.dd_days dd_days,
            xmlmsg.dt_id dt_id
      FROM  part_id_colles pic,
            XMLTABLE(
                     XMLNAMESPACES(
                                   'urn:schemas-microsoft-com:rowset' as "rs",
                                   '#RowsetSchema' as "z"
                     '/MESSAGES/MESSAGE/MSG/WORK_SET/WORK_UNIT/RECORDSET/xml/rs:data/z:row[not(@dt_id=following-sibling::z:row/@dt_id and @part_id=following-sibling::z:row/@part_id)]'
                     PASSING p_dd_days_vals
                     COLUMNS
                        ITEM_NO             for ordinality,
                        dt_id    VARCHAR2 (20) path '@dt_id',
                        part_id  VARCHAR2 (25) path '@part_id',
                        dd_days  VARCHAR2 (20) path '@dd_days'
                    ) xmlmsg
      WHERE REGEXP_REPLACE(TRIM(xmlmsg.dt_id),'^([0-9]+)$|.','\1') = pic.dt_id
        AND REGEXP_LIKE(UPPER(TRIM(xmlmsg.part_id)),'^[A][0-9]+$')
        AND TO_NUMBER(REGEXP_REPLACE(TRIM(xmlmsg.dd_days),'^([0-9]+)$|.','\1')) >=0
        AND REGEXP_LIKE(TRIM(xmlmsg.dd_days), '^-?[[:digit:],.]*$')
    PART_ID                   DD_DAYS              DT_ID
    A5556689                  10                   430
    SQL>
    SY.

  • Getting 'Invalid argument' error while uisng OPEN DATASET. Help!

    Hi Experts,
       I am trying to read a file from a shared server location using OPEN DATASET as shown below.
    OPEN DATASET file_name FOR INPUT IN TEXT MODE ENCODING UTF-8 MESSAGE msg.
    The file_name i gave is '
    CNSGN-PRE-DM.COM\FUNCTIONAL\INVENTORY.CSV'.
    The program compiles perfectly. But when I run the program I am getting 'Invalid argument' error. I have checked the authorization to the server, file name, file availability and everything is fine.
    Strangely this code was working fine a week ago.
    What could be the problem? Kindly help me!
    Thanks
    Gopal

    Hi Chndrasekhar,
            You mean to say the we cannot use OPEN DATASET for reading file in shared server location. For example a shared folder in my PC.
    Is there something wrong in the file name path I have given? It started with '//'. Do I have to start the file path wih 'file://..'?
    Thanks
    Gopal

  • Invalid Cursor Error when executing a form

    I am getting the following error
    "Error Executing Cursor
    ORA-01001: invalid cursor"
    when I try to "Submit" information in a form based on the procedure below. What's the problem?! The procedure compiles fine.
    create or replace procedure MARKETING_FORM_2_7
    (ToAdd in Varchar2,
    FromAdd in Varchar2,
    Subject in Varchar2,
    SenderName in Varchar2,
    Branch in Varchar2,
    Phone in Varchar2,
    Address in Varchar2,
    Suggestion in Varchar2,
    SalesPromo in Varchar2,
    TradeshowPrep in Varchar2,
    SalesMaterials in Varchar2,
    DirectMail in Varchar2,
    CounterDays in Varchar2,
    BranchCustData in Varchar2,
    Other in Varchar2,
    ProjectName in Varchar2,
    Purpose in Varchar2,
    Audience in Varchar2,
    WhoPay in Varchar2,
    Deadline in Varchar2,
    Progress in Varchar2,
    EmployeeUpdate in Varchar2,
    WESCOWin in Varchar2,
    DescribeWin in Varchar2,
    PotentialValue in Varchar2,
    PartBranches in Varchar2,
    SignifPeople in Varchar2,
    SpecialFactors in Varchar2)
    is
    mailhost Varchar2(15) :='CLAPTON';
    mail_conn utl_smtp.connection;
    crlf varchar2(2):=chr( 13 )||chr( 10 );
    mesg varchar2(5000);
    begin
    mail_conn := utl_smtp.open_connection(mailhost,25);
    mesg:= 'From: <'||FromAdd||'>' ||crlf ||
    'To: '||ToAdd || crlf ||
    'Subject: '||Subject || crlf ||
    '' ||crlf||
    'Name: '||SenderName || crlf ||
    'Branch: '||Branch || crlf ||
    'Phone: '||Phone || crlf ||
    'Address: '||Address || crlf ||
    'Comment or Suggestion: ' || Suggestion || crlf ||
    'Sales Promotion Assistance: '|| SalesPromo || crlf ||
    'Tradeshow Assistance: '|| TradeshowPrep || crlf ||
    'Sales Materials or Presentations Assistance: '|| SalesMaterials || crlf ||
    'Direct Mail Assistance: '|| DirectMail || crlf ||
    'Counter Days Assistance: '|| CounterDays || crlf ||
    'Customer Database Assistance: '|| BranchCustData || crlf ||
    'Other: '|| Other || crlf ||
    'Project Name: '|| ProjectName|| crlf ||
    'Purpose: '|| Purpose || crlf ||
    'Indended Audience: '|| Audience || crlf ||
    'Who Will Pay?: ' || WhoPay || crlf ||
    'Deadline: '|| Deadline || crlf ||
    'Progress Made: ' || Progress || crlf ||
    'Mailing List Update: ' || EmployeeUpdate || crlf ||
    'WESCO Win: '|| WESCOWin || crlf ||
    'Win Description: ' || DescribeWin || crlf ||
    'Contract Value/Potential Sales: '|| PotentialValue || crlf ||
    'Participating Branches: '|| PartBranches || crlf ||
    'Significant Contributors: '|| SignifPeople || crlf ||
    'Special Factors: '|| SpecialFactors;
    utl_smtp.helo(mail_conn, mailhost);
    utl_smtp.mail(mail_conn, FromAdd);
    utl_smtp.rcpt(mail_conn, ToAdd);
    utl_smtp.data(mail_conn, mesg);
    utl_smtp.quit(mail_conn);
    end;

    Try executing the procedure independently (say from sqlplus) to see whether the procedure works fine.
    Alternatively, try commenting out the calls to the utl_smtp packages to see whether the procedure works.

  • Oracle 10g EE Export Results in ORA-01001: invalid cursor Error

    Hi,
    I'm quite new to Oracle 10g and OCS10g. We have a crippled/corrupt SYSAUX tablespace (data file 3) which cannot be recovered using recover
    command anymore. So metalink support instructed us to do a export of the metadata of the working tablespace which contains our system data (we are in configuration stage for OCS 10g 10.1.2) via transportable tablespaces so that I can just recreate the database in DBCA and import the metadata. So after I made a cold backup, set the "transportable" tablespaces to "READ ONLY" mode, I proceeded w/ the export command which resulted in an error, please see below:
    $exp \'sys/********@ocs10gSID as sysdba\' parfile=transport.par
    Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.4.2 -
    Production
    With the Partitioning, Real Application Clusters, OLAP and Data Mining options
    Export done in US7ASCII character set and AL16UTF16 NCHAR character set
    server uses AL32UTF8 character set (possible charset conversion)
    Note: table data (rows) will not be exported
    About to export transportable tablespace metadata...
    EXP-00008: ORACLE error 1001 encountered
    ORA-01001: invalid cursor
    ORA-06512: at "SYS.DBMS_SYS_SQL", line 899
    ORA-06512: at "SYS.DBMS_SQL", line 19
    ORA-06512: at "SYS.DBMS_TTS", line 811
    ORA-00376: file 3 cannot be read at this time
    ORA-01110: data file 3: '/ocfs/oradata/OCS/datafile/o1_mf_sysaux_2mgzbr51_.dbf'
    ORA-06512: at "SYS.DBMS_PLUGTS", line 1444
    ORA-06512: at line 1
    Anyone encountered this problem before? Any recommendations or tips to get this working?
    I checked this url:"http://luhartma.blogspot.com/2006/05/how-to-check-if-tablespace-is.html"
    And when I try to follow the instructions and check on of the tablespace I set to and verified to be in "READ ONLY" mode, I get the same error.
    SQL> connect / as sysdba
    Connected.
    SQL> exec dbms_tts.TRANSPORT_SET_CHECK('PORTAL',TRUE)
    BEGIN dbms_tts.TRANSPORT_SET_CHECK('PORTAL',TRUE); END;
    ERROR at line 1:
    ORA-01001: invalid cursor
    ORA-06512: at "SYS.DBMS_SYS_SQL", line 899
    ORA-06512: at "SYS.DBMS_SQL", line 19
    ORA-06512: at "SYS.DBMS_TTS", line 811
    ORA-00376: file 3 cannot be read at this time
    ORA-01110: data file 3: '/ocfs/oradata/OCS/datafile/o1_mf_sysaux_2mgzbr51_.dbf'
    ORA-06512: at "SYS.DBMS_TTS", line 840
    ORA-06512: at line 1
    Hope someone can help on this or at least provide a suggestion. Data file 3 above is the reason we are doing a transportable tablespace export & db recreation.
    BTW what we have is:
    OCS 10g 10.1.2 w/ Oracle RDBMS 10g Enterprise Edition 10.1.0.4.2
    RHEL4 Update2
    Thanks in advance.
    Regards,
    -Kenth

    Hi,
    The status is "RECOVER" we have actually tried to recover but unfortunately the archive logs that were needed were on disks and were lost during one of the server hardware failures. Actually that is the reason why metalink support recommended this route for getting everything in order since we don't have any application data in SYSAUX yet.
    Thanks.

Maybe you are looking for