Answer the question
In order to leave comments, you need to log in
How to eliminate empty query error in ORACLE?
The procedure contains the following query:
AS
INSERTED VARCHAR(200);
ID_ NUMBER;
...
SELECT ID_MATERIAL INTO INSERTED FROM SOURCE WHERE SHORTNAME_MATERIAL=SHORT_NAME;
Answer the question
In order to leave comments, you need to log in
The simplest way, however, is to handle the no_data_found error.
The reference script is
AS
INSERTED VARCHAR(200);
ID_ NUMBER;
BEGIN
...
BEGIN
SELECT ID_MATERIAL INTO INSERTED FROM SOURCE WHERE SHORTNAME_MATERIAL=SHORT_NAME;
EXCEPTION
WHEN NO_DATA_FOUND THEN NULL ; (или INSERTED := NULL)
END;
...
IF INSERTED IS NULL THEN
...
ELSE
...
END IF ;
...
END <PROCEDURE_NAME> ;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question