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.

Similar Messages

  • 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

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

  • 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

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

  • HT4623 I get error message "invalid email" when I try to log into sites

    I get an "invalid email" whenever I try to log into a site with my apple phone and ipad. It is the same email I have used for 15 years.

    Thank you thank you thank you.  I removed the Babylon program and now I can print PDF files,   thanks for your time and effort.  I was going crazy.  I appreciate you taking the time to answer my inquiry.     Cmnman9

  • 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!

  • I keep getting invalid signature when I try to downloand itunes 11.1.  I have tried to just do a download and i have tried to change internet options to accept downloads without valid signature.  but it still does not work.  anyone have suggestions?

    I keep getting invalid signature when I try to downloand itunes 11.1.  I have tried to just do a download and i have tried to change internet options to accept downloads without valid signature.  but it still does not work.  anyone have suggestions?

    I just tested it (on 10.6.8) and it worked perfectly well, so it may be something on your computer. You could try creating a new user account on your Mac and using that to try downloading. You can then install on that account and it will be available on your normal one.

  • ORA-01722: invalid number - when last column has numbers that has a decimal seperator

    Below is the sample data -
    FRT,1.64,VAT,23.36
    FRT,1.64,VAT,23.36
    When I try to convert 1.64 to to_number all is good but when I do the same with 23.36 I get the following error
    ORA-29913: error in executing ODCIEXTTABLEFETCH callout
    ORA-01722: invalid number
    ORA-06512: at "SYS.ORACLE_LOADER", line 52
    I tried this query as well
    select to_number(CONSIGNMENT_NET_VALUE) as Col1 from DUMP_EXT
    select to_number(CONSIGNMENT_NET_VALUE,'9999999999D99999','NLS_NUMERIC_CHARACTERS='',.''' ) as Col1 from DUMP_EXT --> 268906.1
    getting the same error - any help greatly appreciated.
    T.
    Srini

    Hi,
    You can check this test case
    SQL> !cat a.txt
    FRT,1.64,VAT,23.36
    FRT,1.64,VAT,56.36
    FRT,1.64,VAT,23.36
    SQL> create table DUMP_EXT
        Charge_ID_FRT VARCHAR2(50),
        Net_Amount_VAT VARCHAR2(50),
        Charge_ID_VAT VARCHAR2(50),
        Consignment_Net_Value VARCHAR2(50)
    ORGANIZATION EXTERNAL
        (TYPE ORACLE_LOADER
        DEFAULT DIRECTORY DATA_DD_DIR
        ACCESS PARAMETERS
            (RECORDS DELIMITED BY '\n'
            SKIP 1
            BADFILE 'bad_%a_%p.bad'
            LOGFILE 'log.log'
            FIELDS TERMINATED BY ','
            MISSING FIELD VALUES ARE NULL
            REJECT ROWS WITH ALL NULL FIELDS
                Charge_ID_FRT CHAR(50),
                Net_Amount_VAT CHAR(50),
                Charge_ID_VAT CHAR(50),
                Consignment_Net_Value CHAR(50)
        LOCATION ('a.txt')
    reject limit 0;
      2    3    4    5    6    7    8    9   10   11   12   13   14   15   16   17   18   19   20   21   22   23   24   25   26   27   28 
    Table created.
    SQL> select charge_id_frt,net_amount_vat,charge_id_vat,consignment_net_value from dump_ext;
    CHARG NET_AMOUNT_VAT                                     CHARG CONSIGNMENT_NET_VALUE
    FRT   1.64                                               VAT   56.36
    FRT   1.64                                               VAT   23.36
    --- Get Error here
    SQL> select to_number(CONSIGNMENT_NET_VALUE,'99D99','NLS_NUMERIC_CHARACTERS='',.''' ) as Col1 from DUMP_EXT
      2  /
    select to_number(CONSIGNMENT_NET_VALUE,'99D99','NLS_NUMERIC_CHARACTERS='',.''' ) as Col1 from DUMP_EXT
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEFETCH callout
    ORA-01722: invalid number
    -- Check the Variable at DB level
    SQL>   SELECT value   FROM NLS_DATABASE_PARAMETERS  WHERE parameter='NLS_NUMERIC_CHARACTERS';
    VALUE
    -- Use the Query like
    SQL> select to_number(CONSIGNMENT_NET_VALUE,'99D99','NLS_NUMERIC_CHARACTERS=''.,''' ) as Col1 from DUMP_EXT;
          COL1
         56.36
         23.36
    HTH

  • Update statement getting ORA-00904 invalid identifier

    I am getting this ORA error when I try to conduct an update statement from a column value in one table to a like-named column in another table.
    For instance, in my select, shown below, this query runs like a champ, returning all of my records
    SELECT
    b.ID,
    b.ZIP, a.ZIP,
    a.NAME,
    a.LOCATION
    FROM TBL_ARCHIVE a
    INNER JOIN TBL_UAT b ON
    a.ID = b.ID
    WHERE
    b.ID > 470000  And b.ID <470100;However, if I try to run an update statement with any of the following, I get this error. It seems so strange to me that I'd get an error using the same columns in the update statement, but would return the desired results effectively from the select statement!
    one version of UPDATE
    UPDATE TBL_ARCHIVE a
    SET a.ZIP = TBL_UAT.ZIP
    WHERE TBL_UAT.ID = a.ID;and another
    UPDATE TBL_ARCHIVE
    SET a.ZIP  =
    (SELECT b.ZIP
    FROM TBL_UAT b
    WHERE b.ID <472500 And b.ID >471000)
    FROM TBL_ARCHIVE a
    WHERE a.ID = b.ID)
    WHERE ID IN
    (SELECT ID
    FROM TBL_UAT b
    WHERE b.ID  <472500 And b.ID >471000
    );^ - this one produces a SQL not properly ended. Error ORA-00933: SQL command not properly ended.
    I'm really unsure though, how what I thought was a fairly basic update statement wouldn't work. I'm using Oracle 11g but through either Toad or SQL Plus. I've gotten these same errors in both.
    Though MS Access runs slow as snails, I can manage to run the update statement successfully with it, a thousand records or so at a time. Problem is, I've got about 300K records needing updating.
    I've looked around for similar problems but haven't found one where someone wasn't either using a reserved word for a column, which I'm not, I don't believe, or a problem that really dealt with this error in the context of an update statement.
    But I'd welcome any enlightenment on this.

    rp0428 wrote:
    UPDATE TBL_ARCHIVE a
    SET a.ZIP = TBL_UAT.ZIP
    WHERE TBL_UAT.ID = a.ID;That isn't a valid query and neither is the other one.
    Please post the actual query you are using and the actual complete error message you are getting (everything about the error that is displayed).^^
    That is NOT a valid query?
    How else would you have an UPDATE statement created to set the value of a column in table A to the value of a (in this case, same named) column in table B?
    And keep them in order to update the records appropriately?
    I'll append the create statements momentarily.
    Thanks!
    CREATE TABLE TBL_UAT
    ( ID NUMBER(6),
    ZIP VARCHAR2(10 BYTE) ) and
    CREATE TABLE TBL_ARCHIVE
    ( ID NUMBER(6) NOT NULL, NAME VARCHAR2(50 BYTE),
    EMAIL VARCHAR2(50 BYTE),
    LOCATION VARCHAR2(50 BYTE),
    DEPARTMENT VARCHAR2(50 BYTE),
    PRIORITY VARCHAR2(50 BYTE),
    APPROVING_MGR_NAME VARCHAR2(50 BYTE),
    TYPE1 VARCHAR2(50 BYTE),
    TYPE2 VARCHAR2(50 BYTE),
    CONTACT_NAME VARCHAR2(50 BYTE),
    CONTACT_PHN_NO VARCHAR2(50 BYTE),
    LOAN_NUM VARCHAR2(50 BYTE),
    REF_ID VARCHAR2(50 BYTE),
    BORROWER_NAME VARCHAR2(50 BYTE),
    ADDRESS VARCHAR2(50 BYTE),
    CITY VARCHAR2(50 BYTE),
    ST VARCHAR2(50 BYTE),
    ZIP VARCHAR2(10 BYTE),
    SALE_DATE DATE,
    COMMENTS VARCHAR2(800 BYTE),
    TIME_REQ DATE,
    ACCTLOC VARCHAR2(50 BYTE),
    OTHER_ACCTLOC VARCHAR2(50 BYTE)) Hope this can be of assistance.
    Thanks, folks!
    Edited by: user515689 on Feb 7, 2012 11:59 AM

  • ORA-10722 Invalid Number when trying to Associate Asset to Activity

    Hello experts,
    For Activities created by API, we are getting an error (ORA-10722 Invalid Number) when attempting to associate a asset to the activity using the activity Association Form. Has anyone run across this before?
    Thanks,
    Tom

    ORA-01722: invalid number
    It can be because of The attempted conversion of a character string to a number failed because the character string was not a valid numeric literal.
    Only numeric fields or character fields containing numeric data may be used in arithmetic functions or expressions.
    Only numeric fields may be added to or subtracted from dates.
    Check the character strings in the function or expression.
    Check that they contain only numbers, a sign, a decimal point, and the character "E" or "e" and retry the operation .
    Check API design.
    Regards
    Kamal

  • Requesting help-On a report Getting ora-00920 invalid relational operator.

    Hi everyone,
    I am having a report region with the following query:
    select CASE
    WHEN ISITRECENTADDENDUM(meckey_fk,code)
    THEN
    '<a href="javascript:popUp2('''
                   || 'f?p=&APP_ID.:61:&SESSION.::NO::P61_MECKEY_FK:'
                   || &P60_MECKEY.
                   || ''', 700, 700);">'
    || '<img src="#IMAGE_PREFIX#gobut.gif">'
    || '</a>'
    ELSE NULL
    END EditAddendum,
    '<a href="javascript:popURL('''
                   ||'&REPORTS_URL.keynewmec&P_1=&P60_MECNUM.'
                   || ''', 700, 700);">'
    || '<img src="#WORKSPACE_IMAGES#printer.jpg">'
    || '</a>'
    PrintMEC,
    "CODE",
    "MECKEY_FK",
    "ADDENDUM",
    "WHO_CREATED",
    "WHEN_CREATED"
    from "C_ADDENDUMS"
    where "MECKEY_FK" = v('P60_MECKEY')
    And my function returning boolean is as follows:
    create or replace FUNCTION "ISITRECENTADDENDUM"
    (meckeyi in number,
    codei in varchar2)
    return Boolean
    is
    x varchar2(1);
    begin
    select max(code) into x from c_addendums where meckey_fk = meckeyi;
    if x = codei then
    return true;
    else
    return false;
    end if;
    exception
    when others then
    return FALSE;
    end;
    But I am getting ORA-00920 invalid relational operator. Can anyone please help me out? I am not knowing where the error is. When I run the function by itself I am getting "False" returned as expected. Appreciate any advice on this.
    Rgds,
    Suma.

    Suma,
    It looks like what you are trying to do is display a link for the record with the highest value in the Code column, and nothing for the other records.
    If that is the case, you can eliminate the function and just use a SQL query like this:
    (not tested)
    select CASE
              WHEN code = Max(code) over (partition by meckey_fk)
                 THEN
                   '<a href="#">'
                   || ' '
                   || '< img class="TargetAlertIcon" src="chrome://targetalert/content/skin/internal.png"></a>'
              ELSE NULL
           END EditAddendum,
           '<a href="#">'
           || ' '
           || '< img class="TargetAlertIcon" src="chrome://targetalert/content/skin/internal.png"></a>' PrintMEC,
           "CODE", "MECKEY_FK", "ADDENDUM", "WHO_CREATED", "WHEN_CREATED"
      from "C_ADDENDUMS"
    where "MECKEY_FK" = :P60_MECKEYIs that what you're trying to do?
    Doug

  • I downloaded 11.1 but now can't access the store, can only view my library. I've reinstalled but still get a blank, white screen when I try to go to the itunes store. How can I get to the store for purchases?

    I downloaded 11.1 but now can't access the store, can only view my library. I've reinstalled but still get a blank, white screen when I try to go to the itunes store. How can I get to the store for purchases?

    In iTunes prefs>Store - is the Store check box unchecked?
    Did you repair pemissions with Disk Utility?
    MJ

  • What is missing when I get a blank white screen when I try to Access some web sites?

    On some web sites, I get a blank white screen when I try to access them.

    You can try these steps in case of issues with web pages:
    You can reload web page(s) and bypass the cache to refresh possibly outdated or corrupted files.
    *Hold down the Shift key and left-click the Reload button
    *Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    *Press "Command + Shift + R" (Mac)
    Clear the cache and remove cookies only from websites that cause problems.
    "Clear the Cache":
    *Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > "Use custom settings for history" > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    *Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    *Do NOT click the Reset button on the Safe Mode start window
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

Maybe you are looking for

  • I was migrating from a 3gs to the 4s. Big mistake. Have lost contacts and access to music and apps.

    I was migrating from a 3gs to the 4s. Having never upgraded the IOS before, I thought that I should do that before handed the phone down to my daughter to replace her broken 3g. Big mistake. Even using Google sync for my contacts, following instructi

  • How do i get the email to verify my apple id account

    could u walk me threw step by step when it comes to setting up icloud and apple id

  • Randomly freezes and reboots on its own.

    Device info Your carrier: Rogers Wireless Model info and OS version: blackberry 8220 smartphone v4.6.0.174 (platform4.1.0.58) Apps and free space Did a battery pull fix your issue? A battery pull did NOT help the issue Apps installed and their versio

  • Table of Contents Style Issue

    I am a new user of InDesign 5 and am working with a Table of Contents that was prepared for me in my office.  I have updated my text and inserted a few pages into my document and now have some odd formatting showing up in the TOC.  I have deleted my

  • StopCellEditing in JTable

    I've been used this method to force a cell to keep the value i've just introduced but it doesn't works. Withing the debuggin time i've seen there is no code line in this method at the DefaultCellEditor class. Does anyone know how can i say to the cel