PL/SQL 程序块

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;
上一篇:创建支持复杂脚本Complex Scripts的WINCE6.0系统


下一篇:LINQ教程