ORA-20091: Invalid Application ID when importing APEX 4.0 Application

Hi Folks
Anyone got a suggestion on this one?
Scenario:
1. Perform an APEX 4.0 Export of application ID 10132 from one workspace
2. Import the application into another APEX 4.0 workspace and change the application ID whilst doing so.
3a. During the import process, override the application ID to one that exists in the workspace being imported into.
In APEX 3.2 you got a warning that you were overwriting an existing app
In APEX 3.2 this would then complete the exercise with your new app replacing the previous one with the same ID
In APEX 4.0 I received ORA-20091: Invalid Application ID
3b. Delete the pre-existing application (e.g. app_id 999) completely in the workspace we intend to import into
Following successful deletion of the application (app_id 999) attempt to import the application export file from the other workspace
During the import, use the UI to change the application id from 10132 to 999.
Still receive the ORA-20091: Invalid Application ID error despite APP ID 999 having been deleted
4. I got this to work by allowing APEX to simply assign a new application ID
My problem is that, whilst this was not a problem when importing to our UAT environment, our DEV and Production environments share the same APP ID (10132) this is so that when upgrading the production application, users saved Interactive reports are preserved. This was fine in APEX 3.2 but is, as yet, untested by us in 4.0.
As things stand at the moment, we have APEX 4.0 in DEV and UAT but this would appear to be a block for us in terms of upgrading production to 4.0.
Any thoughts, comments and suggestions welcome.
Many thanks
Kind regards
Simon Gadd

We ran into a similar problem. My initial tests showed the following to be a work around.
Assumption: You want to end up with the same ID as the original so you don't have to give a new link to everyone.
1. Before copying the app (lets say it's 333) from 3.2 (3.1 in our case) export it and then import it back, still in 3.x with a different app ID, i.e. 99333.
2. In ApEx 4: Import the app 99333 and install it with app ID 333 (the original app ID). After this process, I was able to make necessary changes to the app on ApEx 4, export it, and then import it again, still as ID 333.
I know this sounds very round-about, and I can't explain why it worked, but it worked.
Disclaimer: I certainly may have missed something that would still make it break. This was the result of a few different test scenarios done in a limited time.
So, it's probably best to wait for 4.0.1 if you can.
By the way, I tried creating a brand new app. in ApEx 4, export it and then import it as itself, and I still got the same error. Like I said, I don't know why it worked, but when I imported an older app with one ID into ApEx 4 with a new ID, I was able to export it and then import it again with that same new ID.
Have a great weekend,
Gregory

Similar Messages

  • ORA-01017: invalid username/password when using TNS Alias

    Friends,
    I am experiencing this strange issue in 11G R2. When I use tnsalias and connect using sqlplus username/password@TNS it shows ORA-01017: invalid username/password . But the same works with ORACLE_SID. See below.
    -bash-3.00$ uname -a
    SunOS ibs-ash-sr147 5.10 Generic_144489-06 i86pc i386 i86pc
    -bash-3.00$ env | grep ORACLE
    ORACLE_SID=DB1
    ORACLE_BASE=/project/oracle/orabase
    ORACLE_HOME=/project/oracle/orabase/product/11.2.0/dbhome_1
    -bash-3.00$ tnsping DB
    TNS Ping Utility for Solaris: Version 11.2.0.1.0 - Production on 17-JUN-2011 12:23:12
    Copyright (c) 1997, 2009, Oracle.  All rights reserved.
    Used parameter files:
    /project/oracle/orabase/product/11.2.0/dbhome_1/network/admin/sqlnet.ora
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = crs-scan)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = DB)))
    OK (0 msec)
    -bash-3.00$ sqlplus IRES_USER@DB
    SQL*Plus: Release 11.2.0.1.0 Production on Fri Jun 17 12:30:22 2011
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    Enter password:
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
    Data Mining and Real Application Testing options
    SQL> show parameter sec_case_sensitive_logon
    NAME                                 TYPE        VALUE
    sec_case_sensitive_logon             boolean     TRUE
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
    Data Mining and Real Application Testing options
    -bash-3.00$ sqlplus IRES_USER/U9$bvs#ir@DB
    SQL*Plus: Release 11.2.0.1.0 Production on Fri Jun 17 12:34:30 2011
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    ERROR:
    ORA-01017: invalid username/password; logon denied
    Enter user-name: ^CMy understanding is that both connections use a TNS alias, but second is not working. Any help is appreciated.
    Thanks in Advance,
    SSN
    Edited by: SSNair on Jun 17, 2011 5:43 AM

    SSNair wrote:
    Friends,
    I am experiencing this strange issue in 11G R2. When I use tnsalias and connect using sqlplus username/password@TNS it shows ORA-01017: invalid username/password . But the same works with ORACLE_SID. See below.
    -bash-3.00$ uname -a
    SunOS ibs-ash-sr147 5.10 Generic_144489-06 i86pc i386 i86pc
    -bash-3.00$ env | grep ORACLE
    ORACLE_SID=DB1
    ORACLE_BASE=/project/oracle/orabase
    ORACLE_HOME=/project/oracle/orabase/product/11.2.0/dbhome_1
    -bash-3.00$ tnsping DB
    TNS Ping Utility for Solaris: Version 11.2.0.1.0 - Production on 17-JUN-2011 12:23:12
    Copyright (c) 1997, 2009, Oracle.  All rights reserved.
    Used parameter files:
    /project/oracle/orabase/product/11.2.0/dbhome_1/network/admin/sqlnet.ora
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = crs-scan)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = DB)))
    OK (0 msec)
    -bash-3.00$ sqlplus IRES_USER@DB
    SQL*Plus: Release 11.2.0.1.0 Production on Fri Jun 17 12:30:22 2011
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    Enter password:
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
    Data Mining and Real Application Testing options
    SQL> show parameter sec_case_sensitive_logon
    NAME                                 TYPE        VALUE
    sec_case_sensitive_logon             boolean     TRUE
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
    Data Mining and Real Application Testing options
    -bash-3.00$ sqlplus IRES_USER/U9$bvs#ir@DB
    SQL*Plus: Release 11.2.0.1.0 Production on Fri Jun 17 12:34:30 2011
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    ERROR:
    ORA-01017: invalid username/password; logon denied
    Enter user-name: ^CMy understanding is that both connections use a TNS alias, but second is not working. Any help is appreciated.
    Thanks in Advance,
    SSN
    Edited by: SSNair on Jun 17, 2011 5:43 AMHere's your problem:
    -bash-3.00$ sqlplus IRES_USER/U9$bvs#ir@DBBecaue of the dollar-sign, The shell is trying to expand the environment variable $bvs#ir@DB
    Of course you have no environment variable by that name so what gets passed to sqlplus is not "IRES_USER/U9$bvs#ir@DB", but rather "IRES_USER/U9"
    In your first test, you didn't pass the password on the command line, so the shell didn't get a chance to intercept it.
    You can have a similar issue if you have a '@' in your password
    oracle> sqlplus scott/P@ssword@orclTns will catch that first "@" as the delimiter to the tns string, and come up with something that cant' be resolved.
    Edited by: EdStevensTN on Jun 17, 2011 8:59 AM

  • "ORA-00903: invalid table name" when enqueue using a CLOB in an ADT payload

    I am attempting to enqueue into an AQ that has an ADT with a CLOB field in it. If I leave the CLOB empty, it works. As soon as I place content in it, I get the error below in the BPEL log.
    I actually get the same problem when I run the "AQ_ADT_with_CLOB_Payload" example. Please help!
    Error in the BPEL log:
    <2005-11-08 09:22:07,784> <ERROR> <default.collaxa.cube.ws> <AQ Adapter::Outbound> MessageWriter_enqueue: Could not enqueue message due to database error
    <2005-11-08 09:22:07,784> <ERROR> <default.collaxa.cube.ws> <AQ Adapter::Outbound>
    java.sql.SQLException: ORA-00903: invalid table name
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:137)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:304)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:271)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:625)
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:181)
    at oracle.jdbc.driver.T4CPreparedStatement.execute_for_describe(T4CPreparedStatement.java:661)
    at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:951)
    at oracle.jdbc.driver.T4CPreparedStatement.execute_maybe_describe(T4CPreparedStatement.java:693)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1057)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2901)
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:2942)
    at oracle.tip.adapter.aq.database.MessageWriter.doEnqueue(MessageWriter.java:530)
    at oracle.tip.adapter.aq.database.MessageWriter.enqueue(MessageWriter.java:341)
    at oracle.tip.adapter.aq.database.MessageWriter.writeMessage(MessageWriter.java:303)
    at oracle.tip.adapter.aq.outbound.AQEnqueuer.execute(AQEnqueuer.java:108)
    at oracle.tip.adapter.aq.AQInteraction.executeRunTime(AQInteraction.java:194)
    at oracle.tip.adapter.aq.AQInteraction.execute(AQInteraction.java:180)
    at oracle.tip.adapter.fw.wsif.jca.WSIFOperation_JCA.executeRequestResponseOperation(WSIFOperation_JCA.java:469)
    at oracle.tip.adapter.fw.wsif.jca.WSIFOperation_JCA.executeInputOnlyOperation(WSIFOperation_JCA.java:652)
    at com.collaxa.cube.ws.WSIFInvocationHandler.invoke(WSIFInvocationHandler.java:441)
    at com.collaxa.cube.ws.WSInvocationManager.invoke2(WSInvocationManager.java:310)
    at com.collaxa.cube.ws.WSInvocationManager.invoke(WSInvocationManager.java:184)
    at com.collaxa.cube.engine.ext.wmp.BPELInvokeWMP.__invoke(BPELInvokeWMP.java:601)
    at com.collaxa.cube.engine.ext.wmp.BPELInvokeWMP.__executeStatements(BPELInvokeWMP.java:316)
    at com.collaxa.cube.engine.ext.wmp.BPELActivityWMP.perform(BPELActivityWMP.java:185)
    at com.collaxa.cube.engine.CubeEngine.performActivity(CubeEngine.java:3398)
    at com.collaxa.cube.engine.CubeEngine.handleWorkItem(CubeEngine.java:1905)
    at com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal(PerformMessageHandler.java:75)
    at com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage(DispatchHelper.java:100)
    at com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory(DispatchHelper.java:185)
    at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:5410)
    at com.collaxa.cube.engine.CubeEngine.createAndInvoke(CubeEngine.java:1300)
    at com.collaxa.cube.engine.delivery.DeliveryService.handleInvoke(DeliveryService.java:509)
    at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.handleInvoke(CubeDeliveryBean.java:307)
    at ICubeDeliveryLocalBean_StatelessSessionBeanWrapper16.handleInvoke(ICubeDeliveryLocalBean_StatelessSessionBeanWrapper16.java:1796)
    at com.collaxa.cube.engine.dispatch.message.invoke.InvokeInstanceMessageHandler.handle(InvokeInstanceMessageHandler.java:37)
    at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:76)
    at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
    at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
    at com.evermind.server.ejb.MessageDrivenBeanInvocation.run(MessageDrivenBeanInvocation.java:123)
    at com.evermind.server.ejb.MessageDrivenHome.onMessage(MessageDrivenHome.java:748)
    at com.evermind.server.ejb.MessageDrivenHome.run(MessageDrivenHome.java:921)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
    at java.lang.Thread.run(Thread.java:534)

    OK, I figured it out myself. :)
    Turns out when I define the queue name in the AQ Adapter definition, I was specifying "<Default Schema>" as the schema name. When I changed this to my actual schema name (eg: "SCOTT"), it worked. Nice little bug there!
    The reason it broke with the example program is because I was changing the schema name before I deployed it. As I didn't have a SCOTT schema.
    So the moral of the story here is, don't use "<Default Schema>"!
    I was running on 10.1.2.0.0 [build #1787 ]. In case anyone wants to fix this.

  • ORA-01722: invalid number error when trying to pass a list of values

    Gurus
    We are using a function like so
    The usage for the function below is
    Select fn_st_bb_nm_uc (‘1232131312, 123213312’) from dual;
    SQL> /
    Select fn_st_bb_nm_uc ('1232131312, 123213312') from dual
    ERROR at line 1:
    ORA-01722: invalid number
    It’s giving an invalid number error. When we pass one value it is working fine but when we pass a string of values it gives this error. I have opened an SR around this but would greatly appreciate your help
    Acc_blackbar is the table and acc_blkbr_id is of type number.
    FUNCTION fn_st_bb_nm_uc (pBB_ID_LIST VARCHAR2)
    RETURN VARCHAR2 IS
    vspcm_typ_nm_uc VARCHAR2 (2000);
    CURSOR stname
    IS
    SELECT distinct st.spcm_typ_nm_uc
    FROM
    acc_blackbar abb,
    acc_specimen_type ast, acc_procedure apr,
    acc_specimen_part asp,
    specimen_type st, procedure pr,
    proc_proc_family ppf
    WHERE abb.ACC_BLKBR_ID = apr.ACC_BLKBR_ID
    AND apr.ACC_SPCM_PART_ID = asp.ACC_SPCM_PART_ID
    AND asp.ACC_SPCM_TYP_ID = ast.ACC_SPCM_TYP_ID
    AND ast.ACC_SPCM_TYP_SPCM_TYP_ID = st.SPCM_TYP_ID
    AND apr.procdr_id = pr.PROCDR_ID
    AND pr.PROCDR_ID = ppf.PROCDR_ID
    AND abb.acc_blkbr_id in (pBB_ID_LIST) ;
    BEGIN
    DBMS_OUTPUT.PUT_LINE(' BB LIST : ' || pBB_ID_LIST);
    FOR st IN stname
    LOOP
    vspcm_typ_nm_uc := vspcm_typ_nm_uc || ',' || st.spcm_typ_nm_uc;
    END LOOP;
    vspcm_typ_nm_uc := SUBSTR (vspcm_typ_nm_uc, 2);
    RETURN vspcm_typ_nm_uc;
    END;

    This ask tom thread covers multiple solutions:
    [http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:210612357425|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:210612357425]

  • ORA-22275 Invalid lob locator when using CLOB from a view

    Hi,
    I am having problems when passing a CLOB from a "Union all" view to a function. I get an ORA-22275 error when trying to construct an XmlType from the CLOB and
    the CLOB originates from a view. If the CLOB originates from a table, eveyting works fine. Here is the code, that reproduces the problem
    CREATE TABLE testclob
        (field1                         CLOB)
    -- insert some data
    insert into testclob values ('<a/>');
    -- Define a clob view over some tables
    create or replace view v_testclob
    (field1)
    as
    select field1 from testclob
    union all
    select field1 from testclob; -- in reallity I use different tables
    -- Creat a functions that proceses the CLOB
    CREATE OR REPLACE
    function MyFunction(v_myClob clob) return VARCHAR2
    IS
       myXML XMLTYPE;
    BEGIN
      select xmltype(v_myClob) into myxml from dual; -- the view crashes ** HERE **
      -- code ommited
      return 'some data';
    END;
    -- Try to use the function:
    -- Selecting from a table works OK
    select myfunction(field1) from testclob;
    -- Selecting from the view crashes
    select myfunction(field1) from v_testclob;
    Error: ORA-22275: invalid LOB locator specified ORA-22275: invalid LOB locator specified ORA-06512: at "D_TEST.MYFUNCTION", line 6
    -- I using the following version:
    select * from v$version;
    -- Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production      
    -- PL/SQL Release 9.2.0.1.0 - Production                           
    -- CORE     9.2.0.1.0     Production                                       
    -- TNS for 32-bit Windows: Version 9.2.0.1.0 - Production          
    -- NLSRTL Version 9.2.0.1.0 - Production The only workaround I have found is to use substr
      select xmltype(dbms_lob.substr(v_myClob)) into myxml from dual; -- workaround.. but this mght trucnate my data.
    What am I doing wrong?
    Matej

    You need to apply the latest patchset for your version of the database on your version of the operating system:
    SQL> CREATE TABLE testclob
      2      (field1                         CLOB)
      3
    SQL> /
    Table created.
    SQL>
    SQL> -- insert some data
    SQL> insert into testclob values ('<Data>Testing</Data>')
      2  /
    1 row created.
    SQL>
    SQL> -- Define a clob view over some tables
    SQL>
    SQL> create or replace view v_testclob
      2  (field1)
      3  as
      4  select field1 from testclob
      5  union all
      6  select field1 from testclob
      7  /
    View created.
    SQL>
    SQL> -- Creat a functions that proceses the CLOB
    SQL>
    SQL> CREATE OR REPLACE
      2  function MyFunction(v_myClob clob) return VARCHAR2
      3  IS
      4     myXML XMLTYPE;
      5  BEGIN
      6
      7    select xmltype(v_myClob) into myxml from dual; -- the view crashes ** HERE **
      8    -- code ommited
      9    return 'some data';
    10  END;
    11
    12  /
    Function created.
    SQL> -- Try to use the function:
    SQL> -- Selecting from a table works OK
    SQL> select myfunction(field1) from testclob;
    MYFUNCTION(FIELD1)
    some data
    SQL>
    SQL>
    SQL> -- Selecting from the view crashes
    SQL> select myfunction(field1) from v_testclob;
    MYFUNCTION(FIELD1)
    some data
    some data
    SQL> disconnect
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.7.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.7.0 - Production
    SQL>

  • ORA-00926: missing VALUES keyword | when importing data

    Hello,
    I get the missing VALUES keyword error when importing data from an Excel spreadsheet. Until yesterday everything worked fine. Today I'm having this problem because OSD does not build the DML correctly. See:
    insert into WFT_GROEPEN (CODE,OMSCHRIJVING,NIVEAU,INDIC_LAAGSTE_NIVEAU) VALUES('1.1.1.1','- Value of business acquired',4,'N');
    Working with OSD 1.2.1 on Windows XP.
    Anyone got a clue?
    Kind regards,
    Dennis

    Hi,
    Thanks for your reply. I found the problem myself. I got 2 columns in the Excel sheet with the same name. Then OSD creates an insert statement like following which gives the 'missing VALUES keyword' error.
    insert into WFT_GROEPEN (CODE,OMSCHRIJVING,NIVEAU,INDIC_LAAGSTE_NIVEAU)NIVEAU) VALUES('3','Toelichting balans beleggingen',NULL,'N',NULL);
    Regards,
    Dennis

  • Log  file  when import Apex  application

    Is there any way to find out which line ApEx is choking on during the install? Is there a log kept anywhere?

    Hello Adam,
    Are you sure the filename you pass in your where clause is the same as the one you can see when you do select * ?
    Regards,
    Dimitri
    -- http://dgielis.blogspot.com/
    -- http://apex-evangelists.com/
    -- http://apexblogs.info/

  • Receiving ORA-01465: invalid hex number when using HEXTORAW

    I'm trying to use hextoraw to convert a value in a CSV file read from an external table. Works on some systems and not on others. Is there a way that I can avoid this or program around this? Any ideas what the problem is? It fails with an “invalid hex value” .
    This is for Oracle 10.2.0.4 Here is the code and the external table that I’m using.
    select HEXTORAW(REPLACE(EnkryptedPassword,'0x')) FROM CUSTOMER1; <--- Failes or ORA-01465 (CSV file data below)
    CREATE TABLE CUSTOMER1
    UserID VARCHAR2(100 CHAR),
    FirstName VARCHAR2(50 CHAR),
    LastName VARCHAR2(50 CHAR),
    Locked VARCHAR2(50 CHAR),
    CustomerID VARCHAR2(100 CHAR),
    Pwd VARCHAR2(100 CHAR),
    EnkryptedPassword VARCHAR2(100 CHAR)
    ORGANIZATION external
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY ARCHIVE
    ACCESS PARAMETERS
    RECORDS DELIMITED BY NEWLINE
    FIELDS TERMINATED BY ","
    MISSING FIELD VALUES ARE NULL
    LOCATION ('PWDCONVERSION2')
    REJECT LIMIT 1
    COMMIT
    Inside the PWDCONVERSION2 file:
    [email protected],JOHN,SMITH,1,C_2M8C2F_CM_NC,C_2M8C2F_CM_NC,0x7C4141938A1F69944BFCA0BED5BB3FEA3CA92A7

    Thank-you for the response. I believe I may have found the problem (probably).
    On some systems the ACCESS PARAMETER for the external table "RECODRDS DELIMITED BY NEWLINE" will not work if there is some other character other than "\n". In windows it works fine. On some other systems it works finds as well. On Linux Distro I tend to run into problems. I tried this out for more than one line in the CSV. Then scaled back to just one line. It accepted one line but not more than one line. So I trying
    RECORDS DELIMITED BY NEWLINE CHARACTERSET WE8MSWIN1252
    Any ideas what would help recognize all types of newline characters?

  • Invalid character error when importing metadata to OWB 10.2

    Hi,
    Currently, I am upgrading OWB from 9.1 to 10.1 to OWB 10.2.. I can successfully export metadata from 9.1 to 10.1 but when I import it into 10.2 from 10.1, I get an error message API0402; Illegal Character- not allowed. Can some one please let me know if there is any resolution for this error.
    Thank you,
    Naveed.

    3. Is that because of my windows 7 home edition ?I think the issue with the third one. check
    1.whether you can create a file on the mdl directory and give read, write access on the folder to the OS user.
    2. Give read write access on file converter.properties to OS user
    Cheers
    Nawneet
    Edited by: Nawneet_Aswal on Jul 20, 2010 10:21 AM

  • ORA-01722: invalid number error when comparing varchar and number

    Hi,
    We are upgrading our databases to 10g and have issue with the below query
    SELECT VALUE FROM table1 WHERE SUBSTR (VALUE, 10) = 1.
    In table1, VALUE is the column name and it will have data ending with number. ex: SIGNATURE1, SIGNATURE2, SIGNATURE3, SIGNATURE4....SIGNATURE9.
    As output of substr is varchar, Is comparing it with number throwing the error?
    If so, the same query is working perfect in another 10g database which we migrated into.
    Please help.
    Thanks,
    Madhuri

    I think its data issue. may be some data is defected where string after 10th place contains non numeric character and you are trying to compare it with 1.
    My test
    Case 1
    Below code works fine, since all 10th place characters are digits, so can be compared with 1
    with c as
    (select 'SIGNATURE1' n from dual union all
    select 'SIGNATURE2' from dual union all
    select 'SIGNATURE3' from dual union all
    select 'SIGNATURE9 ' from dual )
    select n,substr(n,10) from c where substr(n,10)=1
    Case 2
    with c as
    (select 'SIGNATURE1' n from dual union all
    select 'SIGNATURE2' from dual union all
    select 'SIGNATURE3' from dual union all
    select 'SIGNATURE9a' from dual ) -------non numeric character
    select n,substr(n,10) from c where substr(n,10)=1
    This query shows error because , after 10th place there exists a non numeric character

  • Classic ASP - "ORA-01722: invalid number" using OraOLEDB.Oracle driver

    I am working on doing some maintenance updates to a Classic ASP website, and I need to be able to run an insert/update statement for putting values into a lookup table. I am currently running into an "ORA-01722: invalid number" error when trying to use ADO and bind variables for my insert statement.
    Below is an example of a table that I am having problems with:
    CREATE TABLE "MATMGR"."TEST_SWING_TABLE"
    (     "TABLE1_ID" NUMBER(4,0) NOT NULL ENABLE,
         "TABLE2_ID" NUMBER(4,0) NOT NULL ENABLE,
         CONSTRAINT "TEST_SWING_TABLE_PK" PRIMARY KEY ("TABLE1_ID", "TABLE2_ID")
    USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ENABLE
    ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ;
    Here is some snippet code of the basic functionality I am trying to get to work:
    ''START CODE''
    Dim connDb, cmdDoseInsert
    Set connDb = Server.CreateObject("ADODB.Connection")
    connDb.CursorLocation = adUseClient ' Setup to return RecordSet
    connDb.ConnectionString = "Provider=OraOLEDB.Oracle;Data Source={host};User ID={user id};Password={password}"
    connDb.Open()
    Set cmdDoseInsert = Server.CreateObject("ADODB.command")
    Set cmdDoseInsert.ActiveConnection = connDb
    cmdDoseInsert.CommandType = adCmdText
    cmdDoseInsert.NamedParameters = true ' Set the command object to use named parameters
    cmdDoseInsert.Prepared = true
    cmdDoseInsert.CommandTimeout = 0
    cmdDoseInsert.CommandText = "INSERT INTO TEST_SWING_TABLE (TABLE1_ID, TABLE2_ID) VALUES (:P_TABLE1_ID, :P_TABLE2_ID)"
    cmdDoseInsert.Prepared = true
    cmdDoseInsert.Parameters.Append cmdDoseInsert.CreateParameter("P_TABLE1_ID", adNumeric, adParamInput)
    cmdDoseInsert.Parameters.Append cmdDoseInsert.CreateParameter("P_TABLE2_ID", adNumeric, adParamInput)
    '... START: While Looping
         cmdDoseInsert.Parameters(0).Value = {some numeric value}
         cmdDoseInsert.Parameters(1).Value = {some numeric value}
         cmdDoseInsert.Execute
    '... END: Looping
    ''END CODE''
    What I have been able to find out so far is that there is some type of issue with numeric values getting translated right when sending two and retrieving from Oracle in ASP. So, does anyone have any thoughts on how to resolve this as I would like to use parameterized SQL to improve application performance?
    I am connecting to a developmental server running Oracle 9.2

    Ok, in my slightly larger example I found out that for what ever reason my named parameters are not being enforced, and so I had to make sure that the parameters were in the same order as they appeared in the SQL. To be on the save side, I did this when they were added as well as when I was assigning values to them.
    Can anyone tell me if this is an Oracle issue or a ASP issue?

  • ORA-01465: invalid hex number on form field having values like $0-$10k...

    Hi
    I have a form item (SPEND) of select list having values like
    $0 - $10k
    $10k - $50k
    $50k - $100k
    $100k - $250k
    $250k+
    For the new record, when I hit "SAVE” buttons it inserts the new records to the table with values ($0-$10k...)
    BUT when i edited the same record, and then try to "Apply Changes” getting following error message
    ORA-01465: invalid hex number
    Again when I change the value to null it simply allows the record to UPDATE.
    Again I changed the item to a text field i am getting same error when I try with charter (ABc...). BUT it allows to the number (123..)
    Column attribute is SPEND VARCHAR2 (15 BYTE)
    ie - when I try to update the SPEND field with the values ($0 - $10k,$10k - $50k,$50k - $100k,$100k - $250k,$250k+) I am getting above error message.
    ORA-01465: invalid hex number
    Environment:
    Oracle Apex- 4.1
    DB-11g
    Thanks,
    Amu
    Edited by: Amuly on Jul 16, 2012 5:00 PM

    Use utl_raw.cast_to_raw() function when you convert HEX value into RAW(), e.g.:
    SQL> create table ztest (ff raw(1000));
    Table created
    SQL> insert into ztest (ff) values
      2  (utl_raw.cast_to_raw('596F75207765726520646973636F6E6E65637465642066 726 F 6D207468652041494D207365727669996365207768656E20796F752073696
      3  76E656420696E2066726F6D20616E6F74686572206C6F636174'));
    1 row inserted

  • ORA-00911: invalid character using multiple select statements

    I am getting an ORA-00911: invalid character error when trying to execute 2 select statements using ODP.NET.
    cmd.CommandText = "select sysdate from dual;select sysdate from dual;";
    cmd.Connection = conn;
    cmd.CommandType = System.Data.CommandType.Text;
    conn.Open();
    OracleDataReader dr = cmd.ExecuteReader();
    This works in SQL server but for some reason it appears this does not work in Oracle?
    If this is the case what is a vaiable workaround? Wrapping the 2 statements in a transaction?
    Seems strange that you can't return multiple result sets using in-line sql statements.

    Oracle doesn't support passing multiple statements like that, and this is unrelated to ODP.NET.
    SQL> select * from emp;select * from dept;
    select * from emp;select * from dept
    ERROR at line 1:
    ORA-00911: invalid character
    You could do it via an anonymous block and ref cursors though if you dont want to do it via a stored procedure..
    using System;
    using System.Data;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    public class test
    public static void Main()
        using (OracleConnection con = new OracleConnection("data source=orcl;user id=scott;password=tiger;"))
            con.Open();
            string strSql = "begin open :refcur1 for select * from emp;" +
                "open :refcur2 for select * from dept;" +
                "open :refcur3 for select * from salgrade;end;";
            using (OracleCommand cmd = new OracleCommand(strSql, con))
                cmd.Parameters.Add("refcur1", OracleDbType.RefCursor, ParameterDirection.Output);
                cmd.Parameters.Add("refcur2", OracleDbType.RefCursor, ParameterDirection.Output);
                cmd.Parameters.Add("refcur3", OracleDbType.RefCursor, ParameterDirection.Output);
                OracleDataAdapter da = new OracleDataAdapter(cmd);
                DataSet ds = new DataSet();
                da.Fill(ds);
                cmd.Parameters["refcur1"].Dispose();
                cmd.Parameters["refcur2"].Dispose();
                cmd.Parameters["refcur3"].Dispose();
                foreach (DataTable dt in ds.Tables)
                    Console.WriteLine("\nProcessing {0} resultset...", dt.ToString());
                    foreach (DataRow row in dt.Rows)
                        Console.WriteLine("column 1: {0}", row[0]);
    }Hope it helps,
    Greg

  • ORA-00904: Invalid column name

    Hi all,
    some of my OWB generated packages keep returning error
    ORA-00904: Invalid column.
    When I check run of such packages in OWB Audit Viewer:
    1. Selected and inserted no of records is OK
    2. There is one error reported the one mentioned above. Unfortunately there is nothing more than "Batch insert" and ORA error no and error code in Error Details
    The number of columns and their types and all constraints are the same in DB and OWB repository for both tables that take part in such mapping.
    Do you have some ideas where is the problem?
    Thanks
    Petr

    try to produce a trace file

  • ORA-01722: Invalid number when importing .csv file

    Hi,
    I did not find any information regarding my specific problem until now.
    I try to import a *.csv file containing id, double, double, double, double, double (e.g. as a sample line "id_1, 674,6703459157907, 4212,205538937771, 674,6703459158016, 5561,546230769363, 2714,6367797576822") into a table with the following definition:
    CREATE TABLE "foo"."BUILDING_SURFACES"
    (     "ID" VARCHAR2(40 BYTE),
         "AREA1" BINARY_DOUBLE DEFAULT 0,
         "AREA2" BINARY_DOUBLE DEFAULT 0,
         "AREA3" BINARY_DOUBLE DEFAULT 0,
         "AREA4" BINARY_DOUBLE DEFAULT 0,
         "AREA5" BINARY_DOUBLE DEFAULT 0
    ) SEGMENT CREATION IMMEDIATE
    PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    TABLESPACE "USERS" ;
    I am doing it with the help of the importer tool in the SQLDeveloper, by doing a right-click onto the table and selecting import data. In the assistant everything seem to be fine, even the data preview.
    But when I try to import, I get an error: "ORA-01722: Invalid number" and a couple of failure windows appear. These windows display a NullPointerException:
    java.lang.NullPointerException
         at oracle.dbtools.raptor.data.writers.DataTypeFormatterRegistry.getFormattor(DataTypeFormatterRegistry.java:42)
         at oracle.dbtools.raptor.data.writers.ImportGenerator.getBatchForInsert(ImportGenerator.java:1837)
         at oracle.dbtools.raptor.data.writers.ImportGenerator.access$1800(ImportGenerator.java:84)
         at oracle.dbtools.raptor.data.writers.ImportGenerator$1.afterLoopProcessing(ImportGenerator.java:1125)
         at oracle.dbtools.raptor.newscriptrunner.ScriptExecutorTask.loopThroughAllStatements(ScriptExecutorTask.java:220)
         at oracle.dbtools.raptor.newscriptrunner.ScriptExecutorTask.doWork(ScriptExecutorTask.java:165)
         at oracle.dbtools.raptor.data.writers.ImportGenerator$1.doWork(ImportGenerator.java:782)
    If I cancel the task, the insert statements are displayed:
    SET DEFINE OFF
    --Einfügen für Zeilen  1  bis  2  nicht erfolgreich
    --ORA-01722: Ungültige Zahl
    --Zeile 1
    INSERT INTO BUILDING_SURFACES (ID, AREA1, AREA2, AREA3, AREA4, AREA5) VALUES ('BLDG_0003000b002ea10f','674.6703459157907','4212.205538937771','674.6703459158016','5561.546230769363','2714.6367797576822');
    --Zeile 2
    As one can see, the numbers are quoted ('). If I delete the quotes by hand, the insert statement works correctly.
    What can I do, so that the import tool does not quote the numbers?
    Deleting the quotes with the help of a regular expression is not workaround, since a lot of error windows appear, which needs to be closed by hand...
    Thanks in advance,
    Richard
    Some infos about my machine:
    $ lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description: Ubuntu 12.10
    Release: 12.10
    Codename: quantal
    $ java -version
    java version "1.6.0_38"
    Java(TM) SE Runtime Environment (build 1.6.0_38-b05)
    Java HotSpot(TM) 64-Bit Server VM (build 20.13-b02, mixed mode)
    Oracle SQL Developer 3.2.20.09
    Version 3.2.20.09
    Build MAIN-09.87
    Copyright © 2005, 2012 Oracle. All Rights Reserved. Alle Rechte vorbehalten.
    IDE Version: 11.1.1.4.37.59.48
    Product ID: oracle.sqldeveloper
    Product Version: 11.2.0.09.87

    I solved my problem. :)
    I changed the datatype of the area fields to "NUMBER" and edited my input file in a way, that it is tab separated with "," as decimal sign.
    Richard

Maybe you are looking for

  • Error while uploading files to AWS S3

    Hello Experts SAP PI 7.31 I am working on the following scenario. SAP PI receives a file attachment from SOAP response and the same needs to be uploaded to AWS S3 using REST (Advantco REST Adapter) (PUT Method): File --> SAP PI --> REST              

  • Some advice before I spend my money

    I`m planning on buying the MSI Radeon 9800 pro. I would like some feedback on that video card. Is it good?  how is its performance? Any kind of information would be apreciated. I would also like to know if it is true that it has the procesor of a 980

  • Values of select-options lost in tabbed screen when in batch mode

    Hi, I have a very strange problem.  When I run the following program in online mode (with values given for s_time1-low, s_time1-high and p_time1 on the second tab), everything is fine and the values given for s_time1 and p_time1 are printed.  However

  • How to refresh datasource

    since the rows are changed continually,i want add a link to refresh the jsp page,so i do 1.add the following lines in datahandlecompnent.sjp <jbo:OnEvent name="refresh"> <jbo:RefreshDataSource datasource="ds" /> </jbo:OnEvent> <jbo:OnEvent name="crea

  • Found MIME bug causes

    Dear all, I having been using Thunderbird before and recently Apple Mail 3 get my attention. However I find alot of my China staff's email's attachment become MIME attachment. No matter how they attach it. I try different extension like: Rar, zip, do