I have a Package:
CREATE OR REPLACE PACKAGE LETRAS AS
possuiA CONSTANT BOOLEAN NOT NULL := TRUE;
possuiB CONSTANT BOOLEAN NOT NULL := TRUE;
possuiC CONSTANT BOOLEAN NOT NULL := TRUE;
possuiD CONSTANT BOOLEAN NOT NULL := FALSE;
possuiE CONSTANT BOOLEAN NOT NULL := FALSE;
possuiF CONSTANT BOOLEAN NOT NULL := FALSE;
END db1integra;
And though I'd like to check on a select if CONSTANT has G, and if it exists then I execute an action if it is TRUE if it is FALSE I do not execute.
can be checked as follows: (the script below does not work, I can not do validation of a constant that does not exist)
DECLARE
vsql VARCHAR(1000);
BEGIN
IF letras.possuig THEN
vsql := 'UPDATE EMPLOYEE
SET JOB = DEFAULT
WHERE EMPNO = ''000290''';
ELSE
vsql := 'UPDATE EMPLOYEE
SET JOB = DEFAULT
WHERE EMPNO = ''000210''';
END IF;
END;
Thank you very much.