PL/SQL 11g R2 —— PL/SQL概述 !

来源:互联网 发布:配置apache支持php7 编辑:程序博客网 时间:2024/04/27 22:45

PL/SQL 块结构:

<< label >> (optional)DECLARE -- Declarative part (optional)-- Declarations of local types, variables, & subprogramsBEGIN -- Executable part (required)-- Statements (which can use items declared in declarative part)[EXCEPTION -- Exception-handling part (optional)-- Exception handlers for exceptions (errors) raised in executable part]END;

PL/SQL 块分类:


匿名块:

SQL> conn hr/hr已连接。SQL> set serveroutput onSQL> declare  2    v_fname varchar2(20);  3  begin  4    select first_name into v_fname from employees where employee_id = 100;  5    dbms_output.put_line(v_fname);  6  end;  7  /StevenPL/SQL 过程已成功完成。

原创粉丝点击