ORA-31038: Invalid number value: "NaN"
Hi Experts,
we are struggling with double fields in certain xml-files. In this files, the fields contain 'NaN', what should be standard conform according to IEEE (http://www.w3.org/TR/xmlschema-2/#double). The problem appears as we are trying to load these files into the xmltype-columns in the database.
Thanks in advance
Michael
Michael
XMLTYPE column, which has a XML-Schema underneathI guess that the XMLType column has an object-relational storage. If yes, per default a double is stored with a NUMBER datatype. If it is the case, you have to modify the XML Schema to use something like the following:
<xs:element name="n" type="xs:double" xdb:SQLType="BINARY_DOUBLE"/>With this setting a BINARY_DOUBLE will be used instead of a NUMBER and, therefore, the error will be avoided.
HTH
Chris Antognini
Troubleshooting Oracle Performance, Apress 2008
http://top.antognini.ch
Similar Messages
-
How to fix "ORA-31038:Invalid value ..." in a XML schema
Hello,
We are in 11gR2 :
select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 - ProductionWe load XML files based on a registered XML schema.
Here is the top of our XML schema:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xdb="http://xmlns.oracle.com/xdb"
xmlns="http://www.capgemini.com/xsd/projet.xsd"
targetNamespace="http://www.capgemini.com/xsd/projet.xsd"
elementFormDefault="unqualified"
blockDefault="#all">
<xsd:element name="WORKBENCH_PROJECT" xdb:defaultTable="WORKBENCH_PROJECT_TABLE">
<xsd:complexType xdb:maintainDOM="false">
<xsd:sequence>
<xsd:element ref="BaseCalendars"/>
<xsd:element ref="PoolResources"/>
<xsd:element ref="Projects"/>
</xsd:sequence>
...We experience error ORA-31038: Invalid number value ... at the load of the XML, when the focus goes to a string type attribute :
Here it is :
<Task
UID="AJ\'UF`2=_```)O0H;"P!```?P```0" earlyStart="2010-04-20T08:00:00" category="Run"
baseTime="2010-03-26T09:22:00" lateStart="2010-04-20T08:00:00" start="2010-04-20T08:00:00"
proxy="false" earlyFinish="2010-05-12T17:00:00" lateFinish="2010-05-12T17:00:00"
critical="true" status="2" shortName="OASIS 3.2" outlineLevel="4" baseFinish="2010-06-11T17:00:00"
finish="2010-05-12T17:00:00" summary="false" baseStart="2010-05-17T08:00:00" baselineDuration="20.0"
milestone="false" name="OASI 3.2.1 : Association d'un plan à un PFO" fixed="true"
locked="false" key="false" percComp="1.0" totalSlack="0.0" unplanned="false">
<Assignments>
<Assignment
status="2" actualWork="24.0" resourceID="SMOUFLIH" start="2010-04-20T08:00:00" baselineWork="0.0"
Here is the XML schema part where the load fails ( at the attribute *<xsd:attribute name="name" type="xsd:string"/>* ) :
<xsd:element name="Task" xdb:defaultTable="">
<xsd:complexType xdb:maintainDOM="false">
<xsd:sequence>
<xsd:element ref="Assignments" minOccurs="0"/>
<xsd:element ref="BaselineDetails" minOccurs="0"/>
<xsd:element ref="Constraints" minOccurs="0"/>
<xsd:element ref="Notes" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="UID"/>
<xsd:attribute name="taskID" type="xsd:string"/>
<xsd:attribute name="baseFinish" type="xsd:NMTOKEN"/>
<xsd:attribute name="baseStart" type="xsd:NMTOKEN"/>
<xsd:attribute name="baseTime" type="xsd:NMTOKEN"/>
<xsd:attribute name="baselineDuration" type="xsd:decimal"/>
<xsd:attribute name="category" type="xsd:string"/>
<xsd:attribute name="critical" type="xsd:string"/>
<xsd:attribute name="earlyFinish" type="xsd:NMTOKEN"/>
<xsd:attribute name="earlyStart" type="xsd:NMTOKEN"/>
<xsd:attribute name="finish" type="xsd:NMTOKEN"/>
<xsd:attribute name="fixed" type="xsd:string"/>
<xsd:attribute name="guidelines" type="xsd:string"/>
<xsd:attribute name="key" type="xsd:string"/>
<xsd:attribute name="lastUpdatedBy" type="xsd:string"/>
<xsd:attribute name="lastUpdatedDate" type="xsd:NMTOKEN"/>
<xsd:attribute name="lateFinish" type="xsd:NMTOKEN"/>
<xsd:attribute name="lateStart" type="xsd:NMTOKEN"/>
<xsd:attribute name="locked" type="xsd:string"/>
<xsd:attribute name="methodID" type="xsd:string"/>
<xsd:attribute name="milestone" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
<xsd:attribute name="outlineLevel" type="xsd:integer"/>
<xsd:attribute name="percComp" type="xsd:decimal"/>
<xsd:attribute name="priority" type="xsd:string"/>
<xsd:attribute name="proxy" type="xsd:string"/>
<xsd:attribute name="shortName" type="xsd:string"/>
<xsd:attribute name="start" type="xsd:NMTOKEN"/>
<xsd:attribute name="status" type="xsd:integer"/>
<xsd:attribute name="summary" type="xsd:string"/>
<xsd:attribute name="totalSlack" type="xsd:double"/>
<xsd:attribute name="unplanned" type="xsd:string"/>
<xsd:attribute name="userText1" type="xsd:string"/>
<xsd:attribute name="userText2" type="xsd:string"/>
<xsd:attribute name="userText3" type="xsd:string"/>
<xsd:attribute name="userText4" type="xsd:string"/>
<xsd:attribute name="userText5" type="xsd:string"/>
We know how to fix it manually :
The workaround is to :
remove all "'" in each attribute called "name" But we suppose we need to amend the XML schema with a proper change. And we don't know how to do this.
The weird is that we've never noticed this error earlier on a 11gR1 DB... This error only occurs on our brand new 11.2.0.2
I hope it's clear enough for your understanding.
Do you have any advice ?
Thanks in advance,
OlivierWhat are your NLS Settings
SQL> select *
2 from nls_database_parameters
3 where parameter in ('NLS_LANGUAGE', 'NLS_TERRITORY', 'NLS_CHARACTERSET');
PARAMETER SQL> select *
2 from nls_database_parameters
3 where parameter in ('NLS_LANGUAGE', 'NLS_TERRITORY', 'NLS_CHARACTERSET');
PARAMETER VALUE
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CHARACTERSET AL32UTF8
SQL>With my settings I do not see a problem with a cut-down test...
SQL> spool testcase.log
SQL> --
SQL> connect sys/oracle as sysdba
Connected.
SQL> --
SQL> set define on
SQL> set timing on
SQL> --
SQL> def USERNAME = CG
SQL> --
SQL> def PASSWORD = &USERNAME
SQL> --
SQL> -- def XMLDIR = &1
SQL> --
SQL> def USER_TABLESPACE = USERS
SQL> --
SQL> def TEMP_TABLESPACE = TEMP
SQL> --
SQL> drop user &USERNAME cascade
2 /
old 1: drop user &USERNAME cascade
new 1: drop user CG cascade
User dropped.
Elapsed: 00:00:01.72
SQL> grant create any directory, drop any directory, connect, resource, alter session, create view to &USERNAME identified by &PASSWORD
2 /
old 1: grant create any directory, drop any directory, connect, resource, alter session, create view to &USERNAME identified by &PASSWORD
new 1: grant create any directory, drop any directory, connect, resource, alter session, create view to CG identified by CG
Grant succeeded.
Elapsed: 00:00:00.01
SQL> alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespace &TEMP_TABLESPACE
2 /
old 1: alter user &USERNAME default tablespace &USER_TABLESPACE temporary tablespace &TEMP_TABLESPACE
new 1: alter user CG default tablespace USERS temporary tablespace TEMP
User altered.
Elapsed: 00:00:00.01
SQL> connect &USERNAME/&PASSWORD
Connected.
SQL> --
SQL> -- create or replace directory XMLDIR as '&XMLDIR'
SQL> -- /
SQL> var SCHEMAURL1 varchar2(256)
SQL> VAR XMLSCHEMA1 CLOB;
SQL> VAR INSTANCE1 CLOB;
SQL> --
SQL> set define off
SQL> --
SQL> alter session set events='31098 trace name context forever'
2 /
Session altered.
Elapsed: 00:00:00.00
SQL> begin
2 :SCHEMAURL1:= 'http://xmlns.example.com/testcase.xsd';
3 :XMLSCHEMA1 :=
4 '<?xml version="1.0" encoding="UTF-8"?>
5 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" elementFormDefault="qualified" attributeFormDefault="unqualified">
6 <xsd:element name="Task" xdb:defaultTable="TASK_TABLE">
7 <xsd:complexType xdb:maintainDOM="false">
8 <xsd:sequence>
9 <xsd:element name="Notes" type="xsd:string" minOccurs="0"/>
10 </xsd:sequence>
11 <xsd:attribute name="UID"/>
12 <xsd:attribute name="taskID" type="xsd:string"/>
13 <xsd:attribute name="baseFinish" type="xsd:NMTOKEN"/>
14 <xsd:attribute name="baseStart" type="xsd:NMTOKEN"/>
15 <xsd:attribute name="baseTime" type="xsd:NMTOKEN"/>
16 <xsd:attribute name="baselineDuration" type="xsd:decimal"/>
17 <xsd:attribute name="category" type="xsd:string"/>
18 <xsd:attribute name="critical" type="xsd:string"/>
19 <xsd:attribute name="earlyFinish" type="xsd:NMTOKEN"/>
20 <xsd:attribute name="earlyStart" type="xsd:NMTOKEN"/>
21 <xsd:attribute name="finish" type="xsd:NMTOKEN"/>
22 <xsd:attribute name="fixed" type="xsd:string"/>
23 <xsd:attribute name="guidelines" type="xsd:string"/>
24 <xsd:attribute name="key" type="xsd:string"/>
25 <xsd:attribute name="lastUpdatedBy" type="xsd:string"/>
26 <xsd:attribute name="lastUpdatedDate" type="xsd:NMTOKEN"/>
27 <xsd:attribute name="lateFinish" type="xsd:NMTOKEN"/>
28 <xsd:attribute name="lateStart" type="xsd:NMTOKEN"/>
29 <xsd:attribute name="locked" type="xsd:string"/>
30 <xsd:attribute name="methodID" type="xsd:string"/>
31 <xsd:attribute name="milestone" type="xsd:string"/>
32 <xsd:attribute name="name" type="xsd:string"/>
33 <xsd:attribute name="outlineLevel" type="xsd:integer"/>
34 <xsd:attribute name="percComp" type="xsd:decimal"/>
35 <xsd:attribute name="priority" type="xsd:string"/>
36 <xsd:attribute name="proxy" type="xsd:string"/>
37 <xsd:attribute name="shortName" type="xsd:string"/>
38 <xsd:attribute name="start" type="xsd:NMTOKEN"/>
39 <xsd:attribute name="status" type="xsd:integer"/>
40 <xsd:attribute name="summary" type="xsd:string"/>
41 <xsd:attribute name="totalSlack" type="xsd:double"/>
42 <xsd:attribute name="unplanned" type="xsd:string"/>
43 <xsd:attribute name="userText1" type="xsd:string"/>
44 <xsd:attribute name="userText2" type="xsd:string"/>
45 <xsd:attribute name="userText3" type="xsd:string"/>
46 <xsd:attribute name="userText4" type="xsd:string"/>
47 <xsd:attribute name="userText5" type="xsd:string"/>
48 </xsd:complexType>
49 </xsd:element>
50 </xsd:schema>';
51 :INSTANCE1 :=
52 '<Task
53 UID="AJ\'UF`2=_```)O0H;"P!```?P```0" earlyStart="2010-04-20T08:00:00" category="Run"
54 baseTime="2010-03-26T09:22:00" lateStart="2010-04-20T08:00:00" start="2010-04-20T08:00:00"
55 proxy="false" earlyFinish="2010-05-12T17:00:00" lateFinish="2010-05-12T17:00:00"
56 critical="true" status="2" shortName="OASIS 3.2" outlineLevel="4" baseFinish="2010-06-11T17:00:00"
57 finish="2010-05-12T17:00:00" summary="false" baseStart="2010-05-17T08:00:00" baselineDuration="20.0"
58 milestone="false" name="OASI 3.2.1 : Association d'un plan A un PFO" fixed="true"
59 locked="false" key="false" percComp="1.0" totalSlack="0.0" unplanned="false"/>';
60 end;
61 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
SQL> set define on
SQL> --
SQL> declare
2 V_XML_SCHEMA xmlType := XMLType(:XMLSCHEMA1);
3 begin
4 DBMS_XMLSCHEMA.registerSchema
5 (
6 SCHEMAURL => :SCHEMAURL1,
7 SCHEMADOC => V_XML_SCHEMA,
8 LOCAL => TRUE,
9 GENBEAN => FALSE,
10 GENTYPES => TRUE,
11 GENTABLES => TRUE,
12 ENABLEHIERARCHY => DBMS_XMLSCHEMA.ENABLE_HIERARCHY_NONE
13 );
14 end;
15 /
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.46
SQL> desc TASK_TABLE
Name Null? Type
TABLE of SYS.XMLTYPE(XMLSchema "http://xmlns.example.com/testcase.xsd" Element "Task") STORAGE Object-relational TYPE "Task3632_T"
SQL> --
SQL> insert into TASK_TABLE values ( XMLTYPE(:INSTANCE1))
2 /
1 row created.
Elapsed: 00:00:00.01
SQL> commit
2 /
Commit complete.
Elapsed: 00:00:00.09and am able to extract the value of the name attribute correct
SQL> select XMLCAST(XMLQUERY('/Task/@name' passing OBJECT_VALUE returning content) as VARCHAR2(64))
2 from TASK_TABLE
3 /
XMLCAST(XMLQUERY('/TASK/@NAME'PASSINGOBJECT_VALUERETURNINGCONTEN
OASI 3.2.1 : Association d'un plan A un PFO
Elapsed: 00:00:00.00Could you try this simplied test in your database...
Edited by: mdrake on Nov 30, 2010 8:36 PM -
Error: ORA-01722: invalid number performing List of Values query.
when i created a cascading select list, For the first time it worked properly then little later
it is giving this error.
Error: ORA-01722: invalid number performing List of Values query: "select distinct cl_name d, cl_no r from Kclient where gr_no = :P1_GRNO order by 1
could any one please solve the problem?
2. when i run the application. in all the items edit button is automatically seen
including in the login screen.
could any one identify what is the error and give me a solution.Is this better?
select DISTINCT FIRST_NAME||' '||LAST_NAME display_value
, ROW_ID return_value
from "PSA_RESOURCE_MANAGER"
where PSA_RESOURCE_MANAGER.ACTIVE_FLAG='Y'
AND :P117_REPORTING_MANAGER = PSA_RESOURCE_MANAGER.REPORTING_MANAGER
AND :P117_REPORTING_MANAGER <> -1 order by 1or
select DISTINCT FIRST_NAME||' '||LAST_NAME display_value
, ROW_ID return_value
from "PSA_RESOURCE_MANAGER"
where PSA_RESOURCE_MANAGER.ACTIVE_FLAG='Y'
AND :P117_REPORTING_MANAGER = PSA_RESOURCE_MANAGER.REPORTING_MANAGER
AND :P117_REPORTING_MANAGER != '-1' order by 1Is ROW_ID a column in your table by the way? If not, you should use ROWID (without the underscore) -
ORA-01722: invalid number performing List of Values query
I have a situation here where I want to pass string value(available in search field) to POP up key LOV on another page as default value.
I passed item value in default field in POPup key LOV item.I am able to see string value but It also gave me following error.
Error: ORA-01722: invalid number performing List of Values query: "select CUSTOMER_NAME, CUSTOMER_ID from (select customer_name, customer_id from hed_customers) wwvlovinlineviewname where CUSTOMER_ID = :WWV_LOV_RETURN_KEY_UTIL_1111".
Without Default value, it work like champ.
Please suggest how to get rid of this error
Thanks in advanceI hit the same problem.
The thing is that, in APEX, a 'null' value in a form is not really null but gets passed on as '%'.
When that gets compared to a number, 01722 will occur.
A workaround is to define a 'value if null' that is an implicit number, like '-1'.
And lets hope no one ever uses that as a real ID...
Cheers
Peter -
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] -
Error: this application, or a library it uses, has passed an invalid numeric value (NaN, or not-a-number) to CoreGraphics API. This is a serious error and contributes to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
This console log is a note to the developers of whatever application you are using. You can safely ignore it.
-
Error Message - ORA-01722 Invalid Number
Hello:
I have the following situation. When I create an organization, a record is inserted into the following table, AGREEMENTS, and populates four fields.
I have an update form which selects the organization from the AGREEMENTS table so the user can populate the rest of the table. In addition, on this form, there is a drop-down box which allows the user to select the name of a legal document along with the version of the document in which the user needs to select. This select list is created via an LOV joining three tables. The item name for this select list is :P6_DOCUMENT.
The code for the LOV is:
SELECT S.DOC_NAME||' - '|| O.VERSION_NO AS DOC, O.ORG_DOC_CURR_KEY
FROM SUPPORTING_DOCS S,
ORG_DOC_CURR_VER O,
AGREEMENTS H
WHERE
S.DOC_TYPE = 'HISA'
AND S.SUPPORTING_DOC_KEY = O.SUPPORTING_DOC_KEY
AND H.ORG_KEY_LE = O.ORG_KEY
AND O.ORG_KEY=:P6_ORG_KEY_LEWhen the user completes the form, the SUBMIT process is a PL/SQL block consisting of an UPDATE statement to update the AGREEMENTS table based on the selected organization and an INSERT statement to insert a record into the AGREEMENTS_DOC table to store the value stored in :P7_DOCUMENT.
Ok, now here is where my problem starts.
When I first bring up the form and I select the organization I want to update, I click the Search button to find the organization and I receive the following error message: ORA-01722 Invalid Number.
At this point all I'm doing is a basic search. There is no insert/update or anything going on. I'm not understanding why I would be receiving this error message.
The search is based on the database column ORG_KEY_LE whose datatype is NUMBER.
In my application, the item assigned to ORG_KEY_LE is P6_ORG_KEY_LE.
I have a PL/SQL block process created (On Load-Before Header) in the Page Rendering area of my page definition. The PL/SQL code that is written is:
BEGIN
IF :P6_SEARCH_ORG != '0' THEN
:P6_ORG_KEY_LE := :P6_SEARCH_ORG;
END IF;
END;I then have an Item created, :P6_SEARCH_ORG, which is a Select List. In the LOV portion of the page for this item, I have the following:
select ORG_KEY_LE display_value, ORG_KEY_LE return_value
from AGREEMENTS
order by 1The reason for using this table is because this table contains the newly created organization which needs to be updated with the remaining columns of data.
I then have a Search button in the Button area which has the following settings:
Button Position: Region Template Position #CHANGE#.
Condition Type: Value of Item in Express 1 is NULL.
Expression 1: :P6_ORG_KEY_LE.
To troubleshoot this problem, I created two pages, one page to do the UPDATE and the second page to do the INSERT.
The SEARCH functionality in both pages are identical.
When I run my UPDATE page, which only involves updating the missing fields, the process works. I have my search box, I'm able to search for the organization, make my updates, and I'm good.
When I run my INSERT page, which involves inserting the record with the assigned document, I receive the error message after I click the SEARCH button. In order to INSERT the record into this table, I first need to SELECT the organization that was UPDATED in the AGREEMENTS table (using the UPDATE page described in above paragraph). When I select the organization, the user can then assign the appropriate legal document to the organization and insert the record into the AGREEMENTS_DOC table.
Can someone help me with this error message? I'm not sure why I am able to perform my SEARCH on a page with the UPDATE statement, not able to perform the SEARCH on the page with my INSERT statement, and not be able to perform the SEARCH on the page that combines the UPDATE and INSERT statements.
I did some more troubleshooting and I do believe my SUBMIT process which contains the INSERT statement is the issue. I created a fourth page which doesn't have a SUBMIT process. I brought up the form, searched for my organization and the information for that organization appeared. The problem is definately with my UPDATE/INSERT process.
The PL/SQL block for the Submit process is the following:
BEGIN
update
MDD.HISA_AGREEMENTS
set
LAST_UPDATED_BY=V('APP_USER'),
APPROVER_SALUTATION=:P6_APPROVER_SALUTATION,
APPROVER_FIRST_NAME=:P6_APPROVER_FIRST_NAME,
APPROVER_MIDDLE_INITIAL=:P6_APPROVER_MIDDLE_INITIAL,
APPROVER_LAST_NAME=:P6_APPROVER_LAST_NAME,
APPROVER_NAME_SUFFIX=:P6_APPROVER_NAME_SUFFIX,
APPROVER_EMAIL_ADDR=:P6_APPROVER_EMAIL_ADDR,
SPONSOR_EMAIL_ADDR=:P6_SPONSOR_EMAIL_ADDR,
APPROVER_TITLE=:P6_APPROVER_TITLE
where
ORG_KEY_LE=:P6_ORG_KEY_LE
INSERT INTO
HISA_AGREEMENT_DOCS
(HISA_AGREEMENT_DOC_KEY,
ORG_KEY_LE,
APPLICATION_KEY,
STATUS,
STATUS_DATE,
CREATED_BY,
ORG_DOC_CURR_KEY)
VALUES
(HISA_AGREEMENT_DOC_KEY_SEQ.NEXTVAL,
:P6_ORG_KEY_LE,
:P6_APPLICATION_KEY,
'C',
SYSDATE,
V('APP_USER'),
:P6_DOCUMENT)
END;There is something wrong with the above statement and I do not understand what it could be. Can someone help?
Thanks for the help.Hi,
I believe you are on to something.
The select list for item :P6_DOCUMENT appears when I first bring up the form. When I select my organization and receive the error message, I clicked on the Session in the Developer's bar. The value in item/field :P6_DOCUMENT shows %null%.
This is the path in which my user would like to accomplish her task:
1. Select an organization
2. Display the information for that organization from the AGREEMENTS table
3. Enter the data for the remaining fields in the AGREEMENTS table
4. Select the document (:P6_DOCUMENT) from the drop-down.
5. Click Submit
6. Update the AGREEMENTS table with data entered in #3.
7. Insert a record into the AGREEMENTS_DOC table with the selection from #4.
Somehow I need the :P6_DOCUMENT field not to show the %null% during the SEARCH functionality. I think that is causing the problem.
How do I fix this? -
Error Message (ORA-01722: invalid number) when add amount into Number field
I am using VB.net, trying to insert data into a field called amt with Data Type 'Number'.
my vb.net code is as follows
Dim oradb As String = DatabaseConnectionString
Dim AmountValue As Decimal = 123.45
'get the connection
Dim conn As New OracleConnection(oradb)
'open the database connection
conn.Open()
'create oracle command
Dim cmd As New OracleCommand("INSERT INTO TBL1 (AMT) VALUES (:AMT)", conn)
cmd.CommandType = CommandType.Text
cmd.Parameters.Add(":AMT", OracleDbType.Decimal, AmountValue, ParameterDirection.Input)
'Execute
cmd.ExecuteNonQuery()
I got error message "ORA-01722: invalid number". Please helpDid you also change the below line before inserting Integer 123:
cmd.Parameters.Add(":AMT", OracleDbType.Decimal, AmountValue, ParameterDirection.Input)
to
cmd.Parameters.Add(":AMT", OracleDbType.Integer, AmountValue, ParameterDirection.Input) -
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 -
User Accounts and ORA-01722: invalid number error
Hello,
I have been using Express for a month or so now but have very limited knowledge of how it works.
My Problem:
I have a listing screen for user records which creates records in table QAS_USERS.
When I add a record it saves the data OK and put the record in the list.
When I click on the record in the list it takes me to the edit screen and I can change
the details and it works OK and all the changes get saved to the database.
On the data entry screen I have a list of the User Groups so I can select what group
the user will be in, usual details in username, fullname, email address, password etc..
I then added a routine to create a USER in the APEX Manage USERs.
It creates the record in my table QAS_USERS and it creates a APEX User Account with
the correct details and the record is displayed in the list.
So far so good.
Now the errors start:
1. When I look at the User Account in Administration -> Manage Application Express Users
most of the details have been added but the User Group does not get allocated.
2. The record I created in QAS_USERS appears in the list on my listing screen but when
I click on the Edit Icon on the left of the list I get the following error appear
when the screen changes to the edit screen:
ORA-01722: invalid number
Unable to fetch row error
QAS_USER Table:
ID NUMBER
CREATED_ON DATE
CREATED_BY VARCHAR2(10)
CHANGED_ON DATE
CHANGED_BY VARCHAR2(10)
ACTIVE VARCHAR2(3)
USERNAME VARCHAR2(10)
FULLNAME VARCHAR2(30)
TEAMLEADER VARCHAR2(3)
TEAMLEADER_ID NUMBER
LAB NUMBER
DIRECTOR VARCHAR2(3)
ACTION_MANAGER VARCHAR2(3)
SDM VARCHAR2(3)
GM VARCHAR2(3)
EMAIL_ADDRESS VARCHAR2(50)
PASSWORD VARCHAR2(12)
SDTL VARCHAR2(3)
FIRSTNAME VARCHAR2(30)
LASTNAME VARCHAR2(30)
GROUP_ID NUMBER
USER_ID VARCHAR2(20)
Process Script to create the Express User Account:
Declare
group_id NUMBER;
BEGIN
group_id := APEX_UTIL.get_group_id (:P15_GROUP_ID);
APEX_UTIL.CREATE_USER (
P_USER_NAME => :P15_USERNAME,
P_FIRST_NAME => :P15_FIRSTNAME,
P_LAST_NAME => :P15_LASTNAME,
P_WEB_PASSWORD => :P15_PASSWORD,
P_EMAIL_ADDRESS => :P15_EMAIL_ADDRESS,
p_developer_privs => 'ADMIN',
p_group_ids => group_id);
END;
If any one has any ideas I would be very grateful.
Regards,
Simon.Hi,
It could be that this is because you are using SYSDATE which contains the time as a fraction rather than TRUNC(SYSDATE) which just contains the current time. It could be that your working_dates_between raises this error.
However, your formula is far more complicated than it needs to be.
Firstly, you want to look at the date window ADD_MONTHS(TRUNC(SYSDATE), -6) to TRUNC(SYSDATE). Then you want to look at the portion of the absence that falls in the date window. This is GREATEST(Absence Attendance.Actual Start Date, ADD_MONTHS(TRUNC(SYSDATE), -6)) to LEAST(NVL(Absence Attendance."Actual End Date",TRUNC(SYSDATE)), TRUNC(SYSDATE)). You may need to add 1 to the absence end date because this is the last day of their absence rather than the date they return. It depends how you calculate the days between the start and end
date of the absence. You can create calculations for the start and end date of the absences within the 6 months time window. Create calculation AbsenceStart as
GREATEST(Absence Attendance.Actual Start Date, ADD_MONTHS(TRUNC(SYSDATE), -6))
and AbsenceEnd as
LEAST(NVL(Absence Attendance."Actual End Date",TRUNC(SYSDATE)), TRUNC(SYSDATE))
Then you need to only pick up absence that a part of the absence in your 6 month date window. You can use a condition in the workbook or a condition in a case statement to do this. You then need to calculate the difference between these dates and SUM all the values.
SUM(CASE WHEN AbsenceEnd >= AbsenceStart THEN WORKING_DAYS_BETWEEN(AbsenceStart, AbsenceEnd) END)
That's it. Not so complicated after all.
Rod West -
ORA-01722: Invalid number - error only in Oracle 10g?
While trying to insert a numeric value into a decimal column, I get this error. Hitherto, my update statements used to look fine.
Can anyone let me know if this enforcement is specific to Oracla 10g? I am running :
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Thanks in advance for your help!
NiranjanWell, you've a blank space which isn't a number, that's why you have an error.
Please see the following example to have a default value :
SQL> create table tutu (id number, text varchar2(10));
Table created.
SQL> alter table tutu modify id default 0;
Table altered.
SQL> insert into tutu values (' ', 'NoWork');
insert into tutu values (' ', 'NoWork')
ERROR at line 1:
ORA-01722: invalid number
SQL> insert into tutu values (null,'NullValue');
1 row created.
SQL> insert into tutu (text) values ('Default');
1 row created.
SQL> insert into tutu values (1,'NonDefault');
1 row created.
SQL> select * from tutu;
ID TEXT
NullValue
0 Default
1 NonDefault
SQL> Nicolas.
Message was edited by:
N. Gasparotto -
ORA-01722: invalid number error - column data type is date
Hi all,
When I perform this statement everything is ok, but some of clientbirthday values are null:
select d.id, d.name, d.contragenttypeid, d.reestrtypeid, d.clientbirthday
from creator.contragent d
where d.contragenttypeid = 3
and d.reestrtypeid in (2,4) When I'm trying to get "d.clientbirthday is not null" I receive error:
select d.id, d.name, d.contragenttypeid, d.reestrtypeid, d.clientbirthday
from creator.contragent d
where d.contragenttypeid = 3
and d.reestrtypeid in (2,4)
and d.clientbirthday is not null ORA-01722: invalid number
What is wrong? Why does it say "number" when clientbirthday column datatype is date ?Can you make a desc creator.contragent
-
ORA-01722: invalid number - Error during implicit conversion (10g vls 11g)
I am facing oracle error for few SELECT queries in 11g which were working fine in 10g environment.
Oracle Version:
10g - 10.2.0.5.0
11g - 11.2.0.3.0
We are storing numeric values under CHAR or VARCHAR2 column in few tables. This is known design issue & it can't be changed for now.
I know this will work fine until all the data is numeric in those columns for respective table. Because by some reason, if any row got character value for that column then implicit string to number conversion will fail and this error can occur. But I have verified that there is no data issue.
But I can see difference in the execution plan! But not able to recognize the reason issue.
Any other pointers on why the queries are failing in 11g would be of great help..
Example SQL:
Note that table structure and data is same in both the environments.
View Definition -
CREATE OR REPLACE FORCE VIEW CIMSOS.LC_LOCATIONS
( COUNTRY_ID, PRODUCTID,
LANGUAGE_ID, LOCATION_NAME,
LOCATION_SHORT_NAME, TAG_ID, LOCATION_DEFINITION,
COMPOSITEKEY, GLOBAL_LOCATION_KEY,
CPRODUCTKEYID, CMODVERSION)
AS
SELECT
CCOUNTRY_ID AS COUNTRY_ID,
CPRODUCTID AS PRODUCTID,
CLANGUAGE_CODE AS LANGUAGE_ID,
CLOCATION_NAME AS LOCATION_NAME,
CLOCATION_SHORT_NAME AS LOCATION_SHORT_NAME,
CTAG_ID AS TAG_ID,
CLOCATION_DEFINITION AS LOCATION_DEFINITION,
CCOMPOSITEKEY AS COMPOSITEKEY,
CGLOBAL_LOCATION_KEY0 AS GLOBAL_LOCATION_KEY,
cproductkeyid,
cmodversion
FROM mct_35193, goldencopy
WHERE cproductkeyid = productkey
AND cmodversion = version
AND catalogid = 35193;Facing issue for SQL query based on above view:
** In 10g Env
SELECT * FROM LC_LOCATIONS WHERE productid = 75;
-- It executes successfully and provide required results.
Explain Plan:
SELECT STATEMENT ALL_ROWSCost: 12 Bytes: 416 Cardinality: 4
4 NESTED LOOPS Cost: 12 Bytes: 416 Cardinality: 4
1 INDEX RANGE SCAN INDEX CIMSOS.GOLDENCOPY_INDX1 Cost: 10 Bytes: 30,225 Cardinality: 2,015
3 TABLE ACCESS BY INDEX ROWID TABLE CIMSOS.MCT_35193 Cost: 1 Bytes: 89 Cardinality: 1
2 INDEX UNIQUE SCAN INDEX (UNIQUE) CIMSOS.XPK_MCT_34342 Cost: 0 Cardinality: 1 ** In 11g Env
SELECT * FROM LC_LOCATIONS WHERE productid = 75;
ORA-01722: invalid number
Explain Plan:
SELECT STATEMENT ALL_ROWSCost: 40 Bytes: 8,692 Cardinality: 82
3 NESTED LOOPS Cost: 40 Bytes: 8,692 Cardinality: 82
1 TABLE ACCESS FULL TABLE CIMSOS.MCT_35193 Cost: 22 Bytes: 819 Cardinality: 9
2 INDEX RANGE SCAN INDEX CIMSOS.GOLDENCOPY_INDX1 Cost: 2 Bytes: 135 Cardinality: 9
-- Executes when value is passed as character.
SELECT * FROM LC_LOCATIONS WHERE productid = '75';The problem doesn't appear to be related to the Oracle version, at least not directly. If your query plan does the string to number conversion before eliminating the rows that have non-numeric data, you'll get an error. If the query plan eliminates the rows that have non-numeric data before doing the conversion, the query will succeed. It is entirely possible that you'd get the "bad" plan in 10g or the "good" plan in 11g.
You can capture the query plans from your 10g database and move them over to the 11g database. Oracle has a nice white paper on upgrading from 10g to 11g that walks you through that process.
Of course, you really don't want to be dependent on the optimizer picking the "right" plan, you really want to fix the underlying data model issue.
Justin -
ORA-01722: invalid number error with Bulk collect
Hi ,
I have been using the script to delete old seasonal data from my application DB tables. The stored procedure has been created successfully but when i try to run the proc it has been throwing 'ORA-01722: invalid number' exception at line 'FETCH C1_CUR BULK COLLECT INTO C1_TYPE_VAR LIMIT v_bulklimit;'.
Could you please help me here?
Below is the stored proc:
CREATE OR REPLACE PROCEDURE clean_old_season_data(P_SEASON VARCHAR2) AS
CURSOR C1_CUR IS SELECT ROWID RID,pro.* FROM PROPS pro where pro.ITEMPK IN
(SELECT sve.pk FROM SAVEDVALUEENTRY sve WHERE sve.p_parent IN
(SELECT s.pk FROM SAVEDVALUES s WHERE s.P_MODIFIEDITEM IN
(SELECT a.PK
FROM products a
WHERE a.p_season IN (select s.pk from Seasons s where s.P_code=P_SEASON)
) ) ) and rownum<5;
CURSOR C2_DEL IS SELECT RID FROM PROPS_HISTORY;
TYPE C1_TYPE IS TABLE OF C1_CUR%ROWTYPE;
C1_TYPE_VAR C1_TYPE;
TYPE C2_TYPE IS TABLE OF UROWID;
C2_TYPE_VAR C2_TYPE;
ex_dml_errors EXCEPTION;
PRAGMA EXCEPTION_INIT(ex_dml_errors, -24381);
l_error_count NUMBER;
err_num NUMBER;
err_msg VARCHAR2 (300);
COMMIT_VARIABLE PLS_INTEGER:=0;
v_bulklimit NUMBER:=2;
BEGIN
/*------------------ Data Selection and INSERTION IN HISTORY TABLE ---------------------------------------*/
OPEN C1_CUR;
LOOP
DBMS_OUTPUT.put_line('Cursor opend now in loop');
FETCH C1_CUR BULK COLLECT INTO C1_TYPE_VAR LIMIT v_bulklimit;//ERROR OCCURS HERE
DBMS_OUTPUT.put_line('Cursor count is'|| C1_TYPE_VAR.COUNT);
FORALL I IN 1..C1_TYPE_VAR.COUNT SAVE EXCEPTIONS
INSERT INTO PROPS_HISTORY VALUES C1_TYPE_VAR(I);
COMMIT_VARIABLE := COMMIT_VARIABLE + v_bulklimit;
DBMS_OUTPUT.put_line('Commit variable'|| COMMIT_VARIABLE.COUNT);
IF COMMIT_VARIABLE = v_bulklimit THEN
COMMIT;
COMMIT_VARIABLE := 0;
END IF;
EXIT WHEN C1_CUR%NOTFOUND;
END LOOP;
DBMS_OUTPUT.put_line('Cursor closed now in loop and data inserted in history table');
CLOSE C1_CUR;
/*------------------ Data Selection and DELETION IN Live TABLE ---------------------------------------*/
COMMIT_VARIABLE := 0;
OPEN C2_DEL;
LOOP
FETCH C2_DEL BULK COLLECT INTO C2_TYPE_VAR LIMIT 2;
FORALL I IN 1..C2_TYPE_VAR.COUNT SAVE EXCEPTIONS
DELETE FROM PROPS WHERE ROWID = C2_TYPE_VAR(I);
COMMIT_VARIABLE := COMMIT_VARIABLE + 2;
IF COMMIT_VARIABLE = 2 THEN
COMMIT;
COMMIT_VARIABLE := 0;
END IF;
EXIT WHEN C2_DEL%NOTFOUND;
END LOOP;
CLOSE C2_DEL;
END;Although there are many things which should not have been done in the posted code, I could not find any reason why the Invalid number error should occur at the Fetch clause.
I would suggest you to Insert into Table by providing the Order of Columns i.e. Insert into table (col1, ... colN) values (coll(i).col1...col(i).colN);
I tested below code and it did not give any errors.
drop table test_table;
create table test_Table
rid varchar2(100),
emp_id number(5),
fname varchar2(20),
lname varchar2(50)
set serveroutput on;
declare
cursor c_cur is
select rowid rid, e.*
from employees e
where rownum < 10;
type typ_cur is table of c_cur%rowtype;
typ typ_cur;
l_bulk_limit number := 5;
begin
open c_cur;
loop
fetch c_cur bulk collect into typ limit l_bulk_limit;
dbms_output.put_line('Collection Count :: ' || typ.count);
forall i in 1..typ.count --typ.first..typ.last
insert into test_Table (rid, emp_id, fname, lname) values (typ(i).rid,typ(i).employee_id,typ(i).first_name,typ(i).last_name);
dbms_output.put_line('Processed ' || l_bulk_limit || ' records.');
exit when c_cur%notfound;
end loop;
commit;
end;
select * from test_table;PS:- 1. When you are processing only 4 Records, then why are you breaking them in 2 Loops?
2. Why Commit every time you are processing a DML? Why not maintain an Error Flag and Rollback the Transaction as soon as error is encountered?
3. Use "{code}" (Exclude Double Quotes) to format the code. I am not sure if works.
Regards,
P. -
'ORA-01722: Invalid number' error message in BeX
Hi Gurus,
We have a new report built on top of a DSO. When I run this report, I get the message 'ORA-01722: invalid number'. On furthur testing, I found that when I move two objects 'Date Changed' & 'Time Changed' [both are 'Z' objects we created] from the 'Rows' to 'Free Characteristics', the report runs as expected. So the issue seems that it is with these two objects. One of them is of type 'DATS' & the other of type 'TIMS'. These two are mapped to respective 'Date' & 'Time' fields in SAP R3.
SID's exists in the Master Data tables for both these objects. The data for both the fields contains the normal 'Date' & 'Time' values.Running the query using RSRT shows the same error message. The RSRV check on this report says that 'Query execution not possible as the variables contain invalid values'.
I have seen a couple of other posts in SDN with similar issues but none of them have a solution identified so far. Just wanted to check if anyone who has experienced this issue have been successfully able to resolve it?
Thanks
ArvindHi Ravi,
Thanks for your prompt reply. Yes, the 'Date' & 'Time' objects have 0DATE & 0TIME as reference objects.
I couldn't find any invalid vallues for these date and time fields. If invalid values were present, wouldn't the DSO activation have failed?
Thanks
Arvind.
Maybe you are looking for
-
[MSI K7N2 Delta-ILSR] Trouble
Hello, I have some serious trouble with my pc, my system specs are: -Unlocked Amd 2400+ (AXDA2400DKV3C from August 21, 2002) -Msi K7N2 delta-ilsr -Palit GeForce FX5900XT -Std. 512mb pc2700 -Std. 512mb pc3200 -More stuff The problem is that I can't ch
-
Midi loops play tones instead of music
Hello, I am having a problem with my Garageband loops that I can't seem to solve. Basically the problem is that when I select a midi loop (The green ones?) I get tones instead of the music. If I preview the loop in the loop browser the music plays fi
-
I have the 1st generation ipod touch looking to trade for the new ipod touch or someone to give me money for the new ipod touch
-
Oracle parameters related kernel parameters
Hi, Can anyone tell me hwo can i get the info about the oracle parameters which are related to os, for example- i am getting a request to change the process parameter for the db instance which are the kernel parameters need to be changed.. so we have
-
How OTI File format can be converted to Hexadecimal Format
ota format now we have to devlop it in hexa format N the format which we can use to deliver by sms thrue smsc