随笔分类 - pl/sql
摘要:1 *********************** 2 触发器 3 *********************** 4 --一个helloworld级别的触发器 5 create or replace trigger hello_trigger 6 after 7 update on employe
阅读全文
摘要:1 --[存储函数:有返回值,创建完成后,通过select function() from dual;执行] 2 --[存储过程:由于没有返回值,创建完成后,不能使用select语句,只能使用pl/sql块执行] 3 4 --[格式] 5 --函数的声明(有参数的写在小括号里) 6 create o
阅读全文
摘要:1 --[预定义异常] 2 declare 3 4 v_sal employees.salary%type; 5 begin 6 select salary into v_sal 7 from employees 8 where employee_id >100; 9 10 dbms_output.
阅读全文
摘要:1 ************************************** 2 游标的使用 3 ************************************** 4 --12.1 使用游标 5 6 --要求: 打印出 80 部门的所有的员工的工资:salary: xxx 7 8 d
阅读全文
摘要:1 2 条件判断 3 4 7. 使用 IF ... THEN ... ELSIF ... THEN ...ELSE ... END IF; 5 6 要求: 查询出 150号 员工的工资, 若其工资大于或等于 10000 则打印 'salary >= 10000'; 7 若在 5000 到 10000
阅读全文
摘要:1 3.1 自定义记录类型 2 3 declare 4 --定义一个记录类型 5 type customer_type is record( 6 v_cust_name varchar2(20), 7 v_cust_id number(10)); 8 9 --声明自定义记录类型的变量 10 v_cu
阅读全文
摘要:1 0. 准备工作: 2 --打开oracle自带的输出方法baidbms_output,在执行du以后,使用dbms_output方法可以输出信息 3 set serveroutput on 4 5 hellowrold 程序 6 7 begin 8 dbms_output.put_line('h
阅读全文

浙公网安备 33010602011771号