I have following stored procedure. Parameter FLAG_ passed in is only allowed to accept null, 0 or 1. But the condition checking (FLAG_ != 0 OR FLAG_ != 1) doesn't work. I guess this is because type for FLAG_ is NUMBER which include float. Is there a way to compare NUMBER to INT ?
create or replace PROCEDURE "ADD_RMV_FLAG"
(
TEXT OUT VARCHAR2
, FLAG_ IN NUMBER -- empty, 0 and 1 only values accepted.
) AS
BEGIN
-- input pramameters checking
IF FLAG_ is not null
THEN
IF (FLAG_ is not null AND (FLAG_ != 0 OR FLAG_ != 1))
THEN
raise_application_error(-20001, 'ERROR: only empty, 0 or 1 is accepted
for FLAG. Passed in ' || FLAG_);
END IF;
END IF;
END ADD_RMV_FLAE
Aucun commentaire:
Enregistrer un commentaire