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.
CREATE 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)
);
When I run it, I get
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
According to the oracle documentation for nvarchar2 limit is 4000. What am I missing here?

"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#SQLRF50976

Furthermore, you treat numbers as STRINGS, remove the quotes around your zero.

Tags: Database

Similar Questions

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

    Please If anyone can Help me with le solution for no report error

    Thank you very much in advance

    Carlos

    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?

  • EXECUTE IMMEDIATE in error &gt; &gt; ORA-00972: identifier is too long

    Hello

    I wrote a code using execute immediate command. This command essentially creates a cursor that selects user_tab_columns table names. These table names are then used inside the statement immediately execute in order to apply the same select statement on the table being selected within the cursor names. The problem is that the above error is thrown saying identifier is too long. I can't understand how to solve this problem.

    Please find the below code:

    Declare
    Cursor C_1 is select distinct table_name
    of user_tab_columns
    where column_name = 'PROGRAM_UPDATE_DATE' AND table_name LIKE '% MISPA '.
    intersect
    Select unique table_name
    of gsi_daily_count;
    table_names varchar2 (100);
    Begin
    C_1 open;
    Loop
    Extract the C_1 in table_names;
    WHEN THE EXIT C_1% NOTFOUND;

    EXECUTE IMMEDIATE "select last_extract_date,
    TO_CHAR (min (largest (nvl (last_update_date, "1 January 10"), nvl (program_update_date, "1 January 10"))), "MON-DD-YY HH24:MI:SS") mi.
    TO_CHAR (max (greatest (nvl (last_update_date, "1 January 10"), nvl (program_update_date, "1 January 10"))), "MON-DD-YY HH24:MI:SS") my
    of ' | table_names |
    "Last_extract_date group".
    order of last_extract_date desc;';

    End loop;
    Close C_1;
    COMMIT;
    End;
    /


    Help, please.

    Kind regards
    Hossam
    declare
      cursor C_1
      is
      select distinct table_name
        from user_tab_columns
       where column_name = 'PROGRAM_UPDATE_DATE'
         and table_name LIKE 'MISPA%'
      intersect
      select unique table_name
        from gsi_daily_count;
    
      table_names varchar2(100);
    begin
      open C_1;
      loop
        fetch C_1 into table_names;
        exit when c_1%notfound;
    
        execute immediate
          'select last_extract_date,
                  to_char(min(greatest(nvl(last_update_date,''01-Jan-10''),nvl(program_update_date,''01-Jan-10''))),''DD-MON-YY HH24:MI:SS'') mi,
                  to_char(max(greatest(nvl(last_update_date,''01-Jan-10''),nvl(program_update_date,''01-Jan-10''))),''DD-MON-YY HH24:MI:SS'') ma
             from'|| table_names ||
          'group by last_extract_date
            order by last_extract_date desc;';
      end Loop;
      close C_1;
      commit;
    End;
    

    Here is the list of question I see in this code.

    1. in the SQL string, you must have a after the keyword and before the GROUP BY keyword.

    2. you should not use ';' in EXECUTE IMMEDIATE. You must remove it.

    3. the result set returned by the EXECUTE IMMEDIATE should be stored in a Variable. You use the INTO LEDGES INTO clause or in BULK to this effect.

  • ORA-00972: identifier is too long

    Hai all,

    SQL > delete / * parallel nologging * / of DWEvent where EVENTTIME < to_date('2012-02-01','YYYY-MM-DD');

    ERROR:
    ORA-00972: identifier is too long

    No idea why?

    You have a double quote at the end of your statement.
    What happens if you change:

    delete /* nologging parallel */ from DWEvent where EVENTTIME < to_date('2012-02-01','YYYY-MM-DD')";
    {code}
    into:
    {code}
    delete /* nologging parallel */ from DWEvent where EVENTTIME < to_date('2012-02-01','YYYY-MM-DD');
    {code}
    ?
    
    And by the way: your 'hint' is not really a hint, but only a comment.
    Hints start with /*+ YOUR_HINT */, you forgot the + sign.
    
    You can search the syntax easily from http://www.oracle.com/pls/db112/homepage                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
    
  • * ORA-00972: identifier is too long * when drop index table app

    Hello

    I had some difficulties with dropApplicationTableIndex. He raised an exception ORA-00972:
    java.sql.SQLException: ORA-00972: identifier is too long

    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
    at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:210)
    at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:961)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1190)
    at oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:1657)
    at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1626)
    at oracle.spatial.rdf.client.jena.Oracle.executeUpdate(Oracle.java:769)
    at oracle.spatial.rdf.client.jena.GraphOracleSem.dropApplicationTableIndex(GraphOracleSem.java:3695)


    However, the longer name of my models is 23 characters, making it the longest name of characters 27A table (+ _TPL).
    Is there a still shorter limit for the length of model name?

    Thank you

    Kind regards
    Julien

    Hi Julien,

    In fact, the limit for a semantic model, created using the Jena adaptor is 19 characters. This is because the application table index uses TRIPLEIDX as a suffix.

    Best,
    Vlad

  • PL/SQL: ORA-00972: identifier is too long.

    Hi all

    I have a question on the Express request form. I have my form fields that must be completed to save information about the database. It works fine until I click on create a button - I get the following error:
    ORA-06550: line 1, column 243: PL/SQL: ORA-00972: identifier is too long ORA-06550: line 1, column 7: PL/SQL: SQL Statement ignored
    
    
    Unable to process row of table FIS_REPAT_WITH_APPLICANT_INFO.
    I checked the length of table name, & he is 28 characters long. What could be the problem with this? Any help is appreciated. Thank you in advance.

    Concerning
    Kamo

    Hi Tom,

    Sorry for the late reply. It turns out that my problem was with date formats: I changed the format of the date of my entire application of MON/DD/YY to YYYY-MM-DD, which worked well. However, on a a date field forms I changed the Capture_Date source to to_char (Capture_Date, 'YYYY-MM-DD') that's why I got the error I got.

    At one point, I got an error message: ORA - 06502:PL / SQL: digital or value error: character string buffer too small
    That's why I started another thread: Re: ORA - 06502:PL / SQL: digital or value error: character string buffer too small

  • SQL error: ORA-01873: the interval leading precision is too small

    Hello

    My requirement is to get the current timestamp in the format microsec Epoch.

    I am trying to execute the following query

    Select (CAST (((current_timestamp-TO_DATE (1er janvier 1970 00:00:00 ', ' 'JJ-MM-AAAA HH24:MI:SS)) * 24 * 60 * 60 * 1000000) AS varchar (32))) as "dt" from dual;))

    I get the following error
    Error from the 1 in the command line:
    Select (CAST (((current_timestamp-TO_DATE (1er janvier 1970 00:00:00 ', ' 'JJ-MM-AAAA HH24:MI:SS)) * 24 * 60 * 60 * 1000000) AS varchar (32))) as double 'dt'))
    Error report:
    SQL error: ORA-01873: the interval leading precision is too small
    01873 00000 - "the interval leading precision is too small."
    * Cause: The precision of the interval leading is too small to store the
    specified interval.
    * Action: Increase the accuracy of foreground of the interval or specify a
    meantime, with smaller leading precision.

    But if I tried to do
    Select (CAST (((sysdate-TO_DATE (1er janvier 1970 00:00:00 ', ' 'JJ-MM-AAAA HH24:MI:SS)) * 24 * 60 * 60 * 1000000) AS varchar (32))) as "dt" from dual;))
    works fine, but I get the bad epochtime sysdate has no time zone information.

    Please help me how to do the first query to work so that I can get the current_timestamp change to gmt and convert it in time.
    Please let me know if there is another way to get the Epochtime.

    Depending on whether you want to or not to include the fraction of a second use:

    with t as (
               select  current_timestamp at time zone 'gmt' - to_timestamp_tz('01/01/1970 00:00:00 GMT','MM-DD-YYYY HH24:MI:SS TZR') interval_diff,
                       cast(current_timestamp at time zone 'gmt' as date) - to_date('01/01/1970 00:00:00', 'MM-DD-YYYY HH24:MI:SS') num_diff
                 from  dual
              )
    select  cast(
                 (
                  (
                   (
                    extract(day from interval_diff) * 24 + extract(hour from interval_diff)
                   ) * 60 + extract(minute from interval_diff)
                  ) * 60 + extract(second from interval_diff)
                 ) * 1000000
                 AS varchar(32)
                ) as "ts",
            cast(num_diff * 24 * 60 * 60 * 1000000 AS varchar(32)) as "dt"
      from t
    / 
    
    ts                   dt
    -------------------- --------------------
    1336237158093000     1336237158000000
    
    SQL>  
    

    SY.

  • Error compiling FPGA-61332: the length of a line to &lt; "file.vhdl" &gt; is too long for xilinx 10.1. Length: &lt; length &gt; Max Length: 4150

    Hello

    When compiling a fairly basic FPGA VI, I get the following error:

    61332 error occurred in niFpgaCompileWorker_ProcessStatusPipe.vi:1<><>

    Possible reasons:

    LabVIEW FPGA: An unexpected error occurred with the build tools. You try to compile the FPGA VI again could solve the problem.

    The length of a line in "NiFpgaAG_0000002e_WhileLoop.vhd" is too long for xilinx 10.1. Length: 32845 Max length: 4150

    Departure time: 17:22:06
    End time: 17:22:12
    Total time: 00:00:06

    Apparently, the vhdl code generator OR forgot to add some CR + LF in the intermediate files. How to work around this bug?

    Kind regards

    Lukas

    Hi Lukas.

    When LabVIEW compiles a VI, the VI is converted into virtual hard disk to be compiled into a file bit by Xilinx.  As you have already understood, this error indicates that a line of code vhd had a length of 32 845 characters, which exceeds the maximum length of 4150 characters for the Xilinx 10.1.

    Although 32 845 characters is very long, it is possible that this is due to the codification of LabVIEW rather than a bug. Some common causes of this problem include large enums, a matrix, or clusters in the code.  Please check in your code.  If you have no luck, please attach a screenshot of the code.  I hope this helps!

    Kind regards

    Dayna P.

    Technical sales engineer

    National Instruments

  • SQL error: ORA-01840: value not long enough for the format of the date of entry

    It is a delete SQL in a driver of demand, which gives no error, but does remove all the lines either. I have converted the removal 'from' to ' Select * ' and may see the following error:

    Select * FROM PS_GPDE_DV_TRIG40 WHERE EXISTS (SELECT FROM 'X'
    PS_GPDE_DV_ELIG_MO ELG WHERE ELG. EMPLID = PS_GPDE_DV_TRIG40. EMPLID AND
    ELG. EMPL_RCD = PS_GPDE_DV_TRIG40. EMPL_RCD AND TO_DATE (TO_CHAR (ELG. PRD_END_DT
    "YYYY"). TO_CHAR (ELG. PRD_END_DT, "MM"). '01', "YYYY-MM-DD") =.
    PS_GPDE_DV_TRIG40. GPDE_DV_EVT_EFFDT AND ELG. CAL_RUN_ID = "CAL_0812")
    Error report:
    SQL error: ORA-01840: value not long enough for the format of the date of entry


    The interesting thing is that if I attach a condition of emplid, then the SQL above does not give an error and return lines:

    Select * FROM PS_GPDE_DV_TRIG40 WHERE EXISTS (SELECT FROM 'X'
    PS_GPDE_DV_ELIG_MO ELG WHERE ELG. EMPLID = PS_GPDE_DV_TRIG40. EMPLID AND
    ELG. EMPL_RCD = PS_GPDE_DV_TRIG40. EMPL_RCD AND TO_DATE (TO_CHAR (ELG. PRD_END_DT
    "YYYY"). TO_CHAR (ELG. PRD_END_DT, "MM"). '01', "YYYY-MM-DD") =.
    PS_GPDE_DV_TRIG40. GPDE_DV_EVT_EFFDT AND ELG. CAL_RUN_ID = "FM_CG_0812")
    and emplid = "1234"

    now, if the number of lines is identified (by giving more number of emplids), it begins to give the error when the number of rows returned is greater than about 30. It is completely independent of what employee is used, so there is no question of data dependence.

    Function optimizer cost is off and a subquery nest is off on the init.ora file

    subquery UNNEST= false

    optimizercost_based_transformation = off


    I don't know if it has something to do with this problem.

    Explanations would be welcome!

    Thank you
    Vikas

    I think it is question of data combined with a not very sensible date format mask (it could fail when the null data, because of your concatenation with '01' and work when not null data).
    Have you tried with a simple TRUNC?

    Your code:

    ...TO_DATE(TO_CHAR(ELG.PRD_END_DT, 'YYYY') || TO_CHAR(ELG.PRD_END_DT , 'MM') || '01' , 'YYYY-MM-DD') =PS_GPDE_DV_TRIG40.GPDE_DV_EVT_EFFDT...
    

    After change:

    ...TRUNC(ELG.PRD_END_DT , 'MM') =PS_GPDE_DV_TRIG40.GPDE_DV_EVT_EFFDT...
    

    Nicolas.

  • Shuttle value too long for use in LOV sql cascading

    Hello

    On APEX 4.2.2.0.11 & Oracle 10.2.0.5.0:

    I have a shuttle service set up as well as a select list with of LOV cascading.

    The shuttle shows organization name and returns a list of the IDs of the colon separated.

    The selection list shows the so-called events belonging to the organizations selected in the shuttle.

    The selection list is implemented as LOV cascading with the shuttle as a parent element.

    This works fine as long as the length of the shuttle point value does not exceed 4000 characters.

    If so, the LOV - sql select list will give an ' ORA-01704: string literal too long "-error on the instr function ().

    This is the query:

    Select distinct TST. NAAM as display_value, TST.ID as return_value

    of the OTE ORGS

    Join the LIFO ADG ON (ADG. OTE_ID = OTE.ID)

    Join the DNR PART on (DNR. ADG_ID = ADG.ID)

    Join the TDR ON REGRET (TDR. DNR_ID = DNR.ID)

    Join the TEST TCT ON (TST.ID = RDT. TST_ID)

    where instr (': ' |: P1_ORG |) ':', ':' || OTE.ID | ') > 0

    order by 1

    Does anyone know how to make reference to the shuttle-value in sql, even if it is longer than 4000 characters?

    Well, I found a way to use LOVs cascading on page elements with values exceeding 4000 characters:

    Let's say I have a shuttle named P1_ORGANISATIE with "List of values" box, a dynamic LOV named "Source: lists of values Query" containing the value:

    Select NAAM as display_value, ID like return_value

    of NINEHAM

    order by 1

    If the number of records-NINEHAM is insufficient, the length of the value of P1_ORGANISATIE, which is a list of concatenated with colon separated digital ID, can exceed 4000 characters.

    Now suppose I have a list of selection called P1_TEST that is connected through "List of values"-> "En cascade LOV Parent article (s)" with P1_ORGANISATIE using a named LOV dynamics with "Source: lists of values Query" containing:

    Select distinct TST. NAAM as display_value, TST.ID as return_value

    of the OTE NINEHAM

    Join the AFDELINGEN ADG ON (ADG. OTE_ID = OTE.ID)

    Join the DEELNEMERS DNR ON (DNR. ADG_ID = ADG.ID)

    Join TESTDEELNEMERS TDR WE (TDR. DNR_ID = DNR.ID)

    Join TESTEN TST ON (TST.ID = RDT. TST_ID)

    where instr (":" |: P1_ORGANISATIE |) '':'', '':'' || OTE.ID | '':'') > 0

    order by 1

    In this case, when P1_ORGANISATIE exceeds 3998 characters, you'll get an "ORA-01704: string literal too long"-error and the P1_TEST will show an element called "undefined".

    A way around this is possible because for a named LOV, you can use a "function that returns a sql query" instead of a simple sql query. In other words, we can apply in the context of PL/SQL and thus have maximum for expressions of 32767 instead of 4000 characters. In addition, it is possible to use the two APEX_UTIL. STRING_TO_TABLE and APEX_COLLECTION.

    Setting "Source: lists of query values" on the LOV appointed to P1_TEST with the following code will work:

    DECLARE

    l_selected APEX_APPLICATION_GLOBAL. VC_ARR2;

    l_qry varchar2 (32767): =.

    "Select distinct TST. NAAM as display_value, TST.ID as return_value

    of the OTE NINEHAM

    Join the AFDELINGEN ADG ON (ADG. OTE_ID = OTE.ID)

    Join the DEELNEMERS DNR ON (DNR. ADG_ID = ADG.ID)

    Join TESTDEELNEMERS TDR WE (TDR. DNR_ID = DNR.ID)

    Join TESTEN TST ON (TST.ID = RDT. TST_ID)

    $1

    order by 1';

    BEGIN

    IF: P1_ORGANISATIE IS NULL

    OR LENGTH(:P1_ORGANISATIE)<=>

    THEN RETURN

    Replace (l_qry

    ,'$1'

    ,' where instr (":" |: P1_ORGANISATIE |) '':'', '':'' || OTE.ID | '':'') > 0'

    );

    ON THE OTHER

    l_selected: = APEX_UTIL. STRING_TO_TABLE(:P1_ORGANISATIE);

    APEX_COLLECTION. CREATE_OR_TRUNCATE_COLLECTION (p_collection_name-online 'ORGANISATIE_COLLECTIE');

    FOR id IN 1.l_selected.count

    LOOP

    APEX_COLLECTION.add_member (p_collection_name-online 'ORGANISATIE_COLLECTIE'

    p_n001-online to_number (l_selected (id))

    );

    END LOOP;

    RETURN

    Replace (l_qry

    ,'$1'

    ,'join apex_collections ON APC (APC. COLLECTION_NAME = "ORGANISATIE_COLLECTIE" AND APC. N001 = OTE.ID)"

    );

    END IF;

    END;

  • ORA-24019: QUEUE_TABLE identifier too long, should not be greater than

    OS: WINXP
    DB: XE 10.2.0.1

    Problem: SQL > START DBMS_AQADM.drop_queue_table (queue_table = > ' NAQ$ _QT_ORDERS_HYBRID_IN_)
    G', FORCE = > TRUE); END;
    2.
    BEGIN DBMS_AQADM.drop_queue_table (queue_table = > ' NAQ$ _QT_ORDERS_HYBRID_IN_G ", F)
    ORCE = > TRUE); END;
    *
    ERROR on line 1:
    ORA-24019: QUEUE_TABLE identifier too long, should not be more than 24
    characters
    ORA-06512: at "SYS." DBMS_AQADM_SYS', line 4084
    ORA-06512: at "SYS." DBMS_AQADM", line 197
    ORA-06512: at line 1

    I try to delete a queue, I'm not capable of the drop.

    PL. inform me how to solve this problem?

    [email protected] wrote:
    OS: WINXP
    DB: XE 10.2.0.1

    Problem: SQL > START DBMS_AQADM.drop_queue_table (queue_table => ' _QT_ORDERS_HYBRID_IN_$ AAQ)
    G', FORCE => TRUE); END;
    2.
    BEGIN DBMS_AQADM.drop_queue_table (queue_table => ' NAQ$ _QT_ORDERS_HYBRID_IN_G ", F)
    ORCE => TRUE); END;
    *
    ERROR on line 1:
    ORA-24019: QUEUE_TABLE identifier too long, should not be more than 24
    characters
    ORA-06512: at "SYS." DBMS_AQADM_SYS', line 4084
    ORA-06512: at "SYS." DBMS_AQADM", line 197
    ORA-06512: at line 1

    I try to delete a queue, I'm not capable of the drop.

    PL. inform me how to solve this problem?

    Try to rename the table and then drop.

    concerning

  • SYS. DBMS_SQL. Version of overload of PARSE CLOB error PLS-00172: string literal too long.

    I have This Oracle 12c Procedure

    CREATE OR REPLACE PROCEDURE LOGINCHECK(stmt IN CLOB)
    AS
      C INTEGER
    ;
      N INTEGER
    ;
      RC SYS_REFCURSOR
    ;
    BEGIN
      C
    := SYS.DBMS_SQL.OPEN_CURSOR;
      SYS
    .DBMS_SQL.PARSE(C,stmt,DBMS_SQL.native);
      N
    := SYS.DBMS_SQL.EXECUTE(C);
      SYS
    .DBMS_SQL.GET_NEXT_RESULT(C,RC);
      SYS
    .DBMS_SQL.RETURN_RESULT(RC);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
      
    NULL;
    when OTHERS then
      RAISE
    ;
    END LOGINCHECK;


    for example, to create an oracle with a xml or clob type IN FastInventory procedure and pass xml from this link https://drive.google.com/file/d/0BwAVQqYmX0-zQ1d1VnNmZndfcVE/view?usp=sharing


    The of the stmt parameter is approximately 50000 characters.


    DBMS_SQL. ANALYSIS gives error PLS-00172: string literal too long.


    I'm passing stmt My .net code as parameter . OracleDbType.Clob then why this error occurring.


    I use Oracle 12 c database. Visual Studio 2012, .net Framework 4;

    OK now I have a response team of oracle.net where it says on tweeter

    @OracleDOTNET team .NET oracle

    Seems to be a bug specific to PL/SQL, because the error occurs on the DBMS_SQL. ANALYZE the call

    Thank you all who have helped and at least tried to solve this problem.

  • I have problem with a .iso file that when I want to use I face the error "the file name is too long.

    Original title: name of a file

    Hello

    I have problem with a file .iso that when I want to use I'm dealing with error "the file name is too long" and I can't use this file anywhere for example: vmvare ' untraiso and even if I cannot write to cd or make a boot USB.

    I don't know how fix it.how I rename the file iso, shorter that I can use?

    Please help me.

    Thank you.

    Right-click on the ISO > rename > give a short name

  • Using Merge in oracle 11g this error SQL Error: ORA-30926: failed to get a stable set of rows in the source tables

    whenever I run this code I get this error

    SQL Error: ORA-30926: failed to get a stable set of rows in the source tables

    30926 00000 - "impossible to get a stable set of rows in the source tables.

    * Cause: A stable set of rows could not be achieved due to the large dml

    activity or one not deterministic where clause.

    * Action: Remove any non deterministic of the clauses and reissue of the dml.

    Don't know wht goes wrong!


    SQL:

    MERGE IN VENDORS_ACTIVE_DATE s

    USING (nvl (d.VENDOR, s.VENDOR) selection of the SELLER,

    NVL (d.COMPANY_CODE, s.COMPANY_CODE) COMPANY_CODE.

    (case when ((d.VENDOR = s.VENDOR) and (d.COMPANY_CODE = s.COMPANY_CODE)))

    )

    then "MATCH".

    When d.COMPANY_CODE is null

    then 'DELETE '.

    When s.COMPANY_CODE is null

    then "INSERT."

    else 'UPDATE '.

    chck end)

    from (select * from VENDORS_ACTIVE_DATE where COMPANY_CODE = 2) s

    full outer join (select * provider where COMPANY_CODE = 2) d

    on (d.COMPANY_CODE = s.COMPANY_CODE AND s.COMPANY_CODE = 2)

    ) d

    WE (d.COMPANY_CODE = s.COMPANY_CODE AND d.chck in ('UPDATE', 'GAME', 'DELETE'))

    WHEN MATCHED THEN

    UPDATE SET s.VENDOR = d.VENDOR

    WHERE d.chck in ('UPDATE', 'DELETE')

    DELETE WHERE d.chck = 'DELETE '.

    WHEN NOT MATCHED THEN

    INSERT (SELLER, COMPANY_CODE)

    VALUES (d.VENDOR, d.COMPANY_CODE)

    Work request: (deleted the duplicate data in tables (source and target))

    MERGE IN VENDORS_ACTIVE_DATE s

    USING (nvl (d.VENDOR, s.VENDOR) selection of the SELLER,

    NVL (d.ACTIVEDATE, s.ACTIVEDATE) ACTIVEDATE.

    NVL (d.COMPANY_CODE, s.COMPANY_CODE) COMPANY_CODE.

    (case when ((d.VENDOR = s.VENDOR))

    - AND D.ACTIVEDATE = S.ACTIVEDATE

    and NVL (d.ACTIVEDATE, trunc (sysdate)) = NVL (s.ACTIVEDATE, trunc (sysdate))

    and (d.COMPANY_CODE = s.COMPANY_CODE)

    )

    then "MATCH".

    When d.COMPANY_CODE is null

    then 'DELETE '.

    When s.COMPANY_CODE is null

    then "INSERT."

    else 'UPDATE '.

    chck end)

    from (select * from suppliers where COMPANY_CODE = 2) d

    full outer join (select * from vendors_active_date where COMPANY_CODE = 2) s

    on (d.COMPANY_CODE = s.COMPANY_CODE and s.vendor = d.vendor)

    ) d

    WE (d.COMPANY_CODE = s.COMPANY_CODE AND d.VENDOR = s.VENDOR AND d.chck in ('UPDATE', 'GAME', 'DELETE'))

    WHEN MATCHED THEN

    S.ACTIVEDATE = UPDATE SET d.ACTIVEDATE

    WHERE d.chck in ('UPDATE', 'DELETE')

    DELETE WHERE d.chck = 'DELETE '.

    WHEN NOT MATCHED THEN

    INSERT (VENDOR, ACTIVEDATE, COMPANY_CODE)

    VALUES (d.VENDOR, d.ACTIVEDATE, d.COMPANY_CODE)

  • SQL error: ORA-00979: not a GROUP BY

    Hi team,

    I am trying to execute the query

    SELECT DISTINCT comp.company_name |' -' || COMP.contract_number AS 'company_name '.

    , UPPER (bh.first_name) AS 'budget_holder '.

    , INITCAP (sup.first_name) |' -' || SUP. Surname AS 'supervisor '.

    , INITCAP (emp.status) AS "Department".

    , INITCAP (emp.first_name |) » '|| EMP. Surname) AS "employee."

    r.employee_id

    , emp.paaf_number AS 'paaf_num '.

    , emp.employee_payroll_number AS 'payroll_num '.

    , emp.discipline AS 'discipline '.

    , NVL (SUM (tg.week_day1), 0) AS "day 1".

    , NVL (SUM (tg.week_day2), 0) AS "day 2".

    , NVL (SUM (tg.week_day3), 0) AS day '3 '.

    , NVL (SUM (tg.week_day4), 0) AS "day4.

    , NVL (SUM (tg.week_day5), 0) AS "day5".

    , NVL (SUM (tg.week_day6), 0) AS "day6.

    , NVL (SUM (tg.week_day7), 0) AS "day 7".

    r.valid_from

    r.valid_to

    Tw_roster_data r

    JOIN tw_employee emp

    ON emp.employee_id = r.employee_id

    JOIN tg tw_timesheet_stage

    ON tg.employee_id = r.employee_id

    AND tg.week_commencing = r.valid_from

    JOIN the tw_contracting_company comp

    ON comp.contracting_company_id = r.contracting_company_id

    JOIN tw_supervisor sup

    ON sup.supervisor_id = tg.supervisor_id

    JOIN tw_budget_holder bh

    ON bh.budget_holder_id = sup.budget_holder_id

    WHERE r.contracting_company_id = 101

    AND r.VALID_FROM = January 31, 2015.

    AND r.VALID_TO = February 6, 2015"

    Group of r.employee_id, comp.company_name, bh.first_name,

    EMP.paaf_number, emp.employee_payroll_number, emp.discipline,

    r.valid_from, r.valid_to;

    But still the error below

    Error in the command line: 1 column: 17

    Error report-

    SQL error: ORA-00979: not a GROUP BY expression

    00979 00000 - "not a GROUP BY expression"

    Can help.

    Hello

    When to use analytical function oracle other columns used based on the analysis, must be included in the GROUP BY Clause

    SELECT expression1, expression2, ... expression_n,
      aggregate_function (expression)
    FROM tables
    WHERE conditions
    GROUP BY expression1, expression2, ... expression_n;
    

    SQL 101: Seen are medium and other aggregate data

      SELECT DISTINCT
             comp.company_name || ' - ' || comp.contract_number AS "company_name",
             UPPER (bh.first_name) AS "budget_holder",
             INITCAP (sup.first_name) || ' - ' || sup.surname AS "supervisor",
             INITCAP (emp.status) AS "department",
             INITCAP (emp.first_name || ' ' || emp.surname) AS "employee",
             r.employee_id,
             emp.paaf_number AS "paaf_num",
             emp.employee_payroll_number AS "payroll_num",
             emp.discipline AS "discipline",
             NVL (SUM (tg.week_day1), 0) AS "day1",
             NVL (SUM (tg.week_day2), 0) AS "day2",
             NVL (SUM (tg.week_day3), 0) AS "day3",
             NVL (SUM (tg.week_day4), 0) AS "day4",
             NVL (SUM (tg.week_day5), 0) AS "day5",
             NVL (SUM (tg.week_day6), 0) AS "day6",
             NVL (SUM (tg.week_day7), 0) AS "day7",
             r.valid_from,
             r.valid_to
        FROM tw_roster_data r
             JOIN tw_employee emp
                ON emp.employee_id = r.employee_id
             JOIN tw_timesheet_stage tg
                ON tg.employee_id = r.employee_id
                   AND tg.week_commencing = r.valid_from
             JOIN tw_contracting_company comp
                ON comp.contracting_company_id = r.contracting_company_id
             JOIN tw_supervisor sup
                ON sup.supervisor_id = tg.supervisor_id
             JOIN tw_budget_holder bh
                ON bh.budget_holder_id = sup.budget_holder_id
       WHERE     r.contracting_company_id = 101
             AND r.VALID_FROM = '31-JAN-2015'
             AND r.VALID_TO = '06-FEB-2015'
    GROUP BY
    comp.contract_number
    ,comp.company_name
    ,bh.first_name
    ,sup.first_name
    ,sup.surname
    , emp.status
    ,emp.first_name
    ,emp.surname
    r.employee_id,
    emp.paaf_number,
    emp.employee_payroll_number,
    emp.discipline,
     r.valid_from,
     r.valid_to;
    

Maybe you are looking for