I am not so into database and I have the following problem trying to implement a simple insert query that insert a new record into an Oracle database.
So my table have the following structure:
DESCRIBE FLUSSO_XMLSDI
Nome Nullo Tipo
-------------- -------- ------------
NUMERO_FATTURA NOT NULL VARCHAR2(15)
DATA_EMISSIONE DATE
XML CLOB
PFK_PIVA VARCHAR2(16)
PDF VARCHAR2(1)
So as you can see the last field of this table is named PDF and it is nullable and it have 1 character as length (It is defined as VARCHAR2(1 BYTE) but I think that it means that it can contain only a character).
So my problem is that if I do:
INSERT INTO FLUSSO_XMLSDI (NUMERO_FATTURA, DATA_EMISSIONE, XML, PFK_PIVA, PDF)
VALUES (004600002149, date'2015-03-16', 'TEST' , 80003690668, 'S');
It works and the new record is correctly inserted into my FLUSSO_XMLSDI table.
But when I try to do (setting the PDF field to **null):
INSERT INTO FLUSSO_XMLSDI (NUMERO_FATTURA, DATA_EMISSIONE, XML, PFK_PIVA, PDF)
VALUES (004600002149, date'2015-03-16', 'TEST' , 80003690668, null);
I obtain the following error message:
Errore con inizio alla riga 1 nel comando:
INSERT INTO FLUSSO_XMLSDI (NUMERO_FATTURA, DATA_EMISSIONE, XML, PFK_PIVA, PDF)
VALUES (004600002149, date'2015-03-16', 'TEST' , 80003690668, null)
Report errori:
Errore SQL: ORA-01403: no data found
ORA-06512: at "EDIWEA.TRI_P_FLUSSO", line 10
ORA-04088: error during execution of trigger 'EDIWEA.TRI_P_FLUSSO'
01403. 00000 - "no data found"
*Cause:
*Action:
Why I can't specify that the PDF field value as null also if it is nullable? What am I missing? How can I fix this issue?
This type of error
no data found
might be caused from a
select * into variable from dual
and its returning empty values, the select should return records to b added to the variables, so you have either to adjust the select to return values or comment it, so the triggers works.there are might another reasons for that error , we cannot help you unless you show us the trigger.