oracle基大全-游标-存储过程-函数-包.docVIP

  • 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

文档评论(0)

1亿VIP精品文档

相关文档