易截截图软件、单文件、免安装、纯绿色、仅160KB

PL/SQL表


/*
PL/SQL表---table()函数用法:
利用table()函数,我们可以将PL/SQL返回的结果集代替table。
oracle内存表在查询和报表的时候用的比较多,它的速度相对物理表要快几十倍。
simple example:
1、table()结合数组:
*/
create or replace type t_test as object(
id integer,
rq date,
mc varchar2(60)
);
create or replace type t_test_table as table of t_test;
create or replace function f_test_array(n in number default null) return t_test_table
as
v_test t_test_table := t_test_table();
begin
for i in 1 .. nvl(n,100) loop
v_test.extend();
v_test(v_test.count) := t_test(i,sysdate,'mc'||i);
end loop;
return v_test;
end f_test_array;
/
select * from table(f_test_array(10));
select * from the(select f_test_array(10) from dual);
/*
2、table()结合PIPELINED函数:
*/
create or replace function f_test_pipe(n in number default null) return t_test_table PIPELINED
as
v_test t_test_table := t_test_table();
begin
for i in 1 .. nvl(n,100) loop
pipe row(t_test(i,sysdate,'mc'||i));
end loop;
return;
end f_test_pipe;
/
select * from table(f_test_pipe(20));
select * from the(select f_test_pipe(20) from dual);
/*
3、table()结合系统包:
*/
create table test (id varchar2(20));
insert into test values('1');
commit;
explain plan for select * from test;
select * from table(dbms_xplan.display);


相关文档:

sql server中的存储过程调试

调试:
在SQL QUERY中—》对象浏览器—》存储过程—》选择要调试的存储过程—》右击—》选择调试(debug)—》输入参数—》--设置完你的参数值后--点击执行,就是出现一个浮动工具条,上面有单步执行,断点设置等
---跟踪 :
开始->程序->MS SQLSERVER->事件探查器(SQL Prof ......

SQL 中文转拼音


--函数如下:
/*
CREATE FUNCTION dbo.fnpbGetPYFirstLetter 

@str NVARCHAR(4000) 

RETURNS NVARCHAR(4000) 
--WITH ENCRYPTION 
AS 
BEGIN 
DECLARE @WORD NCHAR(1),@PY NVARCHAR(4000)
SET @PY=''
WHILE LEN(@STR)>0 
BEGIN 
SET @WORD=LEF ......

SQL 行列互转

--行列互转
/******************************************************************************************************************************************************
以学生成绩为例子,比较形象易懂
整理人:中国风(Roy)
日期:2008.06.06
***************************************************************** ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号