SQL基础(九)PL/SQL
来源:互联网 发布:nba历史数据库 编辑:程序博客网 时间:2024/06/09 16:07
PL/SQL declare、begin、DBMS_SQL、dbms_output
■基本篇
set serveroutput on;
declare
cursor c1 is select * from cxck.t订货
where 产品号 = 'a001' order by 订货号;
-- rec c1%rowtype;
begin
dbms_output.put_line ('start...');
for rec in c1 loop
dbms_output.put_line (rec.订货号 || ' ' || rec.产品号);
end loop;
dbms_output.put_line ('end');
exception
when OTHERS then
dbms_output.put_line ('** error **');
end;
/
■动态的 SQL
declare
tbl in varchar2 default 'cxck.test';
cid integer;
begin
cid := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE(cid, 'create table ' || tbl || ' (field1 number(9))', dbms_sql.v7);
DBMS_SQL.CLOSE_CURSOR(cid);
dbms_output.put_line ('end');
exception
when OTHERS then
dbms_output.put_line ('** error **');
end;
/
- SQL基础(九)PL/SQL
- PL/SQL学习九
- SQL-PL/SQL基础
- Oracle(九)PL/SQL 游标
- PL/SQL基础(二)
- PL/SQL基础(三)
- PL/SQL之九 函数
- 【DB.PL/SQL】PL/SQL - 基础
- ORACLE PL/SQL 基础
- PL/SQL基础
- PL/SQL语言基础
- PL/SQL语言基础
- PL/SQL语言基础
- ORACLE PL/SQL 基础
- PL/SQL基础小结
- PL/SQL 基础
- PL/SQL基础学习
- PL/SQL编程基础
- 屏幕图片捕捉
- SQL基础(八)自定义函数
- Guice 1.0 用户指南
- 时间控件---带年月日时分秒
- study js
- SQL基础(九)PL/SQL
- DB2-JAVA存储过程环境设置
- struts实现分页,目前最好的方法
- SQL Server 2005 Integration Services 介绍
- SQL基础(十)SQL*Plus 命令
- SQL基础(十一)分析函数
- VC char to CString And CString to char
- Struts标签大全
- 2007.04.12 Split2YUV411 优化