- 6
- 0
- 约1.46万字
- 约 7页
- 2016-09-30 发布于浙江
- 举报
oracle基大全-游标-存储过程-函数-包
ò??¢??í¨sql£?
2??? http://1632004./blog/static/29991497200821465716930/
?t?¢ó?±ê
?-?·ó?±ê:2?ó?open,close,fetch,3ìDò?á×??ˉopen,close,fetch
declare
v_customer customer%rowtype;
v_customerName customer.customerName%type;
cursor c1(v_customerName varchar2) is select * from customer where customerName like v_customerName;
begin
v_customerName:=aa;
for v_customer in c1(v_customerName) loop
dbms_output.put_line(v_customer.customerName|| ||v_customer.sex);
end loop;
end;
2?êyó?±ê
declare
v_customer customer%rowtype;
v_customerName customer.customerName%type;
cursor c1(v_customerName varchar2) is select * from customer where customerName like v_customerName;
begin
v_customerName:=aa;
open c1(v_customerName);
fetch c1 into v_customer;
while(c1%found) loop
dbms_output.put_line(v_customer.customerName|| ||v_customer.sex);
fetch c1 into v_customer;
end loop;
end;
????ó?±ê
?÷òa′|àí?ˉì?sql
1?¢ê1ó?1y3ì
1)?¨ò?ààDí
type c_type is ref cursor;
2)?¨ò?ó?±ê±?á?
c1 c_type;
3)′ò?aó?±êê±???¨sql
open c1 for select * from customer where customerName like :a using ±?á?
2.·?ày
ó??§ê?è?±í??£?è?1?ê?customer??ê?±ícustomerμ??ùóDêy?Y,
è?1?ê?customer1????ê?customer1μ?êy?Y?£
declare
v_tableName varchar2(20);
type c_type is ref cursor;
c1 c_type;
v_customer customer%rowtype;
v_customer1 customer1%rowtype;
v_sql varchar2(300);
begin
dbms_output.put_line(Please enter the table name);
v_tableName:=tableName;
if(upper(v_tableName)=upper(customer)) then
v_sql:=select * from customer;
open c1 for v_sql;
fetch c1 into v_customer;
while(c1%found) loop
dbms_output.put_lin
您可能关注的文档
最近下载
- 数字图像处理图像编码.ppt VIP
- 湖北城市建设职业职业技术学院2025年高职单招考试城市燃气工程技术专业考试大纲.pdf VIP
- 长帝电烤箱TV42W使用说明书用户手册.pdf
- 气象学与气候学课件.pptx
- 电子科技大学《光电图像处理》 第六章 图像编码与压缩 ppt课件.pptx VIP
- 对外经济贸易大学2021-2022学年《Python程序设计》期末考试试卷(A卷)及标准答案.docx
- 高考数学极值点偏移练习题(含答案).docx VIP
- 化工过程安全管理导则-装置安全规划与设计课件.pptx VIP
- 五脏与情志 jt叔叔 JT叔叔伤寒杂病论慢慢教(.)五脏与情志.doc VIP
- 图像处理与分析图像的编码技术.ppt VIP
原创力文档

文档评论(0)