SQL error: ORA-31038: invalid number '420,05' when extracting data from XML
Hello everyone ,
J’ai créé dieting
DBMS_XMLSCHEMA. REGISTERSCHEMA (SCHEMAURL = > 'OrdenDetalle.xsd', SCHEMADOC = > ' <? xml version = "1.0" encoding = "UTF?) 8 "? >
" < xs: schema xmlns: XS =" http://www.w3.org/2001/XMLSchema ">
< xs: element name = "Monsigniore" >
< xs: complexType >
< xs: SEQUENCE >
< xs: element name = "Quantity" type = "Integer" / >
< xs: element name = "FechaCreacion" type = "xs: DateTime" / >
< xs: element name = "Version" type = "xs: String" / >
< xs: ELEMENT ref = "News" / >
< / xs: SEQUENCE >
< / xs: complexType >
< / xs: element >
< xs: element name = "News" >
< xs: complexType >
< xs: Choice >
< xs: element name = "OrdenCompra" type = "T_OrdenCompra" / >
< / xs: Choice >
< / xs: complexType >
< / xs: element >
< name XS: complexType = "T_OrdenCompra" >
< xs: SEQUENCE >
< xs: element name = "Code" type = "xs: String" / >
< xs: element name = "Number" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "CodigoEstado" type = "Integer" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "CodigoLicitacion" type = "xs: String" nillable = "true" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Description" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "CodigoTipo" type = "Integer" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Type" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "TipoMoneda" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "State" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "CodigoEstadoProveedor" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "EstadoProveedor" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: ELEMENT ref = "Fechas" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "TieneItems" type = "Integer" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "PromedioCalificacion" type = "xs: Decimal" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "CantidadEvaluacion" type = "xs: Decimal" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Well" type = "xs: Decimal" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Freighters" type = "xs: Decimal" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "TotalNeto" type = "xs: Decimal" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "PorcentajeIva" type = "xs: Decimal" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Impuestos" type = "xs: Decimal" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Total" type = "xs: Decimal" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Financing" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Country" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "TipoDespacho" type = "Integer" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "FormaPago" type = "Integer" minOccurs = "0" maxOccurs = "1" / >
< xs: ELEMENT ref = "Comprador" minOccurs = "0" maxOccurs = "1" / >
< xs: ELEMENT ref = "Proveedor" minOccurs = "0" maxOccurs = "1" / >
< xs: ELEMENT ref = "Items" minOccurs = "0" maxOccurs = "1" / >
< / xs: SEQUENCE >
< / xs: complexType >
< xs: element name = "Items" >
< xs: complexType >
< xs: SEQUENCE >
< xs: element name = "Quantity" type = "Integer" / >
< xs: element name = "News" >
< xs: complexType >
< xs: SEQUENCE >
< xs: ELEMENT ref = "Item" minOccurs = "0" maxOccurs = "unbounded" / >
< / xs: SEQUENCE >
< / xs: complexType >
< / xs: element >
< / xs: SEQUENCE >
< / xs: complexType >
< / xs: element >
< name XS: complexType = "OrdenCompraBusqueda" >
< xs:complexContent >
< xs:extension base = "T_OrdenCompra" >
< / xs:extension >
< / xs:complexContent >
< / xs: complexType >
< xs: element name = "Item" >
< xs: complexType >
< xs: SEQUENCE >
< xs: element name = "Correlativo" type = "Integer" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "CodigoCategoria" type = "Integer" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Category" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "CodigoProducto" type = "Integer" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Product" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "EspecificacionComprador" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "EspecificacionProveedor" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Quantity" type = "xs: Decimal" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Moneda" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
"< xs: element name ="PrecioNeto"type ="XS: Decimal"minOccurs ="0"maxOccurs ="1"/ >
< xs: element name = "TotalCargos" type = "xs: Decimal" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "TotalDescuentos" type = "xs: Decimal" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "TotalImpuestos" type = "xs: Decimal" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Total" type = "xs: Decimal" minOccurs = "0" maxOccurs = "1" / >
< / xs: SEQUENCE >
< / xs: complexType >
< / xs: element >
< xs: element name = "Fechas" >
< xs: complexType >
< xs: SEQUENCE >
< xs: element name = "FechaCreacion" type = "xs: DateTime" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "FechaEnvio" type = xs: DateTime "" nillable = "true" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "FechaAceptacion" type = xs: DateTime "" nillable = "true" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "FechaCancelacion" type = xs: DateTime "" nillable = "true" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "FechaUltimaModificacion" type = xs: DateTime "" nillable = "true" minOccurs = "0" maxOccurs = "1" / >
< / xs: SEQUENCE >
< / xs: complexType >
< / xs: element >
< xs: element name = "Comprador" >
< xs: complexType >
< xs: SEQUENCE >
< xs: element name = "CodigoOrganismo" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "NombreOrganismo" type = "xs: String" nillable = "true" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "RutUnidad" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "CodigoUnidad" type = "Integer" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "NombreUnidad" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Activity" type = "xs: String" nillable = "true" / >
< xs: element name = "DireccionUnidad" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "ComunaUnidad" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "RegionUnidad" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Country" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "NombreContacto" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "CargoContacto" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "FonoContacto" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "MailContacto" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< / xs: SEQUENCE >
< / xs: complexType >
< / xs: element >
< xs: element name = "Proveedor" >
< xs: complexType >
< xs: SEQUENCE >
< xs: element name = "Code" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Number" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Activity" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "CodigoSucursal" type = "Integer" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "NombreSucursal" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "RutSucursal" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Address" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Comuna" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Region" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "Country" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "NombreContacto" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "CargoContacto" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "FonoContacto" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< xs: element name = "MailContacto" type = "xs: String" minOccurs = "0" maxOccurs = "1" / >
< / xs: SEQUENCE >
< / xs: complexType >
< / xs: element >
< / xs: Schema >
', LOCAL = > true, GENTYPES = > false, GENBEAN = > false, GENTABLES = > false,
FORCE = > false, OPTIONS = > DBMS_XMLSCHEMA. REGISTER_BINARYXML, OWNER = > USER);
I have a table with one xml domain.
CREATE TABLE XML_Orden_Detalle (Fecha_GET date default current_date not null,
Fecha_Ordenes number not null,
Correlativo_Ordenes number not null,
Codigo_Orden varchar2 (20) not not null primary key,
Cant_Item,
Date of InicioProceso,
Date of FinProceso,
Xmltype Orden_Detalle not null)
Orden_Detalle XMLTYPE COLUMN
STORE AS BINARY XML
XMLSCHEMA " " http://xmlns.Oracle.com/xdb/schemas/CCS_XML/OrdenDetalle.xsd "" "
ELEMENT "command";
I inserted data like that, without any Errors:
" < Command containing = ' http://www.w3.org/2001/XMLSchema "" xmlns: xsi = " " http://www.w3.org/2001/XMLSchema-instance ">
< Number > 1 < / quantity >
< FechaCreacion > 2015-05-28T 12: 10:26.947000 < / FechaCreacion >
v1 < version > < / Version >
< Return >
< OrdenCompra xsi: type = "OrdenCompraBusqueda" >
3879-2661-SE14 < code > < / code >
< Number > PSP DAEM 2014. COFFEE BREAK PARA FRINGE OP21838 < / number >
< CodigoEstado > 6 < / CodigoEstado >
3902 5-on 14 < CodigoLicitacion > < / CodigoLicitacion >
< Description > PSP DAEM 2014. COFFEE BREAK PARA FRINGE OP21838 < / description >
< CodigoTipo > 8 < / CodigoTipo >
< Type > SE < / Type >
< TipoMoneda > CLP < / TipoMoneda >
Is < State > < / Estado >
< CodigoEstadoProveedor > 4 < / CodigoEstadoProveedor >
Is < EstadoProveedor > < / EstadoProveedor >
< Fechas >
< FechaCreacion > 2014-12-29T 17: 43:32.287000 < / FechaCreacion >
< FechaEnvio > 2014-12-31T 10: 32:35.480000 < / FechaEnvio >
< FechaAceptacion > 2015 - 01-01 T 21: 03:03.660000 < / FechaAceptacion >
< FechaCancelacion xsi: Nil = "true" / >
< FechaUltimaModificacion > 2014-12-29T 17: 51:00.000000 < / FechaUltimaModificacion >
< / Fechas >
< TieneItems > 1 < / TieneItems >
< PromedioCalificacion > 5 < / PromedioCalificacion >
< CantidadEvaluacion > 1 < / CantidadEvaluacion >
< Well > 0 < / well >
cargo <>0 < / cargo >
< TotalNeto > 53782 < / TotalNeto >
< PorcentajeIva > 19 < / PorcentajeIva >
< Impuestos > 10218 < / Impuestos >
< total > 64000 < / Total >
< Financing > 1140569 < / financing >
< Country > CL < / Pais >
< TipoDespacho > 12 < / TipoDespacho >
< FormaPago > 2 < / FormaPago >
< comprador >
< CodigoOrganismo > 118069 < / CodigoOrganismo >
< NombreOrganismo > Ilustre municipalidad of Bulnes < / NombreOrganismo >
< RutUnidad > 69.141.200 - 8 < / RutUnidad >
< CodigoUnidad > 4799 < / CodigoUnidad >
Daem < NombreUnidad > < / NombreUnidad >
< Actividad / >
< DireccionUnidad > VICTOR BIANCHI Nº415 < / DireccionUnidad >
Bulnes < ComunaUnidad > < / ComunaUnidad >
< RegionUnidad > Region del Biobio < / RegionUnidad >
< Country > CL < / Pais >
Antonella Brunetti < NombreContacto > < / NombreContacto >
Adquisiciones < CargoContacto > < / CargoContacto >
< FonoContacto > 56-42-2204053-2204054 < / FonoContacto >
< MailContacto > [email protected] < / MailContacto >
< / comprador >
< Proveedor >
< Code > 275020 < / code >
Luis < number > < / number >
< Activity > MANUFACTURING OF PAN, BLOCK PANADERIA Y PRODUCTOS < / activity >
< CodigoSucursal > 280820 < / CodigoSucursal >
Luis < NombreSucursal > < / NombreSucursal >
< RutSucursal > 5.940.940 - 9 < / RutSucursal >
< Address > Carlos Palacios 125 < / address >
Bulnes < Comuna > < / Comuna >
Region del Biobio < region > < / region >
< Country > CL < / Pais >
< NombreContacto > Luis Leonardo Valdés Landero < / NombreContacto >
Gerente < CargoContacto > < / CargoContacto >
< FonoContacto > (56) (42) 631498 < /FonoContacto >
< MailContacto > [email protected] < / MailContacto >
< / Proveedor >
elements <>
< Quantity > 7 < / quantity >
< Return >
< item >
< Correlativo > 1 < / Correlativo >
< CodigoCategoria > 30222700 < / CodigoCategoria >
< Category > items para estructuras, obras y construcciones / permanent Construcciones / industriales Construcciones < / categories >
< CodigoProducto > 30222703 < / CodigoProducto >
< product > ALMACEN Mercancias < / product >
< EspecificacionComprador > 3 LITROS BEBIDAS < / EspecificacionComprador >
< EspecificacionProveedor / >
< Number > 10 < / quantity >
< Moneda > CLP < / Moneda >
< PrecioNeto > 1550 < / PrecioNeto >
< TotalCargos > 0 < / TotalCargos >
< TotalDescuentos > 0 < / TotalDescuentos >
< TotalImpuestos > 0 < / TotalImpuestos >
< total > 15500 < / Total >
< / point >
< item >
< Correlativo > 2 < / Correlativo >
< CodigoCategoria > 30222700 < / CodigoCategoria >
< Category > items para estructuras, obras y construcciones / permanent Construcciones / industriales Construcciones < / categories >
< CodigoProducto > 30222703 < / CodigoProducto >
< product > ALMACEN Mercancias < / product >
< EspecificacionComprador > DEEMED OF 1 1/2 LITYROS < / EspecificacionComprador >
< EspecificacionProveedor / >
< Number > 10 < / quantity >
< Moneda > CLP < / Moneda >
< PrecioNeto > 1150 < / PrecioNeto >
< TotalCargos > 0 < / TotalCargos >
< TotalDescuentos > 0 < / TotalDescuentos >
< TotalImpuestos > 0 < / TotalImpuestos >
< total > 11500 < / Total >
< / point >
< item >
< Correlativo > 3 < / Correlativo >
< CodigoCategoria > 30222700 < / CodigoCategoria >
< Category > items para estructuras, obras y construcciones / permanent Construcciones / industriales Construcciones < / categories >
< CodigoProducto > 30222703 < / CodigoProducto >
< product > ALMACEN Mercancias < / product >
< EspecificacionComprador > PACKAGES SERVILLETAS < / EspecificacionComprador >
< EspecificacionProveedor / >
< Number > 8 < / quantity >
< Moneda > CLP < / Moneda >
< PrecioNeto > 170 < / PrecioNeto >
< TotalCargos > 0 < / TotalCargos >
< TotalDescuentos > 0 < / TotalDescuentos >
< TotalImpuestos > 0 < / TotalImpuestos >
< total > 1360 < / Total >
< / point >
< item >
< Correlativo > 4 < / Correlativo >
< CodigoCategoria > 30222700 < / CodigoCategoria >
< Category > items para estructuras, obras y construcciones / permanent Construcciones / industriales Construcciones < / categories >
< CodigoProducto > 30222703 < / CodigoProducto >
< product > ALMACEN Mercancias < / product >
< EspecificacionComprador > pounds OF AZÚCAR < / EspecificacionComprador >
< EspecificacionProveedor / >
< Number > 5 < / quantity >
< Moneda > CLP < / Moneda >
< PrecioNeto > 580 < / PrecioNeto >
< TotalCargos > 0 < / TotalCargos >
< TotalDescuentos > 0 < / TotalDescuentos >
< TotalImpuestos > 0 < / TotalImpuestos >
< total > 2900 < / Total >
< / point >
< item >
< Correlativo > 5 < / Correlativo >
< CodigoCategoria > 30222700 < / CodigoCategoria >
< Category > items para estructuras, obras y construcciones / permanent Construcciones / industriales Construcciones < / categories >
< CodigoProducto > 30222703 < / CodigoProducto >
< product > ALMACEN Mercancias < / product >
< EspecificacionComprador > NESCAFE < / EspecificacionComprador >
< EspecificacionProveedor / >
< Number > 2 < / quantity >
< Moneda > CLP < / Moneda >
< PrecioNeto > 3900 < / PrecioNeto >
< TotalCargos > 0 < / TotalCargos >
< TotalDescuentos > 0 < / TotalDescuentos >
< TotalImpuestos > 0 < / TotalImpuestos >
< total > 7800 < / Total >
< / point >
< item >
< Correlativo > 6 < / Correlativo >
< CodigoCategoria > 30222700 < / CodigoCategoria >
< Category > items para estructuras, obras y construcciones / permanent Construcciones / industriales Construcciones < / categories >
< CodigoProducto > 30222703 < / CodigoProducto >
< product > ALMACEN Mercancias < / product >
< EspecificacionComprador > CAJAS OF TE 20 BOWL < / EspecificacionComprador >
< EspecificacionProveedor / >
< Number > 5 < / quantity >
< Moneda > CLP < / Moneda >
< PrecioNeto > 340 < / PrecioNeto >
< TotalCargos > 0 < / TotalCargos >
< TotalDescuentos > 0 < / TotalDescuentos >
< TotalImpuestos > 0 < / TotalImpuestos >
< total > 1700 < / Total >
< / point >
< item >
< Correlativo > 7 < / Correlativo >
< CodigoCategoria > 30222700 < / CodigoCategoria >
< Category > items para estructuras, obras y construcciones / permanent Construcciones / industriales Construcciones < / categories >
< CodigoProducto > 30222703 < / CodigoProducto >
< product > ALMACEN Mercancias < / product >
TRITON GALLETAS < EspecificacionComprador > < / EspecificacionComprador >
< EspecificacionProveedor / >
< Number > 31 < / quantity >
< Moneda > CLP < / Moneda >
< PrecioNeto >420,05< / PrecioNeto >
< TotalCargos > 0 < / TotalCargos >
< TotalDescuentos > 0 < / TotalDescuentos >
< TotalImpuestos > 0 < / TotalImpuestos >
< total > 13021,550000000001 < / Total >
< / point >
< / News >
< / object >
< / OrdenCompra >
< / News >
< / Monsigniore >
However when I extract data, for example:
Select *.
from xmltable (to_char (' / Monsigniore/news/OrdenCompra/Items/News/Item[1] ''))
passage (select Orden_Detalle
of xml_Orden_Detalle
where Fecha_Ordenes = 20150101 and Correlativo_ordenes = 83)
path of columns Correlativo varchar2 (15) 'Correlativo '.
, Path of varchar2 (15) CodigoCategoria 'CodigoCategoria '.
, Path Categoria Varchar2 (100 CHAR) "category.
, Path of varchar2 (15) CodigoProducto 'CodigoProducto '.
, Path of Producto Varchar2 (100 CHAR) 'product '.
, Path of the EspecificacionComprador Varchar2 (100 CHAR) "EspecificacionComprador".
, Path of the EspecificacionProveedor Varchar2 (100 CHAR) "EspecificacionProveedor".
, Amount varchar2 (15) path 'amount '.
, Path of the Moneda Varchar2 (16 CHAR) "Moneda".
, Path of varchar2 (15) PrecioNeto 'PrecioNeto '.
, Path of varchar2 (15) TotalCargos 'TotalCargos '.
, Path of varchar2 (15) TotalDescuentos 'TotalDescuentos '.
, Path of varchar2 (15) TotalImpuestos 'TotalImpuestos '.
, Path of varchar2 (15) total 'Total '.
);
delivery the following error:
Informed of error:
SQL error: ORA-31038: Valor number no valido: "420,05."
«31038 00000 - "value not valid %s: \"%s\»»
* Cause: The text in the XML document does not represent a valid
value given the data type and other constraints in the schema.
* Action: Make sure the value specified in the XML documents is valid
regarding the data type and other constraints in the schema.
Note that extract le agenda [1] but the reported error is à la point [7]
Thank you very much in advance
in Chile, the decimal point are ', 'no'.', the xml data table is OK for us
You do not understand.
Regardless of the locale, numeric values limited by a type of data XS: Decimal must use a point in a correct XML representation, otherwise, the document is not valid by the XSD.
(3) TO_CHAR (...) the code is part of a procedure
Again, do NOT build a dynamic path like that.
Why not just move through the records returned by the query (if you need close at all)?
FOR rec in)
SELECT x.*
From your_table t
XMLTABLE (...) x
)
LOOP
END LOOP;
What is the role of the v_CantItems variable? Paging?
Whence its value?
Tags: Oracle Development
Similar Questions
-
Error: ORA-01722: invalid number
Hello
Can some please tell me what I'm doing wrong when I try to make a difference?
Since the format is the same I use this query
Select b1 - b2 of TMP_1;Error: ORA-01722: invalid number
objective:--create table CREATE TABLE TMP_1 ( B1 VARCHAR2(8 BYTE), B2 VARCHAR2(8 BYTE) ) / --insert INSERT INTO TMP_1 (B1, B2) VALUES ('00:02:54', '00:02:10'); INSERT INTO TMP_1 (B1, B2) VALUES ('00:05:47', '00:03:56'); INSERT INTO TMP_1 (B1, B2) VALUES ('00:12:49', '00:02:37'); INSERT INTO TMP_1 (B1, B2) VALUES ('00:49:33', '00:02:09'); INSERT INTO TMP_1 (B1, B2) VALUES ('00:06:34', '00:02:39'); INSERT INTO TMP_1 (B1, B2) VALUES ('00:02:45', '00:01:41'); INSERT INTO TMP_1 (B1, B2) VALUES ('00:01:22', '00:00:22'); COMMIT;
Need to get the difference in the same format as thecolumns example: 00:02:54
Please provide examples of data, it is very useful. Here's one way:
SQL> select b1, b2, 2 b1 - (to_date(to_char(sysdate, 'dd-mon-yyyy')||' '||b2,'dd-mon-yyyy hh24:mi:ss') - trunc(sysdate)) b3 3 from tmp_1; B1 B2 B3 -------------------- -------- -------------------- 03-dec-2012 20:13:33 00:02:10 03-dec-2012 20:11:23 03-dec-2012 18:24:24 00:03:56 03-dec-2012 18:20:28 03-dec-2012 21:48:33 00:02:37 03-dec-2012 21:45:56 03-dec-2012 15:50:09 00:02:09 03-dec-2012 15:48:00 03-dec-2012 14:06:24 00:02:39 03-dec-2012 14:03:45 03-dec-2012 21:47:15 00:01:41 03-dec-2012 21:45:34
John
-
multi select sql problem - ORA-01722: invalid number
Hello
I have a multi select list and when I select only one item it works perfectly, but if I select several items, it gives an error. The sql statement is as below:
SELECT * VIEW WHERE INSTR (': ' |: P1_ID |': ',' :'||) ID: ': ') > 0
and I get the following error:
ORA-01722: invalid number
Here is some information on the display:
Name of the column
Data Type (NUMBER)
Nullable (No.)Hello
I just try this in my own sandbox application to sand...
Create report area with
SELECT t_id, t_code FROM t_table WHERE INSTR(':'||TO_CHAR(:P1_ID)||':', ':'||TO_CHAR(t_id)||':') > 0
as the source.
Create multiple selection list
SELECT t_code, t_id FROM t_table
as the source.
Create a button with application of GO, subordinate the region report on request = GB.
Now, I run the page, select a value in the list, click on go - region displays with the correct result.
Now I run the page, select several values in the list, click on go - region displays with good results.
What is your scenario? If so, it works for me...
See you soon
Ben
http://www.munkyben.WordPress.com
Don't forget to mark the answers useful or correct ;) -
sdo_util code error ORA-01722: invalid number in Oracle 11 g R2
Dear everyone,
Greetings.
Hello. As mentioned in the title, I encountered a strange problem when I was trying to extrude 2D to 3D objects. The error code says ORA-01722: invalid number. Then, to eliminate the possibility that the code would be bad, I took the code example for the ORACLE document on sdo_util.extrude
http://download.Oracle.com/docs/CD/E11882_01/AppDev.112/e11830/sdo_util.htm#SPATL1230
the same error appeared. However, I tried the same code through the SQLDeveloper under Linux (the 11 g R2 where) to do the same thing in my database in windows server 2008 where 11 g R1 has been installed. Works very well.
Y at - it a particular configuration I need to do or that I did wrong. Any knows, please help. Thank you.
JunHi, -.
Please use without setting for output 11.2.0.1.0 'FALSE':SELECT SDO_UTIL. EXTRUDE)
SDO_GEOMETRY)
2003,
NULL,
NULL,
SDO_ELEM_INFO_ARRAY (1,1003,1),
SDO_ORDINATE_ARRAY (5, 1,8,1,8,6,5,7,5,1));
SDO_NUMBER_ARRAY (0,0,0,0,0),
SDO_NUMBER_ARRAY (5,10,10,5,5),
0.005) twice;In 11.1.0.7 release, you must use the parameter 'FALSE ':
SELECT SDO_UTIL. EXTRUDE)
SDO_GEOMETRY)
2003,
NULL,
NULL,
SDO_ELEM_INFO_ARRAY (1,1003,1),
SDO_ORDINATE_ARRAY (5, 1,8,1,8,6,5,7,5,1));
SDO_NUMBER_ARRAY (0,0,0,0,0),
SDO_NUMBER_ARRAY (5,10,10,5,5),
'FALSE. '
0.005) twice;We have fixed this confusion for future releases so that the two interfaces can be used
and the 'FALSE' parameter is ignored.Best regards
Baris -
Select list LOV (error ORA-01722: invalid number)
Hello
I use this procedure to insert data into a table through a submit after processes.
I kept getting this error during the presentation of the page.CREATE OR REPLACE PROCEDURE PR_INS_TMP_STUDENTS( v_tmp_stu_id_in IN NUMBER ) IS BEGIN INSERT INTO TMP_STUDENTS ( stu_id, stu_name_last, stu_name_first, stu_name_middle, stu_name_suffix, stu_name_prefer_last, stu_name_prefer_first, sch_id ) VALUES ( v_tmp_stu_id_out, V('p50100_stu_name_last'), V('p50100_stu_name_first'), V('p50100_stu_name_middle'), V('p50100_stu_name_suffix'), V('p50100_stu_name_prefer_last'), V('p50100_stu_name_prefer_first'), V('p50100_sch_id') ); END;
I go back to sch_id which is a list of number type selection (3.0). The LOV selection list has the following attributes:ORA-01722: invalid number Error Insert Failed!
Here's the code for the LOV:Display extra value: No Dynamic Translation: No Number of Columns: 1 Display Null: Yes Null Display Value: blank Null Return Value: blank
I don't know why I kept ORA-01722: invalid number during the presentation of the page. Everyone ran through this issue?SELECT distinct(site_id || ' - ' || initcap(lower(site_name))) site_desc, site_id ret_val FROM sa.SITE_DEMOGRAPHICS@sis order by 2
Hello
First of all, you should also use nv ('itemname') for numeric values-, make sure you use v() instead of V() for others.
If the p50100_sch_id can be null, the return value will be "null %" - which could be the cause of the error.
In such cases, I tend to do something like -1 of the value zero, then do a test for that, in the code - if the value is - 1, I replace NULL
Andy
-
SQL error: ORA-00910: specified length too long for its data type
Using Oracle 11.2.0.1 on Oracle Linux 5.8 x 64
I try to install Zabbix http://www.zabbix.com and uses the Oracle database as the data store. The script of the diagram provided below does not work.
When I run it, I getCREATE TABLE maintenances ( maintenanceid number(20) NOT NULL, name nvarchar2(128) DEFAULT '' , maintenance_type number(10) DEFAULT '0' NOT NULL, description nvarchar2(2048) DEFAULT '' , active_since number(10) DEFAULT '0' NOT NULL, active_till number(10) DEFAULT '0' NOT NULL, PRIMARY KEY (maintenanceid) );
According to the oracle documentation for nvarchar2 limit is 4000. What am I missing here?Error at Command Line:5 Column:42 Error report: SQL Error: ORA-00910: specified length too long for its datatype 00910. 00000 - "specified length too long for its datatype" *Cause: for datatypes CHAR and RAW, the length specified was > 2000; otherwise, the length specified was > 4000. *Action: use a shorter length or switch to a datatype permitting a longer length such as a VARCHAR2, LONG CHAR, or LONG RAW
"4000 bytes is the ultimate maximum." You can say 4000 * characters *, but it will always be limited to 4000 * bytes *. "
http://asktom.Oracle.com/pls/Apex/f?p=100:11:0:P11_QUESTION_ID:1224836384599 #201073000346459201\"The maximum length of the column is determined by the definition of national character set. The width of the character NVARCHAR2 data specifications match the number of characters. The authorized maximum column size is 4000 bytes. »
http://docs.Oracle.com/CD/E11882_01/server.112/e26088/sql_elements001.htm#SQLRF50976Furthermore, you treat numbers as STRINGS, remove the quotes around your zero.
-
ORA-01722: invalid number in SQL Loader
Hi all
CREATE TABLE SAMPL_TABLE
(
ITEM_CATEGORY VARCHAR2 (30 BYTES),
ITEM_NO VARCHAR2 (240 BYTES),
ITEM_DESCRIPTION VARCHAR2 (240 BYTES),
CLIENT_NAME VARCHAR2 (240 BYTES),
CUSTOMER_NO VARCHAR2 (240 BYTES),
VALID_AMOUNT_MONTH1 NUMBER,
VALID_UNITS_MONTH1 NUMBER,
VALID_BUDGET_AMOUNT_MONTH1 NUMBER,
VALID_BUDGET_UNITS_MONTH1 NUMBER,
ATTRIBUTE1 VARCHAR2 (240 BYTES),
ATTRIBUT2 VARCHAR2 (240 BYTES),
NUMBER OF VALID_RATE
);
Control file
Options (Errors = 10000, Skip = 3)
DOWNLOAD THE DATA
INFILE ' / home/appltest/Sheet1.csv'
BADFILE "sample.bad."
DISCARDFILE 'sample.dsc '.
REPLACE
IN THE TABLE sampl_table
fields completed by «,»
surrounded of possibly "" "
trailing nullcols
(
client_name TANK NULLIF client_name = BLANKS "RTRIM(:customer_name)."
customer_no NULLIF CHAR customer_no = BLANKS "RTRIM(:customer_no)."
item_no NULLIF TANK item_no = BLANKS "RTRIM(:item_no)."
valid_amount_month1 "to_number (: valid_amount_month1, '999,999,999.99')."
valid_units_month1 "to_number (substr (: valid_units_month1, instr(:valid_units_month1,'$') + 1), '999,999,999.99')."
valid_budget_units_month1 "to_number (: valid_budget_units_month1, '999,999,999.99')."
valid_budget_amount_month1 "to_number (trim (substr (: valid_budget_amount_month1, instr(:valid_budget_amount_month1,'$') + 1)), '999,999,999.99')."
valid_rate NULLIF CHAR valid_rate = BLANKS 'RTRIM(:valid_rate) '.
)
Sheet1.csv
Name of the cust Cust #. Article no. Item Desc Category Amount – month 1 Units - month 1 Act early Act early Budget - months 1 Budget - unit - months 1 Rate Name of the cust Cust #. Article no. Item Desc Category Amount – month 1 Units - month 1 Act early Act early Budget - months 1 Budget - unit - months 1 Rate Name of the cust Cust #. Article no. Item Desc Category Amount – month 1 Units - month 1 Act early Act early Budget - months 1 Budget - unit - months 1 Rate REYNU 1001 ABC001 ABC Renyu ABC 82 61 1 REYNU1 1028 ABC123 ABCRenyu123 ABC 295 1469 1 REYNU2 1028 ABC344 ABC Renyu 344 ABC 2270 6335 1 Get error below
Sheet 1: Rejected - error on the table SAMPL_TABLE, column VALID_RATE.
ORA-01722: invalid number
Sheet 2: Rejected - error on the table SAMPL_TABLE, column VALID_RATE.
ORA-01722: invalid number
Sheet 3: Rejected - error on the table SAMPL_TABLE, column VALID_RATE.
ORA-01722: invalid number
Sheet 1: Rejected - error on the table SAMPL_TABLE, column VALID_AMOUNT_MONTH1 .
ORA-01722: invalid number
Sheet 2: Rejected - error on the table SAMPL_TABLE, column VALID_AMOUNT_MONTH1 .
ORA-01722: invalid number
Sheet 3: Rejected - error on the table SAMPL_TABLE column VALID_AMOUNT_MONTH1
ORA-01722: invalid number
Can you help me please?
Oracle Database 11 g Enterprise Edition Release 11.1.0.7.0 - 64 bit Production
Hello
No sign of setting shaped or ' $' is seen in the data, which is the reason why I guess you used the conversions in the * ctl file.
What is the problem with this symbol $ in the code?
No problem with the ' $'-what I mean is that it is not necessary.
Looking for him "$" field and exclude it from your text/number (SUBSTR) and if there is no "$" in your file, this additional training is not mandatory - why clutter up your code with unnecessary functions?
Regarding the error you get, it is related to the format mask, you provide:
Message #20:
Select to_number (substr (146, instr(146,'$') + 1), '999,999,999.99') of double
o/p: 146
Select to_number (substr (1469, instr(1469,'$') + 1), '999,999,999.99') of double
Error: ORA-01722: invalid number
1. you must use "146" (text) and no 146 (number).
2. ' 146' works because it "fits" the format mask you supplied: 999 999,999. 99. " but '1469' does not like the format mask expects one ',' as the delimiter of thousands, that is, "1 469'."
Select to_number (substr (1, 469', instr('1,469','$') + 1), '999,999,999.99') twice;
Similarly, in the #22 Post:
to_number (substr (' 752,3308', instr ('752.3308', ' $') + 1), 999, 999 999,99') of double
4 decimals are consistent with the format DP 2 mask.
Simply remove all masks of format.
-
ORA-01722: invalid number error
Hello Experts,
I'm having a problem downloading a text file.
It works ok for some files but for some files I get the following error
ORA-01722: invalid number
Anyone know what could be the reason of this please. Just tell me what you need more details.
Thank you
KevinHello
OK now the image grows.
So, you dynamically create the insert statement, replace the comma with nothing and then insert.
The system from which you found the data file is this number of column type sales NET in this system or even stores characters.
Assuming that the data type is a generic system remote here is the scenarios where it will failselect to_number(replace('23 ,380.00 ',',','') ) from dual -- not ok observe before comma select to_number(replace('a23,380.00 ',',','') ) from dual -- not ok select to_number(replace('23,380. 00 ',',','') ) from dual -- not ok observe space after decinal
My Suggestion,
take the file upload in a temporary table using sqlldr.
Next moment, you have the incorrect records.
Keep an eye on them.
In addition, the use of external tables is an option where you can log records failed.Kind regards
Bobin -
Strange ORA-01722: invalid number on viewCriteria
Hello
I defined in jDev 11.1.1.5 do with viewCriteria and everything works until I have migrate jDev 11.1.1.6. Now, I get this exception run this view
< Utils > < buildFacesMessage > ADF: addition of the JSF error message: ORA-01722: invalid number
java.sql.SQLSyntaxErrorException: ORA-01722: invalid number
After a few experiences, I found that this problem is viewCriteria, which is not so simple. It is used with condition NOT IN subquery.
(P_P_ID_FK NOT IN (SELECT P_ID of P where NVL (VALID_FROM, CURRENT_DATE) < = CURRENT_DATE))
I know that DOESN'T look good is not standard in ADF viewCriteria, but SQL work well. So tell me why there at - it SQLSyntaxErrorException!
When I remove that part or AppModule viewCriteria viewCriteria, then everything works.
Exception disappear even when I move the condition NOT IN with the main request viewCriteria subquery.
I tried to rewrite viewCriteria using NOT EXISTS, but there is no possibility of query from same table due to the inability of aliasing table names.
You have a work around?
Thank you.
Problem is resolved declaratively by manual editing of XML view this tutorial Andrejus Baranovskis Blog: implementation of criteria seen in Colombia - British ADF
-
ORA-01722: invalid number
I get the error: ORA-01722: invalid number during the execution of the SQL statement.
SELECT
TO_NUMBER (TO_CHAR ((TRUNC(:P_DATE1,'MM')-1), "MM")) LAST_MON
OF THE DOUBLE
Sanjay
I'll guess that you write an APEX application.
In the APEX, the variables are always strings. If you want to interpret as dates, you should pack them with a call TO_DATE and a format mask. Assuming that you stated your control APEX of date in MM/DD/YYYY format, it would mean that the SQL, you would need is
SELECT TO_NUMBER(TO_CHAR((TRUNC( TO_DATE(:P_DATE1, 'MM/DD/YYYY'),'MM')-1),'MM')) LAST_MON FROM DUAL
Of course, if you're just trying to extract the month to date and subtract 1, I just have
SELECT extract( month from to_date( :p_date1, 'MM/DD/YYYY') ) - 1 FROM dual
Justin
-
SQL * Loader - rejected records - error on table ORA-01722: invalid number
Get the following errors:
Please tell me where I'm wrong?
The log file and extracts the data file with the control file is attached.
Also guide me please how I can download 4900 files at once?
-------------------------------------
SQL * Loader: release 11.1.0.7.0 - Production on Fri 14 Oct 03:06:06 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Control file: sample.ctl
Data file: Cities.csv
Bad leadership: Cities.bad
Discard File: none is specified
(Allow all releases)
Number of loading: ALL
Number of jump: 0
Authorized errors: 50
Link table: 64 lines, maximum of 256000 bytes
Continuation of the debate: none is specified
Path used: classics
Table CITY, loaded from every logical record.
Insert the option in effect for this table: INSERT
Column Position Len term Encl. Datatype name
------------------------------ ---------- ----- ---- ---- ---------------------
FIRST ID *, CHARACTER
35. ACCORDING TO NAME, ' CHARACTER
COUNTRYCODE 3, ' CHARACTER
THE NEXT POPULATION * CHARACTER WHT
Sheet 1: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 2: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 3: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Folder 4: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 5: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 6: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 7: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 8: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
File 9: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Case 10: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Factsheet 11: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 12: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
File 13: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Fact sheet 14: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Fact sheet 15: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 16: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
File 17: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 18: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
File 19: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 20: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 21: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Account 22: rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 23: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record number of 24: rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 25: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Fact sheet 26: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Fact sheet 27: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 28: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 29: rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 30: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record of 31: rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
• Statement 32: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 33: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Page 34: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 35: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 36: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 37: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 38: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 39: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 40: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 41: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Page 42: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 43: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Sheet 44: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 45: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
• Statement 46: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 47: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 48: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 49: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Page 50: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
Record 51: Rejected - error on the table CITY, POPULATION column.
ORA-01722: invalid number
NUMBER of MAXIMUM ERRORS EXCEEDED - above the statistics reflect partial performance.
CITY table:
0 rows successfully loaded.
51 lines not filled due to data errors.
0 rows not loading because all WHEN clauses were failed.
0 rows not populated because all fields are null.
The space allocated to bind table: 35840 bytes (64 lines)
Bytes of read buffer: 1048576
Total logical records ignored: 0
Total logical records read: 64
Total rejected logical records: 51
Total logical records ignored: 0
Run started on Fri 14 Oct 03:06:06 2011
Run finished Fri Oct 14 03:06:12 2011
Time was: 00:00:06.18
Time processor was: 00:00:00.03
----------------------------------------------------------------------
my control file (sample.ctl):
Load data infile 'Cities.csv '.
in the town of table
fields completed by «,»
(external id integer,
char (35) name box by ' ', '
CountryCode tank (3) box by ' ', '
external population integer terminated by '\n '.
)
my data (Cities.csv) file (it contains 4900 documents, but I show here just 4 records for ease)
3830, "Virginia Beach", "USA", 425257
3831, 'Atlanta', 'USA', 416474
3832, "Sacramento", "USA", 407018
3833, 'Oakland', 'USA', 399484
Thanks in advance!Watch when I have a little change your database as follows
1,'Kabul','AFG',1780000 2,'Qandahar','AFG','237500' 3,'Herat','AFG','186800'
I got the same error (last 2 rows rejected for the same number invalid error)
mhouri > select * from cities; ID NAME COU POPULATION ---------- ----------------------------------- --- ---------- 1 Kabul AFG 1780000 SQL*Loader: Release 10.2.0.3.0 - Production on Fri Oct 14 10:38:06 2011 Copyright (c) 1982, 2005, Oracle. All rights reserved. Control File: cities.ctl Data File: cities.dat Bad File: cities.bad Discard File: none specified (Allow all discards) Number to load: ALL Number to skip: 0 Errors allowed: 50 Bind array: 64 rows, maximum of 256000 bytes Continuation: none specified Path used: Conventional Table CITIES, loaded from every logical record. Insert option in effect for this table: INSERT Column Name Position Len Term Encl Datatype ------------------------------ ---------- ----- ---- ---- --------------------- ID FIRST * , CHARACTER NAME NEXT 35 , ' CHARACTER COUNTRYCODE NEXT 3 , ' CHARACTER POPULATION NEXT * WHT CHARACTER Record 4: Rejected - Error on table CITIES, column ID. Column not found before end of logical record (use TRAILING NULLCOLS) Record 2: Rejected - Error on table CITIES, column POPULATION. ORA-01722: invalid number Record 3: Rejected - Error on table CITIES, column POPULATION. ORA-01722: invalid number Table CITIES: 1 Row successfully loaded. 3 Rows not loaded due to data errors. 0 Rows not loaded because all WHEN clauses were failed. 0 Rows not loaded because all fields were null. Space allocated for bind array: 35840 bytes(64 rows) Read buffer bytes: 1048576 Total logical records skipped: 0 Total logical records read: 4 Total logical records rejected: 3 Total logical records discarded: 0 Run began on Fri Oct 14 10:38:06 2011 Run ended on Fri Oct 14 10:38:06 2011 Elapsed time was: 00:00:00.23 CPU time was: 00:00:00.09
Value of the population within the data file must be a number
Best regards
Mohamed Houri
-
error ora-00036 maximum number of levels of sql recursive (50) exceeded
I have a trigger of the declaration on the LEVELS table, I want to update COMPONENTS field when another field is changed in TIERS, in order to avoid the calculations, I used to ch line shutter COMPONENTS to complete a package, but I get this error ora-00036 maximum number of recursive sql exceeded (50)
It's my trigger:
create or replace trigger DBTRGA_UPD_TIERS
after update on tiers
I INT ;
FOR I IN (PKG_TIERS. TAB. FIRST)... (PKG_TIERS. TAB. Last) LOOP
UPDATE to levels
PUT REFERENCE_EXTERNE = "YYYY"
WHERE LEVELS = PKG_TIERS. TAB (I). I_TIERS;
END LOOP;
end DBTRGA_UPD_TIERS;
This is ma for each trigger line:
create or replace trigger DBTRGA_UPD_TIERS_E
after Update FOR CODE_TYPE_TIERS on LEVELS
for each row
V_CPT INTEGER ;
IF : NEW. CODE_TYPE_TIERS IS NOT NULL THEN
IF PKG_TIERS. TAB. LAST IS NULL THEN
PKG_TIERS. TAB(1). I_TIERS: =: NEW. BLEACHERS;
PKG_TIERS. TAB(1). CODE_TYPE_TIERS: =: NEW. CODE_TYPE_TIERS;
ELSE
V_CPT: = PKG_TIERS. TAB. LAST + 1;
END IF;
END IF;
end DBTRGA_UPD_TIERS_E;
Clearly, you have past of recursion. After updating the table of LEVELS, then a statement trigger level (after update) as the fires that updates the table LEVELS... which will cause then itself to once again fire... which will cause himself to fire once again... which will cause itself to the light again... etc etc.
If it is a business logic that should be implemented, so you don't want to include it as a trigger, you want to just have a code in a package that updates the table once.
If it were me, I would scrap two triggers in this case. Have a trigger is fired for each row updated (in SQL) which has then cross to the PL/SQL package for details of this update line, means you to act so the context switching between SQL and PL/SQL for each update line, which will affect the performance of the updates.
Explain what you're actually trying to do (business logic), with a few examples and data tables and we might be able to propose a better approach, which is not abusing triggers in this way.
-
ORA-01722: invalid number calculation error during the treatment.
My version of the APEX is Application Express 4.2.6.00.03
I imported apex application 4.0.2 and his object of decision-making support in my apex.
Its installed successfully.
But when I try to run this application it show me this error:
ORA-01722: invalid number calculation error during the treatment.
Thank you guys for your help.
I found the solution.
There was a problem in the authentication scheme.
I called function as return function_name in 4.0.2
but in the Apex 4.2.6 to call a function word return is not necessary.
He was throwing the error caused that Word back.
-
Please help: instruction box - ORA-01722: invalid number error
Hi all
I am trying to use the Case statement to recode the status canceled in two groups
"Reject" If the difference between the date of the first and the last date is less than 29 and
'Accept' if the difference between the date of the first and the last date is greater than 30
Here's my data 'test'
STATUS FIRST_DATE LAST_DATE
Transfer / / 10/08/2011-10/09/2011
Mover 10/08/2011-15/09/2011
Cancel the 16/09/2011 10/08/2011
Cancel the 10/08/2011 5/09/2011
Here's the syntax
Select a.*,
(CASE WHEN a.STATUS = 'Cancel' CAN (round(a.LAST_DATE-a.FIRST_DATE))
0 OTHERWISE
END CAN_DAYS),
(BOX WHEN "CAN_DAYS" > 29 THEN "reject"
WHEN "CAN_DAYS" < 30 THEN "accept."
Reject_Accept END)
try one
The first CASE statement works very well and gives me this
STATUS FIRST_DATE LAST_DATE CAN_DAYS
Transfer 0 10/08/2011-10/09/2011
Mover 0 10/08/2011-15/09/2011
Cancel the 37 16/09/2011 10/08/2011
Cancel the 26/10/08/2011 5/09/2011
but the LATTER product ORA-01722: invalid number error. It's something to do with the type of data CAN_DAYS, Oracle does not see in the Numeric form I think.
I want to see result
STATUS FIRST_DATE LAST_DATE CAN_DAYS Reject_Accept
Transfer 0 10/08/2011-10/09/2011
Mover 0 10/08/2011-15/09/2011
Accept to cancel 37 10/08/2011-16/09/2011
Refuse to cancel the 26/10/08/2011 5/09/2011
Could someone please help me fix the syntax?
Thank you in advance,Hello
The error is due to the fact that you are trying to compare "CAN_DAYS", which cannot be regarded as a number, a number.
You can try this option for your results:select A.STATUS, A.FIRST_DATE, A.LAST_DATE,case when a.status ='Cancel' then round(a.last_date - a.first_date) else 0 end as can_days, case when (a.status ='Cancel' and round(a.last_date - a.first_date) > 29) then 'Reject' when (a.status ='Cancel' and round(a.last_date - a.first_date)< 30) then 'Accept' else null end as Accept_Reject from test a
-
To_char ORA-01722: invalid number
Hello
8.1.7 I have the following error:
I tried different workaround but do not work:SELECT TO_CHAR(LAST_REFRESH_DATE,'DD-MON-RR HH:MI AM') FROM DBA_MVIEWS; ORA-01722: invalide number
TO_CHAR (LAST_REFRESH_DATE,' JJ.) MESSRS. ' YYYY:HH24:MI:SS)
TO_CHAR (LAST_REFRESH_DATE,' JJ.) MESSRS. ' YYYY:HH:MI:SS)
Thanks for the help.Dear user522961,
SQL> SELECT TO_CHAR(LAST_REFRESH_DATE,'DD-MON-RR HH:MI AM') FROM DBA_MVIEWS; TO_CHAR(LAST_REFRE ------------------ 06-JUL-10 11:49 AM 21-MAY-10 02:58 PM 01-JUN-10 11:07 AM SQL> desc dba_mviews; Name Null? Type ----------------------------------------- LAST_REFRESH_DATE DATE
Strange... Can you please describe the view of data dba_mviews your dictionary? My example is based off of 10 gr 2.
Ogan
Maybe you are looking for
-
How can I disable the track stick on the keyboard?
There is a button in the center of the keyboard and I continue to hit when I type and lose my place. Makes me crazy!
-
SSD &; DELL POWEREDGE T110
Hello I would like to ask questions about the meaning of installing an SSD in the server Dell Power Edge T110. As I understand it, the server runs on the SATA1 interface. What SSD do you recommend? Concerning mlik1987
-
Have verizon usb720 wireless modem and trying to upgrade to the 6.10.2 version of the old 6.3.7. Verizon says that the codes are not on the end there but a problem with windows does not allow to update. Was able to download the update but not able to
-
Client VPN connects but not internal LAN access or Ping
Hi all. I'm new on this forum and kindly asking for your help because I'm stuck. I have an ADSL router cisco 877 which I configured easy VPN server.Now the Cisco VPN client ver 5.0 to connect successfully to the VPN server, but when you try to access
-
The new update will not install.
The new update will not install. (it is said there is a problem with a file called spill.aex)...I tried to delete after effects to reinstall, but who doesn't either so now I can't the legacy at all.