simple question here, I am writing a function, but I was having trouble setting up my first if statement, my attempt is below, but I keep getting “Expression can not be used as an assignment target” error on the lines “Type := CE;” and “Type :=UG;” Im sure there is a quick fix to this…… anyone know?
CREATE OR REPLACE FUNCTION SCHEMA1."FUNCTION1" ( Id IN VARCHAR2,
term IN VARCHAR2,
Type IN VARCHAR2 default NULL )
RETURN VARCHAR2 IS
BEGIN
IF Type IS NULL
THEN
IF SUBSTR(term,5,6) = 'Q'
THEN
Type := 'CE';
ELSE
Type := 'UG';
END IF;
END IF;
........
Declare a holding variable for use within the function?