Error ora-00001
Publicado por goya (89 intervenciones) el 14/04/2007 20:12:12
Cordial Saludo:
Tengo un boton en un formulario, resulta que ese boton hace las sigueinte instruccion:
insert into tabla1
(TIPO_CONTEO, CONSEC_CRUCE ,NRO_CLIENTE ,NRO_REFERENCIA ,
NRO_UBICACION, UNIDAD, LOTE, FECHA_VENCE, CANTIDAD)
select DISTINCT
:conteo_inventario.tipo_conteo, :conteo_inventario.CONSEC_CRUCE ,NRO_CLIENTE ,NRO_REFERENCIA ,
NRO_UBICACION, UNIDAD, LOTE, FECHA_VENCE, 0
from det_inventario_teorico t
where nro_cliente = :cruce_inventario.nro_cliente
and consec_cruce = :cruce_inventario.consec_cruce
and not exists (select 'x'
from det_conteo_inventario d
where d.consec_cruce = :cruce_inventario.consec_cruce
and d.tipo_conteo = :conteo_inventario.tipo_conteo
and d.nro_referencia = t.nro_referencia
and d.nro_cliente = t.nro_cliente
and d.nro_ubicacion = t.nro_ubicacion
and d.unidad = t.unidad
and nvl(d.fecha_vence,to_date('01/01/1900','dd/mm/yyyy')) = nvl(t.fecha_vence,to_date('01/01/1900','dd/mm/yyyy'))
and d.lote = t.lote);
Aunque se va a insertar de un select distinct no hay datos repetidos pero me muestra el error ora-00001 y mire y dice Se intentó añadir una fila que provoca que un índice único repita valores. No se que hacer al respecto.
A quien me pueda colaborar muchas grcias
Tengo un boton en un formulario, resulta que ese boton hace las sigueinte instruccion:
insert into tabla1
(TIPO_CONTEO, CONSEC_CRUCE ,NRO_CLIENTE ,NRO_REFERENCIA ,
NRO_UBICACION, UNIDAD, LOTE, FECHA_VENCE, CANTIDAD)
select DISTINCT
:conteo_inventario.tipo_conteo, :conteo_inventario.CONSEC_CRUCE ,NRO_CLIENTE ,NRO_REFERENCIA ,
NRO_UBICACION, UNIDAD, LOTE, FECHA_VENCE, 0
from det_inventario_teorico t
where nro_cliente = :cruce_inventario.nro_cliente
and consec_cruce = :cruce_inventario.consec_cruce
and not exists (select 'x'
from det_conteo_inventario d
where d.consec_cruce = :cruce_inventario.consec_cruce
and d.tipo_conteo = :conteo_inventario.tipo_conteo
and d.nro_referencia = t.nro_referencia
and d.nro_cliente = t.nro_cliente
and d.nro_ubicacion = t.nro_ubicacion
and d.unidad = t.unidad
and nvl(d.fecha_vence,to_date('01/01/1900','dd/mm/yyyy')) = nvl(t.fecha_vence,to_date('01/01/1900','dd/mm/yyyy'))
and d.lote = t.lote);
Aunque se va a insertar de un select distinct no hay datos repetidos pero me muestra el error ora-00001 y mire y dice Se intentó añadir una fila que provoca que un índice único repita valores. No se que hacer al respecto.
A quien me pueda colaborar muchas grcias
Valora esta pregunta


0