Ora-31001 invalid reference when enqueuing xmltype payload w/ dtd file ref
We're using AQ to store xmltype payloads in an Oracle 10gR2 DB.
We're able to enqueue normal XML payloads without issue, but recently we've attempted to enqueue XML with a DOCTYPE tag with reference to a dtd file. This results in an ora-31001 error stating the file reference for the dtd is invalid.
We've tried moving the dtd around, but are unsure what the oracle dbms thinks is the base dir for the file reference.
I've seen some documentation for xmldb that states the dtd must be located in reference to the xml doc, but as we are enqueueing an xmltype datatype in AQ I'm not sure how this can be applied. I've also seen documentation about using a dbms package to set the base url, but am also not sure how to apply it to this situation.
Anyone able to tell me where I can drop this dtd so that Oracle can reference it when parsing the xml during an enqueue?
Thanks!
Tony
Sorry didn't receive email notification of your response, or I would have replied sooner. Seems like that is happening on the forums sometimes.
Here is a pl/sql block for enqueueing xml into a queue table with an xmltype payload:
BEGIN
declare
enqOpts dbms_aq.enqueue_options_t;
msgProps dbms_aq.message_properties_t;
enqMsgid raw(16);
begin
dbms_aq.enqueue(
queue_name => 'YOUR_QUEUE_NAME',
enqueue_options => enqOpts,
message_properties => msgProps,
payload => XMLType (
'<INSERT XML HERE>'),
msgid => enqMsgId);
commit;
END ;
END;
/
Similar Messages
-
Hi,
When i am trying to parse the xml document using XDB API. I passed the XML file path to the parse function and making use of that at below lines of code.
xmlparser.setBaseDir(prsr, dir);
xmlparser.parse (prsr, dir || '/' || file_in);
In thsi sceneraio it is giving the below error saying invalid path. But i am giving the right path. And even the file having all permission( 777).
Can any please help me why i am getting this error even if i mentioned the correct path? Is there anything related the permission grants?
ORA-31001: Invalid resource handle or path name "/apps/batchadm/files/test.xml"
ORA-06512: at "SYS.XDBURITYPE", line 11
ORA-06512: at "XDB.DBMS_XSLPROCESSOR", line 142
ORA-29280: invalid directory path
ORA-29280: invalid directory path
ORA-29280: invalid directory path
ORA-06512: at "XDB.DBMS_XMLPARSER", line 119
ORA-06512: at "SIGCAP.PARSE_DOCUMENT", line 11
Thanks,
shashiCould be privs on OS or database level. Check and see what happens if grant yourself the DBA role. Check if the database software owner (ps -ef | grep pmon) is allowed to write in that directory and/or create a file in that directory. Does the OS make use of ACL's (and/or is, for instance Secure, Linux used)....?
-
FTP-ing to XE: ORA-31001: Invalid resource handle or path name
Hi guys,
Hope you can help me out here. I get a very confusing message during trying to FTP a directory to the /i/ files in XE. The connectiopn works just fine, but when I try to send something to the folder I get the following message:
ORA-31001: Invalid resource handle or path name "/i/themes/eServices"
Any thoughts? Thanks!I haven't checked the docs, but it does remind me of the PL/SQL steps required to do similar things. Maybe you need to mkdir first (could it be XMKD? See below...)
C:\>ftp
ftp> open localhost 2100
Connected to XYZHOST.mycompany.com.
220- XYZHOST
Unauthorised use of this FTP server is prohibited and may be subject to civil an
d criminal prosecution.
220 XYZHOST FTP Server (Oracle XML DB/Oracle Database) ready.
User (XYZHOST.mycompany.com:(none)): sys
331 pass required for SYS
Password:
230 SYS logged in
ftp> pwd
257 "/" is current directory.
ftp> cd i
250 CWD Command successful
ftp> pwd
257 "/i" is current directory.
ftp> quote help
214- The following commands are recognized:
USER PORT RETR MSND* ALLO* DELE SITE* MKD XPWD
PASS PASV STOR MSOM* REST* CWD SYST XMKD CDUP
ACCT* TYPE APPE MSAM* RNFR XCWD STAT* RMD XCUP*
REIN* STRU MLFL* MRSQ* RNTO LIST HELP XRMD STOU
QUIT MODE MAIL* MRCP* ABOR NLST NOOP PWD
214 (*'s => unimplemented)
ftp> -
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,
TomORA-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 -
XML Basic Demo - ORA-31001: Invalid resource handle or path name
I have been attempting to install the xml basic demo into Oracle 9.2.0.3. The initial setup appears to go OK, but upon attempting to run '1.1 Make Directories' as the demo user (in my case: xdbdemouser/xdbdemouser), I get the following error message:
ERROR at line 1:
ORA-31001: Invalid resource handle or path name "/home/XDBDEMOUSER/"
ORA-06512: at "XDB.DBMS_XDB", line 168
ORA-06512: at line 5
If I run this script as system or xdb, it appears to work OK. Obviously, the xdbdemouser exists in the database....
Can anyone help ??
thx - mattDid you run 0.0 and 0.1 before running this step. You must run resetDemo before starting the demo for the first time.
-
ORA-31001: Invalid resource handle or path name
I am using Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production.
I need to read xml contents from a file at D:\ on my windows system.
File name is test.xml.
I am using the system account as its a personal server.
I tried as follows:
SQL> CREATE DIRECTORY myxml AS 'D:';
SQL> declare
2 parser xmlparser.Parser;
3 begin
4 xmlparser.parse(parser,'myxml\test.xml');
5 end;
6 /
declare
ERROR at line 1:
ORA-31001: Invalid resource handle or path name "myxml\test.xml"
ORA-06512: at "SYS.XDBURITYPE", line 11
ORA-06512: at "XDB.DBMS_XSLPROCESSOR", line 142
ORA-29280: invalid directory path
ORA-29280: invalid directory path
ORA-29280: invalid directory path
ORA-06512: at "XDB.DBMS_XMLPARSER", line 120
ORA-06512: at line 4
D: is a FAT32 partition so Windows 7 offers no acl/permission restrictions. I have also tried from other different locations and the error is the same.
Please help me.907985 wrote:
SQL> CREATE DIRECTORY myxml AS 'D:';
ORA-29280: invalid directory path
ORA-06512: at "XDB.DBMS_XMLPARSER", line 120I haven't tried it, but perhaps it's as simple as error message implies. Try with at least one directory e.g. D:\ or D:\somefoldername in the directory object's path name. -
ORA-00911:invalid character when loading an XML doc to the XMLType column
We have followed this code snippet: http://www.oracle.com/technology/sample_code/tech/java/codesnippet/xmldb/Example_Code.html#createclob
using the CLOB object to load an XML Document which has more 4000 characters to the XMLType column, we got the error -- ORA-00911:invalid character.
Sound likes an encoding issue? any suggestions would be appreciated.
BTW, we're able to use the TopLink's mapping -- Direct-to-Field to insert an XML String (<4000 characters) to the XMLType column.
Thanks!Try removing the semi-colon at the end of your statement. That is the cause of ORA-911 with DBMS_SQL.PARSE and EXECUTE IMMEDIATE, I don't see why ADO should be any different.
Cheers, APC -
"ORA-00902: invalid datatype" when trying to register local schema
I'm trying to register a local schema which uses/includes a global schema(s). I validated the schemas using XMLSpy.
Registering the global schema(s) was successful. Registering these global schemas was done under user "Generic". For local schemas, that use global schema, a new user is created, and the following script is executed.
SQL> --
SQL> -- Create user
SQL> --
SQL> create user &1 identified by &2
2 temporary TABLESPACE temp
3 default TABLESPACE users;
old 1: create user &1 identified by &2
new 1: create user Simple identified by Simple
User created.
Elapsed: 00:00:00.03
SQL> --
SQL> -- Grant privileges
SQL> --
SQL> grant create session to &1;
old 1: grant create session to &1
new 1: grant create session to Simple
Grant succeeded.
Elapsed: 00:00:00.01
SQL> grant resource to &1;
old 1: grant resource to &1
new 1: grant resource to Simple
Grant succeeded.
Elapsed: 00:00:00.01
SQL> -- Dunno if following is required for local schemas, but if I remove I can't FTP
SQL> grant dba, xdbadmin to &1;
old 1: grant dba, xdbadmin to &1
new 1: grant dba, xdbadmin to Simple
Grant succeeded.
Elapsed: 00:00:00.02
SQL>
SQL> --
SQL> -- Connect ;-)
SQL> --
SQL> connect &1/&2@SVF91;
Connected.
===========================================================
SQL> --
SQL> -- Register the schema in Oracle
SQL> --
SQL> BEGIN
2 DBMS_XMLSchema.registerSchema(
3 schemaURL => '&1',
4 schemaDoc => xdbURIType('&2').getClob(),
5 local => TRUE,
6 genTypes => TRUE,
7 genBean => FALSE,
8 genTables => TRUE);
9 END;
10 /
old 3: schemaURL => '&1',
new 3: schemaURL => 'http://http://ehvl091a:8080/home/Simple/xsd/SimplePOI.xsd',
old 4: schemaDoc => xdbURIType('&2').getClob(),
new 4: schemaDoc => xdbURIType('/home/Simple/xsd/SimplePOI.xsd').getClob(),
BEGIN
ERROR at line 1:
ORA-31084: error while creating table "SIMPLE"."SIMPLE_XPOI" for element
"XPOIS"
ORA-00902: invalid datatype
ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 20
ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 31
ORA-06512: at line 2
The schema I use is:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:POI="POI" xmlns:xdb="http://xmlns.oracle.com/xdb" targetNamespace="POI" elementFormDefault="qualified" attributeFormDefault="unqualified" xdb:storeVarrayAsTable="true">
<xs:include schemaLocation="http://ehvl091a:8080/home/Generic/xsd/POI.xsd"/>
<xs:element name="XPOIS" xdb:defaultTable="SIMPLE_XPOI">
<xs:annotation>
<xs:documentation>A collection of XPOI</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="Simple" minOccurs="3" maxOccurs="unbounded" xdb:columnProps="NOT SUBSTITUTABLE">
<xs:complexType>
<xs:complexContent>
<xs:extension base="POI:POIType"/>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
I'm new at this XML (Oracle) stuff, so i could really use some pointers on how to tackle this. Thanks in advance.The following example works for me...
SQL> connect / as sysdba
Connected.
SQL> --
SQL> drop user global cascade
2 /
User dropped.
SQL> drop user local cascade
2 /
User dropped.
SQL> create user global identified by global
2 /
User created.
SQL> grant connect, resource, alter session, create view, xdbadmin to global
2 /
Grant succeeded.
SQL> create user local identified by local
2 /
User created.
SQL> grant connect, resource, alter session, create view to local
2 /
Grant succeeded.
SQL> connect global/global
Connected.
SQL> --
SQL> var schemaURL varchar2(256)
SQL> var schemaPath varchar2(256)
SQL> --
SQL> begin
2 :schemaURL := 'poTypes.xsd';
3 :schemaPath := '/public/poTypes.xsd';
4 end;
5 /
PL/SQL procedure successfully completed.
SQL> declare
2 res boolean;
3 xmlSchema xmlType := xmlType(
4 '<!-- edited with XML Spy v4.0 U (http://www.xmlspy.com) by Mark (Drake) -->
5 <xs:schema xmlns="http://xmlns.oralce.com/demo/xdb/purchaseOrderTypes" targetNamespace="http://xmlns.oralce.com/demo/xdb/purchaseOrderT
ypes" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb" version="1.0" xdb:storeVarrayAsTable="true">
6 <xs:complexType name="LineItemsType" xdb:SQLType="LINEITEMS_T">
7 <xs:sequence>
8 <xs:element name="LineItem" type="LineItemType" maxOccurs="unbounded" xdb:SQLName="LINEITEM" xdb:SQLCollType="LINEIT
EM_V"/>
9 </xs:sequence>
10 </xs:complexType>
11 <xs:complexType name="LineItemType" xdb:SQLType="LINEITEM_T">
12 <xs:sequence>
13 <xs:element name="Description" type="DescriptionType" xdb:SQLName="DESCRIPTION"/>
14 <xs:element name="Part" type="PartType" xdb:SQLName="PART"/>
15 </xs:sequence>
16 <xs:attribute name="ItemNumber" type="xs:integer" xdb:SQLName="ITEMNUMBER" xdb:SQLType="NUMBER"/>
17 </xs:complexType>
18 <xs:complexType name="PartType" xdb:SQLType="PART_T">
19 <xs:attribute name="Id" xdb:SQLName="PART_NUMBER" xdb:SQLType="VARCHAR2">
20 <xs:simpleType>
21 <xs:restriction base="xs:string">
22 <xs:minLength value="10"/>
23 <xs:maxLength value="14"/>
24 </xs:restriction>
25 </xs:simpleType>
26 </xs:attribute>
27 <xs:attribute name="Quantity" type="moneyType" xdb:SQLName="QUANTITY"/>
28 <xs:attribute name="UnitPrice" type="quantityType" xdb:SQLName="UNITPRICE"/>
29 </xs:complexType>
30 <xs:simpleType name="ReferenceType">
31 <xs:restriction base="xs:string">
32 <xs:minLength value="18"/>
33 <xs:maxLength value="30"/>
34 </xs:restriction>
35 </xs:simpleType>
36 <xs:complexType name="ActionsType" xdb:SQLType="ACTIONS_T">
37 <xs:sequence>
38 <xs:element name="Action" maxOccurs="4" xdb:SQLName="ACTION" xdb:SQLCollType="ACTION_V">
39 <xs:complexType xdb:SQLType="ACTION_T">
40 <xs:sequence>
41 <xs:element name="User" type="UserType" xdb:SQLName="ACTIONED_BY"/>
42 <xs:element name="Date" type="DateType" minOccurs="0" xdb:SQLName="DATE_ACTIONED"/>
43 </xs:sequence>
44 </xs:complexType>
45 </xs:element>
46 </xs:sequence>
47 </xs:complexType>
48 <xs:complexType name="RejectionType" xdb:SQLType="REJECTION_T">
49 <xs:all>
50 <xs:element name="User" type="UserType" minOccurs="0" xdb:SQLName="REJECTED_BY"/>
51 <xs:element name="Date" type="DateType" minOccurs="0" xdb:SQLName="DATE_REJECTED"/>
52 <xs:element name="Comments" type="CommentsType" minOccurs="0" xdb:SQLName="REASON_REJECTED"/>
53 </xs:all>
54 </xs:complexType>
55 <xs:complexType name="ShippingInstructionsType" xdb:SQLType="SHIPPING_INSTRUCTIONS_T">
56 <xs:sequence>
57 <xs:element name="name" type="NameType" minOccurs="0" xdb:SQLName="SHIP_TO_NAME"/>
58 <xs:element name="address" type="AddressType" minOccurs="0" xdb:SQLName="SHIP_TO_ADDRESS"/>
59 <xs:element name="telephone" type="TelephoneType" minOccurs="0" xdb:SQLName="SHIP_TO_PHONE"/>
60 </xs:sequence>
61 </xs:complexType>
62 <xs:simpleType name="moneyType">
63 <xs:restriction base="xs:decimal">
64 <xs:fractionDigits value="2"/>
65 <xs:totalDigits value="12"/>
66 </xs:restriction>
67 </xs:simpleType>
68 <xs:simpleType name="quantityType">
69 <xs:restriction base="xs:decimal">
70 <xs:fractionDigits value="4"/>
71 <xs:totalDigits value="8"/>
72 </xs:restriction>
73 </xs:simpleType>
74 <xs:simpleType name="UserType">
75 <xs:restriction base="xs:string">
76 <xs:minLength value="1"/>
77 <xs:maxLength value="10"/>
78 </xs:restriction>
79 </xs:simpleType>
80 <xs:simpleType name="RequestorType">
81 <xs:restriction base="xs:string">
82 <xs:minLength value="0"/>
83 <xs:maxLength value="128"/>
84 </xs:restriction>
85 </xs:simpleType>
86 <xs:simpleType name="CostCenterType">
87 <xs:restriction base="xs:string">
88 <xs:minLength value="1"/>
89 <xs:maxLength value="4"/>
90 </xs:restriction>
91 </xs:simpleType>
92 <xs:simpleType name="VendorType">
93 <xs:restriction base="xs:string">
94 <xs:minLength value="0"/>
95 <xs:maxLength value="20"/>
96 </xs:restriction>
97 </xs:simpleType>
98 <xs:simpleType name="PurchaseOrderNumberType">
99 <xs:restriction base="xs:integer"/>
100 </xs:simpleType>
101 <xs:simpleType name="SpecialInstructionsType">
102 <xs:restriction base="xs:string">
103 <xs:minLength value="0"/>
104 <xs:maxLength value="2048"/>
105 </xs:restriction>
106 </xs:simpleType>
107 <xs:simpleType name="NameType">
108 <xs:restriction base="xs:string">
109 <xs:minLength value="1"/>
110 <xs:maxLength value="20"/>
111 </xs:restriction>
112 </xs:simpleType>
113 <xs:simpleType name="AddressType">
114 <xs:restriction base="xs:string">
115 <xs:minLength value="1"/>
116 <xs:maxLength value="256"/>
117 </xs:restriction>
118 </xs:simpleType>
119 <xs:simpleType name="TelephoneType">
120 <xs:restriction base="xs:string">
121 <xs:minLength value="1"/>
122 <xs:maxLength value="24"/>
123 </xs:restriction>
124 </xs:simpleType>
125 <xs:simpleType name="DateType">
126 <xs:restriction base="xs:date"/>
127 </xs:simpleType>
128 <xs:simpleType name="CommentsType">
129 <xs:restriction base="xs:string">
130 <xs:minLength value="1"/>
131 <xs:maxLength value="2048"/>
132 </xs:restriction>
133 </xs:simpleType>
134 <xs:simpleType name="DescriptionType">
135 <xs:restriction base="xs:string">
136 <xs:minLength value="1"/>
137 <xs:maxLength value="256"/>
138 </xs:restriction>
139 </xs:simpleType>
140 </xs:schema>');
141 begin
142 if (dbms_xdb.existsResource(:schemaPath)) then
143 dbms_xdb.deleteResource(:schemaPath);
144 end if;
145 res := dbms_xdb.createResource(:schemaPath,xmlSchema);
146 end;
147 /
PL/SQL procedure successfully completed.
SQL> begin
2 dbms_xmlschema.registerSchema
3 (
4 :schemaURL,
5 xdbURIType(:schemaPath).getClob(),
6 FALSE,TRUE,FALSE,FALSE
7 );
8 end;
9 /
PL/SQL procedure successfully completed.
SQL> connect local/local
Connected.
SQL> --
SQL> var schemaURL varchar2(256)
SQL> var schemaPath varchar2(256)
SQL> --
SQL> begin
2 :schemaURL := 'po.xsd';
3 :schemaPath := '/public/po.xsd';
4 end;
5 /
PL/SQL procedure successfully completed.
SQL> declare
2 res boolean;
3 xmlSchema xmlType := xmlType(
4 '<xs:schema xmlns="http://xmlns.oralce.com/demo/xdb/purchaseOrder" targetNamespace="http://xmlns.oralce.com/demo/xdb/purchaseOrder" xm
lns:types="http://xmlns.oralce.com/demo/xdb/purchaseOrderTypes" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.c
om/xdb" version="1.0" xdb:storeVarrayAsTable="true">
5 <xs:import namespace="http://xmlns.oralce.com/demo/xdb/purchaseOrderTypes" schemaLocation="poTypes.xsd"/>
6 <xs:element name="PurchaseOrder" type="PurchaseOrderType" xdb:defaultTable="PURCHASEORDER"/>
7 <xs:complexType name="PurchaseOrderType" xdb:SQLType="PURCHASEORDER_T">
8 <xs:sequence>
9 <xs:element name="Reference" type="types:ReferenceType" xdb:SQLName="REFERENCE"/>
10 <xs:element name="Actions" type="types:ActionsType" xdb:SQLName="ACTIONS"/>
11 <xs:element name="Reject" type="types:RejectionType" minOccurs="0" xdb:SQLName="REJECTION"/>
12 <xs:element name="Requestor" type="types:RequestorType" xdb:SQLName="REQUESTOR"/>
13 <xs:element name="User" type="types:UserType" xdb:SQLName="USERID"/>
14 <xs:element name="CostCenter" type="types:CostCenterType" xdb:SQLName="COST_CENTER"/>
15 <xs:element name="ShippingInstructions" type="types:ShippingInstructionsType" xdb:SQLName="SHIPPING_INSTRUCTIONS"/>
16 <xs:element name="SpecialInstructions" type="types:SpecialInstructionsType" xdb:SQLName="SPECIAL_INSTRUCTIONS"/>
17 <xs:element name="LineItems" type="types:LineItemsType" xdb:SQLName="LINEITEMS"/>
18 </xs:sequence>
19 </xs:complexType>
20 </xs:schema>');
21 begin
22 if (dbms_xdb.existsResource(:schemaPath)) then
23 dbms_xdb.deleteResource(:schemaPath);
24 end if;
25 res := dbms_xdb.createResource(:schemaPath,xmlSchema);
26 end;
27 /
PL/SQL procedure successfully completed.
SQL> begin
2 dbms_xmlschema.registerSchema
3 (
4 :schemaURL,
5 xdbURIType(:schemaPath).getClob(),
6 TRUE,TRUE,FALSE,TRUE
7 );
8 end;
9 /
PL/SQL procedure successfully completed.
SQL> desc PURCHASEORDER
Name Null? Type
TABLE of SYS.XMLTYPE(XMLSchema "po.xsd" Element "PurchaseOrder") STORAGE Object-relational TYPE "PURCHASEORDER_T"
SQL> desc PURCHASEORDER_T
PURCHASEORDER_T is NOT FINAL
Name Null? Type
SYS_XDBPD$ XDB.XDB$RAW_LIST_T
REFERENCE VARCHAR2(30 CHAR)
ACTIONS GLOBAL.ACTIONS_T
REJECTION GLOBAL.REJECTION_T
REQUESTOR VARCHAR2(128 CHAR)
USERID VARCHAR2(10 CHAR)
COST_CENTER VARCHAR2(4 CHAR)
SHIPPING_INSTRUCTIONS GLOBAL.SHIPPING_INSTRUCTIONS
_T
SPECIAL_INSTRUCTIONS VARCHAR2(2048 CHAR)
LINEITEMS GLOBAL.LINEITEMS_T
SQL>I'm not sure what you were trying here in your xml schema
xdb:columnProps="NOT SUBSTITUTABLE">
or whether or not this annotation is the source of the problem -
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.87I 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 -
ORA-01722: invalid number when performing query
Hi,
I am running SQL Developer on a laptop (XP Pro) accessing Oracle Applications
Product Version 11.5.10.2
Platform IBM SP AIX
OS Version AIX
Database 9.2.0.7.0
Support ID 14460365
If I run the following query it works fine -
select
mtrh.request_number
,to_number(mtrh.request_number)
from
mtl_txn_request_headers mtrh
where
to_number(mtrh.request_number) = 135060
and mtrh.request_number = '135060' -- works with this line in!!!!
however if I comment out the last line I get
An error was encountered performing the requested operation :
ORA-01722: invalid number
The field request_number is defined as varchar2(30)
It seems that there is something strange about the way it handles to_number in where clauses.
Thanks
Mick SulleyYou have an invalid number in request_number. If you add "and mtrh.request_number = '135060' ", the result set will be reduced to only those rows which have 135060 in the column and the to_number() will work. WIthout that row, it does to_number(request_number) for all rows in order to identify the one you want. When it comes across a request_number column which contains an invalid number it reports an error.
<preach>
If request_number is a number then it should be stored in a number column. If it isn't, don't try an convert it to a number.
</preach> -
Hi guys
We are having a problem with the migration to WLCS 3.2 SP2 / WLS 5.1 SP10.
We are moving from WLCS 3.2 and WLS SP6. Our CMP beans generate errors when
the container tries to update them. They deploy without error though.
See below for the stack trace
We use the recommended weblogic driver for our Oracle 8.1.7.0 database. WL
runs on w2k, and Oracle on Solaris 7.
Extract from set-environment:
SET DB_CLASSPATH=
SET PATH=%PATH%;%WEBLOGIC_HOME%\bin\oci815_8;%WLCS_ORACLE_HOME%\bin
SET
SQLPATH=C:\WebLogicCommerceServer3.2\db\oracle816;C:\WebLogicCommerceServer3
.2\db\oracle816\event;
Extract from weblogic.properties:
weblogic.jdbc.connectionPool.commercePool=\
url=jdbc:weblogic:oracle,\
driver=weblogic.jdbc.oci.Driver,\
I made a few experiments, and I noticed that generating the CMP classes
(with EJBC) with the old WebLogic_RDBMS.jar (from WLS SP6) is working fine.
Here is what I mean : ejbc uses the library
c:\weblogic\lib\persistence\WebLogic_RDBMS.jar And this library has changed
with SP10. However since that change and after rebuilding our jars, all CMP
entity beans fail to update.
If I just replace that WebLogic_RDBMS.jar with the previous one (from SP6),
and without changing anything else, our CMP beans work fine. I did not
change any driver or xml deployment descriptor.
One of the generated files in the jar (for our bean
VisibilityPSWebLogic_CMP_RDBMS.class) differs, and that seems to be the
cause of the problem.
I jadded that class and here is a difference I notice:
OLD, ejbc ran with SP6 WebLogic_RDBMS.jar : visibilitybean.targetCompanyId =
(BigDecimal)resultset.getObject(5);
NEW, ejbc ran with SP10 WebLogic_RDBMS.jar : visibilitybean.targetCompanyId
= resultset.getBigDecimal(5, 35);
Similar differences for the SETbigdecimal.
Dunno if that will help, but I'm attaching the 2 jar files with explicit
names.
Damn that was long, I hope someone will read it... Thanks for any help on
this, see stack trace attached below
Nicolas Lejeune
Stack trace:
mer. oct. 03 12:16:22 CEST 2001:<I> <EJB JAR deployment
C:/WebLogicCommerceServer3.2/lib/foundation.jar> Exception in
non-transactional EJB invoke:
java.rmi.UnexpectedException: Unexpected exception in
com.b2boost.visibility.VisibilityBean.getVisibilityId():
java.sql.SQLException: ORA-01722: invalid number
at weblogic.db.oci.OciCursor.getCDAException(OciCursor.java:230)
at weblogic.jdbcbase.oci.Statement.executeUpdate(Statement.java:980)
at
weblogic.jdbc20.pool.PreparedStatement.executeUpdate(PreparedStatement.java:
47)
at
com.b2boost.visibility.VisibilityPSWebLogic_CMP_RDBMS.update(VisibilityPSWeb
Logic_CMP_RDBMS.java:446)
at
com.b2boost.visibility.VisibilityPSWebLogic_CMP_RDBMS.store(VisibilityPSWebL
ogic_CMP_RDBMS.java:376)
at
weblogic.ejb.internal.EntityEJBContext.store(EntityEJBContext.java:192)
at
weblogic.ejb.internal.EntityEJBContext.beforeCompletion(EntityEJBContext.jav
a:227)
at
weblogic.ejb.internal.StatefulEJBObject.postInvokeNoTx(StatefulEJBObject.jav
a:355)
at
weblogic.ejb.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:865)
at
com.b2boost.visibility.VisibilityBeanEOImpl.getVisibilityId(VisibilityBeanEO
Impl.java:198)
at
com.b2boost.visibility.pipeline.LoadFirstVisibilityRequestPC.process(LoadFir
stVisibilityRequestPC.java:83)
at
com.beasys.commerce.foundation.pipeline.PipelineExecutorImpl.process(Pipelin
eExecutorImpl.java:193)
at
com.beasys.commerce.foundation.pipeline.PipelineExecutorImplEOImpl.process(P
ipelineExecutorImplEOImpl.java:56)
at
com.beasys.commerce.foundation.pipeline.PipelineExecutorImplEOImpl_ServiceSt
ub.process(PipelineExecutorImplEOImpl_ServiceStub.java:154)
at
com.beasys.commerce.webflow.PipelineProcessor.callPipeline(PipelineProcessor
.java:170)
at
com.beasys.commerce.webflow.PipelineProcessor.process(PipelineProcessor.java
:102)
at
com.beasys.commerce.webflow.WebflowAdvisor.handleTarget(WebflowAdvisor.java:
409)
at
com.beasys.commerce.webflow.WebflowAdvisor.processTarget(WebflowAdvisor.java
:156)
at
com.b2boost.framework.B2boostPortalDestinationDeterminer.determineDestinatio
n(B2boostPortalDestinationDeterminer.java:208)
at
com.beasys.commerce.foundation.flow.FlowManager.service(FlowManager.java:438
at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:120)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
l.java:922)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
l.java:886)
at
weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
Manager.java:269)
at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:392)
at
weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:274)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
[Visibility_generated_with_SP6_weblogic_rdbms_jar.jar]
[Visibility_generated_with_SP10_weblogic_rdbms_jar.jar]You are using WebLogic jDriver for Oracle which needs exact version of OCI API, that comes with the Oracle client installation. Ensure that you have installed the right Oracle client version. And updated the PATH properly.
I notice that you have
bin/oci815_8
oracle816
Thsi looks liek the inconsistency in your environment.
What you need to do is
1. find oci817_8 and place that in the PATH.
2. install oracle 817 and use that client and set the ORACLE_HOME environment variable and the PATH properly.
Try this and see if it helps.
BTW - WLS 5.1 is EOL -
ORA-01722: Invalid number when implementing the Ruby article sample
Hi all,
When I implemented the Ruby on Rails article posted in http://www.oracle.com/technology/pub/articles/haefel-oracle-ruby.html, I found the following problem:
Everything was fine until I decided to test my application. When my web app tried to access some record of the table, the following error happened:
OCIError: ORA-01722: invalid number: select * from (select raw_sql_.*, rownum raw_rnum_ from (SELECT * FROM comics WHERE (comics.id = '2.0') ) raw_sql_ where rownum <= 1) where raw_rnum_ > 0
F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract_adapter.rb:120:in `log'
F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/oracle_adapter.rb:277:in `execute'
F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/oracle_adapter.rb:477:in `select'
F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/oracle_adapter.rb:268:in `select_all'
F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:390:in `find_by_sql'
F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:924:in `find_every'
F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:918:in `find_initial'
F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:952:in `find_one'
F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:941:in `find_from_ids'
F:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:382:in `find'
#{RAILS_ROOT}/app/controllers/comics_controller.rb:16:in `show'
The problem was related with the way RoR is accessing my table. I don't know the reason, but RoR is automatically building the SELECT sentence declaring my 'id' column as VARCHAR, so the sentence includes the expression " comics.id = '2.0' ".
I would like to hear the advice from more experienced RoR developers in order to solve this little issue... (I believe this is more a RoR problem than an Oracle one, but I didn't find anything useful in Rail forums).
Thank you very much in advance for your help.
GregorioAre you saying that if you do not modify the WHERE condition and run the SELECT as-is (as in your original post) in SQL*Plus, you get the same error?
Can you post a test case? I'm not getting any error in example below.
SQL> create table comics (id number) ;
Table created.
SQL> insert into comics values ('2.0') ;
1 row created.
SQL> insert into comics values ('2') ;
1 row created.
SQL> insert into comics values (2.0) ;
1 row created.
SQL> insert into comics values (2) ;
1 row created.
SQL> commit ;
Commit complete.
SQL> select * from comics WHERE (comics.id = '2.0') ;
ID
2
2
2
2
4 rows selected.
SQL> drop table comics ;
Table dropped.
SQL> create table comics (id varchar2(10)) ;
Table created.
SQL> insert into comics values ('2.0') ;
1 row created.
SQL> insert into comics values ('2') ;
1 row created.
SQL> insert into comics values (2.0) ;
1 row created.
SQL> insert into comics values (2) ;
1 row created.
SQL> select * from comics WHERE (comics.id = '2.0') ;
ID
2.0
1 row selected.
SQL>Message was edited by:
Kamal Kishore -
ORA-01410: invalid ROWID, when procedure is executed
Hi,
I am using Oracle 10g 10.2.0.3 on linux 64 bit
I am getting following error
ORA-12012: error on auto execute of job 17069
ORA-01410: invalid ROWID
ORA-06512: at "t1.DR1", line 12
ORA-06512: at line 1
t1 is the schema and DR1 is the procedure run every hour
Error in Alert log showing thirce time.
Following is the content of procedure
create or replace procedure t1.dr1
is
CURSOR CS1
IS
select * FROM t1.V_TL_DR1;
begin
FOR CURRENT_RECORD IN CS1
LOOP
begin
insert into t1.tr_dr1
values
(t1.tr_dr1_seq.nextval,CURRENT_RECORD.uuid,default,'ANY',DEFAULT,NULL,NULL,NULL,null);
if CURRENT_RECORD.dv_code in('SD1','SD2') then
INSERT INTO t1.dr1_writer
values
(t1.dr1_writer_feed_seq.nextval,CURRENT_RECORD.uuid,'OP1',DEFAULT,NULL,DEFAULT,NULL,null,DEFAULT,NULL);
else
INSERT INTO t1.dr1_writer
values
(t1.dr1_writer_feed_seq.nextval,CURRENT_RECORD.uuid,'OP2',DEFAULT,NULL,DEFAULT,NULL,null,DEFAULT,NULL);
end if;
exception
WHEN DUP_VAL_ON_INDEX then
dbms_output.put_line('IT IS NOT ALLOWED TO DUPLICATE');
end;
END LOOP;
end;
t1.V_TL_DR1 IS a view which has two columns uuid and dv_code
Could any one tell me that, is it something to do with above procedureCREATE OR REPLACE VIEW t1.V_TL_DR1 AS
select distinct ap.uuid uuid,ap.adv_code adv_code
from
(select alj.app_uid app_uid,alj.stages_uid stages_uid
,max(rate_AB) RATE_AB
,max(rate_Ac) RATE_AC
,max(rate_AD) RATE_AD
,MAX(CREATED) CREATED
from t1.aof alj, (select max(uuid) uuid,max(in_name) in_name from t1.stages where stage=50 group by app_uid) st2
where alj.stages_uid=st2.uuid
group by alj.app_uid,alj.stages_uid) alj
,t1.app ap
,t1.app_user appu
,(select * from t1.app_applicant where joint='P') applicants
WHERE
alj.app_uid=ap.uuid
and ap.user_uid=appu.uuid
and ap.uuid=applicants.app_uid(+)
and alj.created between systimestamp-(30/1440) and systimestamp-(10/1440)
and ap.app_status='N'
and
(RATE_AB is not null and RATE_AB<>0)
OR (RATE_AC not null and RATE_AC<>0)
OR (RATE_AD is not null and RATE_AD<>0 and applicants.residential_status not in('T','U'))
and appu.role='WEB'
and ap.created between systimestamp-90 and systimestamp
and ap.adv_code not in('UP1','UP2','UP3','UP4')Edited by: user605066 on 21-Feb-2011 02:32
Edited by: user605066 on 21-Feb-2011 02:35 -
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.
SriniHi,
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 -
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)
Maybe you are looking for
-
Question about Intel iMac's and Airport
I'm going to be purchasing an Intel iMac within the next few months and I just want to make sure I have my facts straight about the Airport issues. Is it true that the Airport issues only occur if you're using an Airport base station (do they not occ
-
Hi All, My client has business requirement that they prices job on flat rate basis instead of per piece. If order qty is 1000 no's and delivery qty is 900 and in billibg they require price should appear for 1000 no's instead of 900 no's. your valuabl
-
My ipad emails are being received as blank
Several people have told me that they are receiving blank emails from me. I am sending my emails using my ipad2. If I email them from my pc desktop, they receive them. Any clues? Thanks.
-
Using LR 2.7. Can't import raw files from my brother's memory card (Nikon D7100 I believe). Have downloaded DNG converter, and am fairly sure I have done everything correctly except I get this message: "The source folder does not contain any supporte
-
Need to add a new mail account but option is greyed out
Hi, I need to add a new mail account (I already have 2 setup), but when I go to Settings > Mail, Contacts, Calendars, the "Add Account" field is not available for me to click on.