DECLARE
BARCODE VARCHAR(50);
BEGIN
BARCODE := 'A';
IF BARCODE<>'A' then
SELECT 1 FROM sam_users;
ELSE
SELECT 2 FROM sam_users;
END IF;
END;
DECLARE
ENAME VARCHAR(50);
BEGIN
ENAME := 'SMITH';
IF ENAME<>'A' then
SELECT 1 Into ENAME FROM dual;
DBMS_OUTPUT.PUT_LINE(ENAME);
ELSE
SELECT 2 Into ENAME FROM dual;
DBMS_OUTPUT.PUT_LINE(ENAME);
END IF;
END;
DECLARE
ENAME VARCHAR(50);
BEGIN
ENAME := 'SMITH';
IF ENAME<>'A' then
execute immediate 'SELECT 1 FROM dual';
ELSE
execute immediate 'SELECT 2 FROM dual';
END IF;
END;