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.

Similar Messages

  • "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.

  • Unexpected "ORA-01001: invalid cursor" error

    I have a Pro*C application that basically fetches from a cursor, does a bunch of work with that row, does a "delete from <table> where current of <cursor name>", then loops back, fetches, the next row, etc., and finally closes the cursor once all the rows have been processed.
    One of our clients is getting an 'ORA-01001' error on the "DELETE FROM <table> WHERE CURRENT OF <cursor>" statement. This is long-standing, frequently executed code at 100+ clients and I've never had a problem with this statement before. The client is consistently getting this error on a particular row from this cursor, but other rows processed with the same cursor are processing successfully.
    Unfortunately, I do not have direct access to the client's database, so I cannot debug directly, but I've placed print statements around the only place in my application's code that explicitly closes the cursor. A log generated on a run that threw the 1001 error confirmed that the cursor is NOT being explicitly closed by my application by an "EXEC SQL CLOSE <cursor>" statement.
    Likewise, I put print statements around all the COMMITs and ROLLBACKs in my application, and none of these showed in the logs either.
    My application does make a call to a client-customized PL/SQL function that they recently changed. However, I have a copy of the clients function and there are not any explicit COMMIT, ROLLBACK, ANALYZE, ALTER, DROP, REPLACE, TRUNCATE or CREATE statements that would implicitly commit and close the cursor.
    Here are potential problems that I have ruled out:
    -Oracle OPEN_CURSORS parameter - It appears that if this were the problem, the error would be an ORA-1000, not 1001. Please correct me if I am wrong here.
    -Pro*C MAXOPENCURSORS parameter - I compiled a version with a MAXOPENCURSORS value that is higher than the client's OPEN_CURSORS setting. If this were the problem, the error should have switched to the ORA-1000 error when I increased the parameter. It remained as an ORA-1001.
    Next steps:
    -What could cause a cursor to close other than explicit COMMIT, ROLLBACK, ANALYZE, ALTER, DROP, REPLACE, TRUNCATE or CREATE statements?
    -Is there anything I can run, such as a database trace, that will show me exactly when the cursor is being closed? I admittedly don't know a lot about DB traces.
    -Anything else I should check? Any other information I should provide?
    Thanks ahead of time for any help!

    Chandrakaanth Ramamurthy wrote:
    Does the client customized PL/SQL block contain EXIT
    Exit will end up issuing a commit and hence this could be an issue.Exit is not used in the customized function.
    Chandrakaanth Ramamurthy wrote:
    Also please check that commit and roll back are placed at the end of the loop.The only commit/rollback is after the loop is over is finished.
    I actually just figured out the issue. Turns out the cursor just hadn't been opened due to a very unique data condition... facepalm You know what happens when you assume things, right? :)
    Thanks for the help anyway!

  • Proxy connections getting ORA-01001: invalid cursor

    All,
    I am having tremendous difficulty using Oracle proxy connections under WebSphere 5.1. The problem appears to be that the proxy sessions (or the logical connections) are not being closed properly resulting in 'invalid cursor' and 'fetch out of sequence' exceptions.
    Here's the sequence of events:
    Environment
    AppServer : Websphere 5.1
    Database : Oracle 10gR2
    Datesource: oracle.jdbc.pool.OracleConnectionPoolDataSource
    Start up application server
    Check the sessions on the db
    USERNAME                       TYPE       SERVER    MODULE
    * APAX                           USER       DEDICATED
    * APAX                           USER       DEDICATED
    SYS                            USER       DEDICATED sqlplus@apaxIIdb (TNS V1-V3)* = connection pool sessions
    Step 1: getting the connection
    // lookup datasource in jndi
    Connection myConnection = myDataSource.getConnection();Step 2: opening a proxy connection
    Properties myProperties = new Properties();
    myProperties.put("CONNECTION_TAG", aPrincipal);
    myProperties.put("PROXY_USER_NAME", aPrincipal);
    OracleConnection myOracleConnection =
      (OracleConnection) WSJdbcUtil.getNativeConnection((WSJdbcConnection) myConnection);
    myOracleConnection.openProxySession(OracleConnection.PROXYTYPE_USER_NAME, myProperties);Step 3: check the sessions on the db
    SQL>  select username, type, server, module
    from v$session
    where type != 'BACKGROUND'
    and username is not null
    order by username;
    USERNAME                       TYPE       SERVER    MODULE
    APAX                           USER       DEDICATED
    APAX                           USER       DEDICATED
    APAX                           USER       DEDICATED
    SYS                            USER       DEDICATED sqlplus@apaxIIdb (TNS V1-V3)
    * USER1                          USER       PSEUDO* = proxy connection
    Step 4: prepare and execute query
    myResultSet = myStatement.executeQuery();Exception thrown: java.sql.SQLException: ORA-01001: invalid cursor
    SQLState = 72000
    vendorCode = 1001
    Session information:
    USERNAME                       TYPE       SERVER    MODULE
    APAX                           USER       DEDICATED
    APAX                           USER       DEDICATED
    SYS                            USER       DEDICATED sqlplus@apaxIIdb (TNS V1-V3)
    * USER1                          USER       DEDICATED* = proxy session appears to have changed
    Step 5: clear up
    OracleConnection myOracleConnection =
      (OracleConnection) WSJdbcUtil.getNativeConnection((WSJdbcConnection) aConnection);
    myOracleConnection.close(OracleConnection.PROXY_SESSION);
    myOracleConnection.close();Check sessions again
    USERNAME                       TYPE       SERVER    MODULE
    APAX                           USER       DEDICATED
    APAX                           USER       DEDICATED
    SYS                            USER       DEDICATED sqlplus@apaxIIdb (TNS V1-V3)There are no Oracle udump files or other tracing information.
    Any ideas?

    We were getting ORA-01001 error messages that didn't appear to make sense when calling certain pl/sql procedures from a application running on a Weblogic/Apache platform. The errors would not occur when we invoked the same procedures via script from a standalone SQL client.
    We were able to put an end to the Web application errors by upgrading our jdbc driver from 10.1.0.4.0 to 10.2.0.1.0.

  • ORA-01001: invalid cursor (Inbound jdbc adapter XI 2.0)

    Hello, I get the error ORA-01001: invalid cursor when I try to delete the data in interface table in an ORACLE database. Has anybody an idea of what maybe the problem.
    here the text...
    14:41:59 (4225): Confirm with statement "delete * from sap_interface.aswaa00f"
    14:41:59 (4226): ERROR: Confirm action failed with error "java.sql.SQLException: ORA-01001: invalid cursor
    regards
    Ernesto Duran

    Hello Prasad, thank you for your response. The problem (limitation) was that the adapter (or the driver) can only update natives ORACLE tables and the table I wanted to update was a gateway table to an external program.
    regards
    Ernesto Duran

  • ORA-01001: invalid cursor

    I have the below code I am trying to execute and get the error ORA-01001: invalid cursor
    create or replace PROCEDURE TESTUPDATE(pNAME VARCHAR2,pID NUMBER) IS
      CN NUMBER;
       CURSOR C1 IS
       SELECT CODE,SOPTION,SFILE
              STREET1,
              STREET2
       FROM TABLE1
       WHERE CODE = '10';
       CURSOR C2 IS
       SELECT CODE,
              STREET1,
              STREET2
       FROM TABLE2
        WHERE CODE = '10;
        C1_REC C1%rowtype;
        C2_REC C2%rowtype;
    BEGIN
       OPEN C1;
       FETCH C1 INTO C1_REC;
       SELECT COUNT(*) INTO CN FROM TABLE2
       WHERE  code =  '10'
          IF ( C1_REC.SOPTION = 'C' )  THEN  --- SOPTION is 'C"
             IF (CN = 0) THEN 
                IF (C1_REC.SFILE = 'FILE') THEN
                   INSERT INTO TABLE2(ASSIGNED) VALUES('Y');
                    ELSE    
                   INSERT INTO TABLE2(ASSIGNED) VALUES('N');              
                END IF;   
             ELSE    /* CN > 0 */
               OPEN C2;
               FETCH C2 INTO C2_REC;
               IF (C1_REC.SFILE = 'FILE') THEN
                 IF ( C1_REC.STREET1 IS NOT NULL OR
                     C1_REC.STREET2 IS NOT NULL ) AND
                   ( C1_REC.STREET1 !=  C2_REC.STREET1 OR
                     C1_REC.STREET2 !=  C2_REC.STREET2) THEN
                  UPDATE TABLE2
                  SET    ASSIGNED = 'I';
                 END IF;
           ELSE  /*IS NOT EQUAL TO 'FILE'*/
                 IF ( C1_REC.STREET1 IS NOT NULL OR
                     C1_REC.STREET2 IS NOT NULL ) AND
                   ( C1_REC.STREET1 !=  C2_REC.STREET2 OR
                     C1_REC.STREET2 !=  C2_REC.STREET2) THEN
                  UPDATE TABLE2
                  SET    TABLE2_status_ind = 'N';
               END IF;
             END IF;
           END IF;
          ELSIF ( C1_REC.SOPTION = 'CR' ) THEN   /*SOPTION is 'CR"*/
             IF (CN = 0) THEN
                IF (C1_REC.SFILE = 'FILE') THEN
                   INSERT INTO TABLE2(ASSIGNED) VALUES('Y');
                    ELSE    
                   INSERT INTO TABLE2(ASSIGNED) VALUES('N'); 
                END IF;
         ELSE    /* CN > 0*/
               OPEN C2;
               FETCH C2 INTO C2_REC; 
               IF (C1_REC.SFILE = 'FILE') THEN
                 IF ( C1_REC.STREET1 IS NOT NULL OR
                     C1_REC.STREET2 IS NOT NULL ) AND
                   ( C1_REC.STREET1 !=  C2_REC.STREET2 OR
                     C1_REC.STREET2 !=  C2_REC.STREET2) THEN
                  UPDATE TABLE2
                  SET    TABLE2_status_ind = 'I';
                  END IF;             
            ELSE  /* IS NOT EQUAL TO 'FILE'*/
                 IF ( C1_REC.STREET1 IS NOT NULL OR
                     C1_REC.STREET2 IS NOT NULL ) AND
                   ( C1_REC.STREET1 !=  C2_REC.STREET2 OR
                     C1_REC.STREET2 !=  C2_REC.STREET2) THEN
                  UPDATE TABLE2
                  SET    TABLE2_status_ind = 'I';
                  END IF; 
           END IF;
         END IF;
    END IF;
    CLOSE C1;
    CLOSE C2;     
    END IF;
    EXCEPTION WHEN NO_DATA_FOUND THEN
                       dbms_output.put_line('e1');
      CLOSE C1;
    WHEN OTHERS THEN
            CLOSE C1;
            dbms_output.put_line('e2');
    END;when I have the soption as CR and cn=0, I get the error invalid cursor. Please help me with changes to the code to overcome this error
    thanks
    Edited by: 890563 on 14 Nov, 2012 5:37 AM
    Edited by: BluShadow on 14-Nov-2012 13:39
    added {noformat}{noformat} tags to make code readable.  After 48 questions (of which you still have 40 unanswered for some reason?) and a year on the forums, we would expect you to have learnt how to ask questions... but just in case you missed it... read here: {message:id=9360002}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    I am sorry for posting such confusing code. I changed the last part of code code to
    END IF;
    END IF;
    CLOSE C1;
    CLOSE C2;
    END IF;
    END IF;
    EXCEPTION WHEN NO_DATA_FOUND THEN
    dbms_output.put_line('e1');
    CLOSE C1;
    WHEN OTHERS THEN
    CLOSE C1;
    dbms_output.put_line('e2');
    END;
    and it worked with out errors
    Thanks

  • Getting ORA-01001: invalid cursor when I try to parse my SQL statement with DBMS_SQL

    -- To modify this template, edit file PROC.TXT in TEMPLATE
    -- directory of SQL Navigator
    -- Purpose: Briefly explain the functionality of the procedure
    -- MODIFICATION HISTORY
    -- Person Date Comments
    TYPE column_find IS VARRAY(999) of VARCHAR2(4);
    v_client_column varchar2(4);
    v_errorcode NUMBER;
    v_errortext VARCHAR2(200);
    i number :=0;
    V_COLUMN_NAME varchar2(20);
    V_COLUMN_NAME2 varchar2(20);
    v_SQL_STMT varchar2(2000);
    v_c_hndl integer;
    v_Client_ID varchar2(200);
    column_name varchar2(20);
    execute_feedback integer;
    mal material_attribute_pre_load%
    ROWTYPE;
    local_var varchar2(200);
    clienttab DBMS_SQL.DATE_TABLE;
    client_column column_find := column_find();
    -- Declare program variables as shown above
    BEGIN
    --client_column := column_find();
    v_c_hndl := DBMS_SQL.OPEN_CURSOR;
    while i < 999
    LOOP
    i := i + 1;
    client_column.EXTEND;
    client_column(i) := CONCAT('c',i);
    dbms_output.put_line(client_column(i));
    BEGIN
    dbms_output.put_line('Starting SQL_STMT.');
    v_SQL_STMT := 'SELECT :column_name FROM
    MATERIAL_ATTRIBUTE_PRE_LOAD WHERE :column_name2 = :v_Client_ID';
    dbms_output.put_line('Starting DBMS_SQL.PARSE.');
    DBMS_SQL.PARSE(v_c_hndl,v_SQL_STMT,DBMS_SQL.NATIVE);
    dbms_output.put_line('Starting DBMS_SQL.BIND_VARIABLE.');
    DBMS_SQL.BIND_VARIABLE
    (v_c_hndl,'v_Client_ID','Client ID');
    DBMS_SQL.BIND_VARIABLE
    (v_c_hndl,'column_name',client_column(i));
    DBMS_SQL.BIND_VARIABLE
    (v_c_hndl,'column_name2',client_column(i));
    dbms_output.put_line('Starting DBMS_SQL.DEFINE_ARRAY.');
    DBMS_SQL.DEFINE_ARRAY(v_c_hndl,1,clienttab,999,1);
    execute_feedback := DBMS_SQL.EXECUTE_AND_FETCH
    (v_c_hndl);
    DBMS_SQL.CLOSE_CURSOR(v_c_hndl);
    dbms_output.put_line
    EXCEPTION
    WHEN OTHERS THEN
    v_errorcode := SQLCODE;
    v_errortext := SUBSTR(SQLERRM,1,200);
    dbms_output.put_line('DISPLAY_ERROR'||SUBSTR(TO_CHAR
    (v_errorcode)||v_errortext,1,30));
    END;
    END LOOP;
    EXCEPTION
    WHEN OTHERS THEN
    v_errorcode := SQLCODE;
    v_errortext := SUBSTR(SQLERRM,1,200);
    dbms_output.put_line('DISPLAY_ERROR'||SUBSTR(TO_CHAR
    (v_errorcode)||v_errortext,1,30));
    END; -- Procedure COLUMN_FIND

    I'm using Oracle Database Express edition (latest version from the website afaik), logging into the web interface (using unique account I created after setup[not System], gave it All rights), clicking on SQL > SQL Commands > Enter commands.
    I can't run each insert individually, that is only 1 table out of 8 tables, and I probably need to be able to run the entire script (which is actually headed by a sequence of Drop Table commands) sometimes, to refresh the data back to original values in case I stuff things up. The code was originally provided in a text file called bookscript.sql, but I haven't had any success importing or uploading that file into Oracle XE, if I use SQL > SQL Scripts > Upload, the file uploads, I then click on it and click on Run, but nothing seems to happen. (File is shared [read-only] here: https://docs.google.com/leaf?id=0B7IgBXIBNxw3OTY1ZTdmNGQtMjEwYi00YmRmLTkwZjItODZkYmYxODNkMTk4&hl=en_US).
    Would love any guidance as to how to modify my environment or how to input the code differently to get it running, it works fine in the hosted environment at Uni, it's an Oracle class (textbook is Guide to Oracle 10g). Lecturer doesn't seem to know much about setting up Oracle, only working in a functioning environment.

  • Please help: Case Statement - ORA-01722: invalid number Error

    Hi All,
    I'm trying to use Case statement to recode Cancelled statuses into two groups
    'Reject' if the difference between first date and last date is less than 29 and
    'Accept' if the difference between first date and last date is greater than 30
    Here is my 'test' data:
    STATUS     FIRST_DATE     LAST_DATE
    Transfer     10/08/2011     10/09/2011
    Mover     10/08/2011     15/09/2011
    Cancel     10/08/2011     16/09/2011
    Cancel     10/08/2011     5/09/2011
    Here is the syntax
    select a.*,
    (CASE WHEN a.STATUS ='Cancel' THEN (round(a.LAST_DATE-a.FIRST_DATE))
    ELSE 0
    END) CAN_DAYS,
    (CASE WHEN 'CAN_DAYS' >29 THEN 'Reject'
    WHEN 'CAN_DAYS' <30 THEN 'Accept'
    END) Reject_Accept
    from test a
    The first CASE statement works fine and gives me this
    STATUS     FIRST_DATE     LAST_DATE     CAN_DAYS
    Transfer     10/08/2011     10/09/2011     0
    Mover     10/08/2011     15/09/2011     0
    Cancel     10/08/2011     16/09/2011     37
    Cancel     10/08/2011     5/09/2011     26
    but the second CASE produces ORA-01722: invalid number Error. It is something to do with the CAN_DAYS data type, Oracle doesn't see it as Numeric i think.
    The result i want to see would be
    STATUS     FIRST_DATE     LAST_DATE     CAN_DAYS Reject_Accept
    Transfer     10/08/2011     10/09/2011     0
    Mover     10/08/2011     15/09/2011     0
    Cancel     10/08/2011     16/09/2011     37 Accept
    Cancel     10/08/2011     5/09/2011     26 Reject
    Could someone please help me to fix the syntax?
    Thank you in advance,

    This seems to give you your desired results...
    with test as
      ( select 'Transfer' as status, to_date('10/08/2011') as first_date, to_date('10/09/2011') as last_date  from dual union all
        select 'Mover'             , to_date('10/08/2011')              , to_date('15/09/2011')               from dual union all
        select 'Cancel'            , to_date('10/08/2011')              , to_date('16/09/2011')               from dual union all
        select 'Cancel'            , to_date('10/08/2011')              , to_date('05/09/2011')               from dual
    select  status
         ,  first_date
         ,  last_date
         ,  CAN_DAYS
         ,  CASE
              WHEN CAN_DAYS =   0 THEN NULL
              WHEN CAN_DAYS <  30 THEN 'Reject'
              WHEN CAN_DAYS >= 30 THEN 'Accept'
            END  Reject_Accept
      from  ( select  status
                   ,  first_date
                   ,  last_date
                   ,  CASE
                        WHEN STATUS ='Cancel' THEN round(LAST_DATE-FIRST_DATE)
                        ELSE 0
                      END  CAN_DAYS
                from  test
    ;

  • Recieving ORA-01722 invalid number error while creating a materialized view

    Hi,
    I am receiving a ORA-01722 invalid number error while creating a materialized view. when run the select statement of the view i don't get any error, but when i use the same select statement to create a materialized view i receive this error. Could any please help in resolving this error. Here is the code i am using to create a materialized view.
    CREATE MATERIALIZED VIEW MV_EBS_CH_CLOSED
    REFRESH FORCE ON DEMAND
    AS
    SELECT DISTINCT kr.request_id, org.org_unit_name,
    ebs_ch_ticket_type (kr.request_id) ticket_type,
    DECODE
    (kr.status_code,
    'CLOSED_SUCCESS', kr.last_update_date,
    'IN_PROGRESS', (SELECT MAX (start_time)
    FROM ebs_ch_datastore ecd1
    WHERE kr.request_id = ecd1.request_id
    AND workflow_step_name =
    'Final BA Review and Deployment Exit Criteria')
    ) closed_date,
    substr(krhd.visible_parameter12,1,10) siebel_start_date,
    kr.creation_date itg_start_date
    FROM kcrt_requests kr,
    kcrt_request_types krt,
    kcrt_req_header_details krhd, kcrt_request_details krd1,
    (SELECT koum.user_id user_id,
    DECODE (koup.org_unit_name,
    'IT Implementations', 'CHS - Service Management BA',
    koup.org_unit_name
    ) org_unit_name
    FROM krsc_org_unit_members koum, krsc_org_units koup
    WHERE 1 = 1
    AND 'Y' = koup.enabled_flag
    AND koum.org_unit_id = koup.org_unit_id
    AND EXISTS (
    SELECT 'X'
    FROM krsc_org_units kouc
    WHERE koup.org_unit_id = kouc.org_unit_id
    START WITH kouc.parent_org_unit_id =
    ANY (SELECT org_unit_id
    FROM krsc_org_units krsc_org_units1
    WHERE 'Clearinghouse' =
    org_unit_name)
    CONNECT BY kouc.parent_org_unit_id =
    PRIOR kouc.org_unit_id)
    UNION
    SELECT kou.manager_id user_id,
    DECODE
    (kou.org_unit_name,
    'IT Implementations', 'CHS - Service Management BA',
    kou.org_unit_name
    ) org_unit_name
    FROM krsc_org_units kou
    WHERE 'Y' = kou.enabled_flag
    START WITH kou.parent_org_unit_id =
    (SELECT org_unit_id
    FROM krsc_org_units krsc_org_units2
    WHERE 'Clearinghouse' = org_unit_name)
    CONNECT BY kou.parent_org_unit_id = PRIOR kou.org_unit_id) org
    WHERE krt.request_type_id = kr.request_type_id
    AND krt.request_type_name IN ('Bug Fix', 'IT Enhancement')
    and kr.REQUEST_ID = krd1.request_id
    and krd1.batch_number = 1
    AND kr.request_id = krhd.request_id
    AND org.user_id in (krd1.parameter4, krd1.parameter5, krd1.parameter7)
    AND ( 'CLOSED_SUCCESS' = kr.status_code
    OR 'IN_PROGRESS' = kr.status_code
    AND kr.request_id IN (
    SELECT request_id
    FROM (SELECT DISTINCT request_id,
    MAX
    (start_time)
    closed_date
    FROM ebs_ch_datastore
    WHERE 'Final BA Review and Deployment Exit Criteria' =
    workflow_step_name
    GROUP BY request_id))
    Thanks,
    Shaik Mohiuddin

    This error occurs when you try to create a materialized view , but if you run the sql the results are perfectly fine. Well it happend to me also and to fix this I made sure all the coulmns have the same data type which are used in joins or in where clause.
    use
    where
    to_number(col1)=to_number(col2) and to_number(col3)=to_number(col4)
    hope this helps..

  • Ora-01722 invalid number error within view

    Hi, in my oracle 9.2.0.4.0 db, under TEST schema i've a view called PRODUTTIVITA_LINEE. I'm trying to create another view joining PRODUTTIVITA_LINEE with a table called LINEE. But when i execute the select (SELECT PRODUTTIVITA_LINEE.*, LINEE.NAME FROM PRODUTTIVITA_LINEE, LINEE WHERE PRODUTTIVITA_LINEE.LINEA_ID = LINEE.LINEA_ID), i obtain the ORA-01722 invalid number error.
    But if i create a table PRODUTTIVITA_SUPPORT as select all fields from PRODUTTIVITA_LINEE and i use it in the new query (SELECT PRODUTTIVITA_SUPPORT.*, LINEE.NAME FROM PRODUTTIVITA_SUPPORT, LINEE WHERE PRODUTTIVITA_SUPPORT.LINEA_ID = LINEE.LINEA_ID), all works.
    Using the view, the new query doesn't work, but using the same data toke from a table instead of view, all works. Why?

    Excuse me but i send modified script. Here the original script of object.
    SQL> desc PRODUTTIVITA_LINEE;
    Nome                               Nullo?   Tipe
    LINEA_ID                   NUMBER(9)           
    COD_LINEA_ANDATA                 VARCHAR2(8)        
    COD_LINEA_RITORNO                VARCHAR2(4)        
    ID_TRAT_PIC_ANDATA                NUMBER               
    ID_TRAT_PIC_RITORNO               NUMBER               
    DESC_LINEA                              VARCHAR2(120)     
    EKM_NOMINALI                         NUMBER                 
    EKM_SCONTATI                        NUMBER                 
    KMLINEA                                  NUMBER                 
    ANNO                                       NUMBER                  SQL> desc PRODUTTIVITA_SUPPORT;
    Nome                           Nullo?     Tipe
    LINEA_ID             NUMBER(9)
    COD_LINEA_ANDATA           VARCHAR2(8)
    COD_LINEA_RITORNO          VARCHAR2(4)
    ID_TRAT_PIC_ANDATA          NUMBER
    ID_TRAT_PIC_RITORNO         NUMBER
    DESC_LINEA                      VARCHAR2(120)
    EKM_NOMINALI                     NUMBER
    EKM_SCONTATI                   NUMBER
    KMLINEA                            NUMBER
    ANNO                                NUMBER Both objects have 5400 records and are the same.

  • How to determine offending column in ORA-01722: invalid number error ...

    When an error like
    ORA-01722: invalid number error
    occurs and you are dealing with many columns that could be the 'culprit', does anyone have a method by which
    you can quickly determine offending column?

    SQL PLus will tell you:
    SQL> create table t
      2  (col1  number
      3  ,col2  number
      4  ,col3  number
      5  ,col4  number
      6  ,col5  number
      7  );
    Table created.
    SQL> create table x
      2  (col1  varchar2(10)
      3  ,col2  varchar2(10)
      4  ,col3  varchar2(10)
      5  ,col4  varchar2(10)
      6  ,col5  varchar2(10)
      7  );
    Table created.
    SQL> insert into x values ('1','2','x','4','5');
    1 row created.
    SQL> insert into t(col1,col2,col3,col4,col5)
      2  select col1,col2,col3,col4,col5 from x;
    select col1,col2,col3,col4,col5 from x
    ERROR at line 2:
    ORA-01722: invalid numberAnd if you rearrange your sql like this, sql plus will give you the line number of the offending column:
    SQL> insert into t
      2  (col1
      3  ,col2
      4  ,col3
      5  ,col4
      6  ,col5
      7  )
      8  select col1
      9        ,col2
    10        ,col3
    11        ,col4
    12        ,col5
    13  from x;
          ,col3
    ERROR at line 10:
    ORA-01722: invalid number

  • ORA-01722: invalid number error. In Update

    create or replace procedure San_Test (sInNum varchar2, outMsg out varchar2)
    is
    begin
    update mtest set
    mname = 'Success'
    where id in (sInNum);
    commit;
    outMsg :='Success';
    exception
    when others then
    outMsg :='Err';
    dbms_output.put_line(sqlerrm);
    end;
    This is my test sp where i am getting ORA-01722: invalid number error.
    Which is because the column data type is Number of ID and i have sInNum parameter as varchar2.. How can i achieve this ?
    I don't have other way to do this please help.

    Great demonstration for SQL INJECTION, was that part of your OCP training?
    CREATE TABLE mtest (id NUMBER, mname VARCHAR2(255));
    INSERT INTO mtest VALUES (1, 'test');
    INSERT INTO mtest VALUES (2, 'test2');
    COMMIT;
    CREATE OR REPLACE PROCEDURE san_test (sinnum VARCHAR2, outmsg OUT VARCHAR2)
    IS
       mnum     VARCHAR2 (10);
       strsql   VARCHAR2 (250);
    BEGIN
       mnum := REPLACE (sinnum, '''', '');
       strsql :=
           'update mtest set
    mname = ''Success''
    where id in (' || mnum || ')';
       EXECUTE IMMEDIATE strsql;
       COMMIT;
       outmsg := 'Success';
    EXCEPTION
       WHEN OTHERS
       THEN
          outmsg := 'Err';
          DBMS_OUTPUT.put_line (SQLERRM);
    END;
    SELECT *
      FROM mtest;
            ID MNAME
             1 test
             2 test2And now for the fun part:
    SET SERVEROUTPUT ON
    DECLARE 
      v_put_msg VARCHAR2(255);
    BEGIN
      san_test('1) OR (1=1', v_put_msg);
      dbms_output.put_line(v_put_msg);
      COMMIT;
    END;
    SELECT *
      FROM mtest;
            ID MNAME
             1 Success
             2 SuccessC.

  • ORA-01722: invalid number (Error in Application after upgrade to 3.0)

    Dear All,
    After upgrading to 3.0 I am no longer able to login to my application. The error I am seeing is:
    ORA-01722: invalid number
         Error      Could not process show_hide_memory.show_hide_collection_output procedure !
    Please help me pin-point the issue and fixed it.
    This happens in some applications but in others it doesn't...
    Regards,
    Pawel.

    I believe I have found the source of the problem!
    This is coming from the sample application which was used for the show/hide of regions example.
    The code behind the above procedure is:
    CREATE OR REPLACE
    PACKAGE show_hide_memory AS
    PROCEDURE show_hide_collection;
    PROCEDURE show_hide_collection_output;
    END;
    CREATE OR REPLACE PACKAGE BODY show_hide_memory AS
    PROCEDURE show_hide_collection AS
    l_arr apex_application_global.vc_arr2;
    l_found boolean := FALSE;
    l_collection_name VARCHAR2(255) := 'SHOW_HIDE_COLLECTION';
    BEGIN
    IF(wwv_flow_collection.collection_exists(p_collection_name => l_collection_name) = FALSE) THEN
    htmldb_collection.create_or_truncate_collection(p_collection_name => l_collection_name);
    END IF;
    l_arr := apex_util.string_to_table(p_string => v('TEMPORARY_ITEM'), p_separator => ']');
    -- If the array member count of l_arr < 3, then the following code will raise an exception
    FOR c1 IN
    (SELECT seq_id
    FROM apex_collections
    WHERE collection_name = l_collection_name
    AND c001 = l_arr(1)
    AND c002 = l_arr(2)
    AND c003 = l_arr(3))
    LOOP
    -- It exists, so delete it
    apex_collection.delete_member(p_collection_name => l_collection_name, p_seq => c1.seq_id);
    l_found := TRUE;
    END LOOP;
    IF l_found = FALSE THEN
    apex_collection.add_member(p_collection_name => l_collection_name, p_c001 => l_arr(1), p_c002 => l_arr(2), p_c003 => l_arr(3));
    END IF;
    COMMIT;
    END show_hide_collection;
    PROCEDURE show_hide_collection_output AS
    BEGIN
    htp.prn('<script type="text/javascript">' || CHR(10));
    htp.prn('<!--' || CHR(10));
    htp.prn('window.onload=function(){' || CHR(10));
    FOR c1 IN
    (SELECT c003
    FROM apex_collections
    WHERE collection_name = 'SHOW_HIDE_COLLECTION'
    AND c001 = wwv_flow.g_flow_id
    AND c002 = wwv_flow.g_flow_step_id)
    LOOP
    htp.prn('htmldb_ToggleWithImage(''' || c1.c003 || 'img'',''' || c1.c003 || 'body'');' || CHR(10));
    END LOOP;
    htp.prn('}' || CHR(10));
    htp.prn('//-->' || CHR(10));
    htp.prn('</script>' || CHR(10));
    END show_hide_collection_output;
    END;
    I guess now I have to find the bug in the above code !

  • ORA-01722 Invalid Number Error - report parameter

    I have a report which runs successfully using the following simple select statement: -
    select u.user_id, u.user_forename||' '||u.user_surname user_name,
    fo.flight_number_in, fo.sta, fo.ata, fo.flight_number_out, fo.std, fo.atd
    from users u, flight_operations_employees foe, flight_operations fo
    where NVL(fo.sta, fo.std) between :P_Start and :P_End and
    fo.record_number = foe.record_number and
    u.user_id = foe.user_id
    order by u.user_surname
    Where P_Start and P_End are parameters passed from a form. I want to add further user option selections for the report and have added another parameter (P_inClause) where the user can select one or more items to select from. The column selected is a number on the table. I then want to pass this as another parameter into the report listing a number of valid values using the IN statement. The updated select statement is: -
    select u.user_id, u.user_forename||' '||u.user_surname user_name,
    fo.flight_number_in, fo.sta, fo.ata, fo.flight_number_out, fo.std, fo.atd
    from users u, flight_operations_employees foe, flight_operations fo
    where NVL(fo.sta, fo.std) between :P_Start and :P_End and
    fo.record_number = foe.record_number and
    u.user_id = foe.user_id and
    u.user_id IN :P_inClauseorder by u.user_surname
    u.user_id is a number column in the table. The value of P_inClause is set as a character parameter in the report and has the value (45,5,13,26) - as an example.
    When I try running the report interactively it comes up with the ORA-01722 : Invalid Number error and points to the P_inClause parameter. If I type in the value directly into the select statement it works fine.
    Do you have any ideas as to how I can make this work?
    Regards
    Edited by: Buzzer on Apr 13, 2011 12:44 PM

    You can search this forum for "in clause", e.g.:
    Re: how to pass values to where conditon

  • Why do I get a "DATE1 : ORA-00904 Invalid identifier" error ?

    Hi,
    Despite my efforts, I can't see why I get a "DATE1 : ORA-00904 Invalid identifier' error whith this request.
    {code}With S1 as (
    SELECT TRUNC(DATE1, 'MM'),
    ROUND(SUM(VALEUR), 2)
    FROM EVV_E036
    GROUP BY TRUNC(DATE1, 'MM')
    ORDER BY TRUNC(DATE1, 'MM'))
    SELECT n,
    NVL(ROUND(SUM(Valeur),2), 0)
    FROM (select add_months(to_date('01/01/2006', 'dd/mm/yyyy'), level - 1) n FROM dual connect by level <= 12) months
    LEFT JOIN S1
    ON months.n = TRUNC(DATE1, 'MM')
    GROUP BY n
    ORDER BY n{code}
    The line in error is this one : {code}ON months.n = TRUNC(DATE1, 'MM'){code}
    Any idea much appreciated !
    Regards,
    Christian

    hi,
    I have done this and get no more errors. Now I see that the values I get are equal to 0. Or, I do get values different from 0 in my table ! I can't see why the left join gives 0. I have to dig this and come back tomorrow.
    With S1 as (
    SELECT TRUNC(DATE1, 'MM') Date1,
           ROUND(SUM(VALEUR), 2) Debit
    FROM   EVV_E036
    WHERE  CLEF_VAR = (SELECT CLEF_VAR FROM SITE_ECHELLE WHERE SITE = 'E036')
    AND    DATE1 BETWEEN TO_DATE ('01/01/2007000000', 'DD/MM/YYYYHH24MISS') AND TO_DATE ('31/12/2007235959', 'DD/MM/YYYYHH24MISS')
    GROUP  BY TRUNC(DATE1, 'MM')
    ORDER  BY TRUNC(DATE1, 'MM'))
    SELECT n,
           NVL(ROUND(SUM(Debit),2), 0)
    FROM   (select add_months(to_date('01/01/2006', 'dd/mm/yyyy'), level - 1) n FROM dual connect by level <= 12) months
    LEFT JOIN S1
         ON months.n = date1
    GROUP BY n
    ORDER BY n

Maybe you are looking for

  • New OracleConnection hangs in VS 2005 debug mode

    Client 10.2.3, ODT 10.2.0.21 for Vista, VS2005sp1, Vista Sp1 Everything has been working great until I tried to debug a service for the first time since last week. Now no matter what I do, a call to create a new OracleConnection locks up the VS debug

  • Help with windows 8 and adobe reader

    adobe reader wont open pdf file in a browser window how do i fix this in windows 8

  • How to get previous version DC

    to revort changes made by us

  • Issue with AMD/ATI 11-3 driver and Photoshop on Windows.

    The latest AMD/ATI drivers for Radeon HD cards (4xxx, 5xxx, and 6xxx series), 11-3, breaks Normal and Advanced OpenGL modes in Photoshop on Windows. Note that this does not occur with 11-1 or 11-2 drivers on the same system. We recommend you stick wi

  • Cannot move files with Finder

    Experiencing erratic behavior with Finder.  I am trying to move several files from a folder to the application "PDF Toolkit" and clicking dragging is not working. Are there settings that alter click drag behavior?  Can Finder be reset?