create or replace procedure testas begin dbms_output.put_line('hello world!');end;show serveroutput;set serveroutput on;begin test;end;select * from user_source where name='TEST' order by line;select * from user_source where name='TEST2' order by line;create or replace procedure product_update_prc asbegin update productinfo set description='促销产品' where productid in ( select productid from (select * from productinfo order by productprice asc) where rownum<4 ); commit;end;/declare cursor mycursor is select * from productinfo; myrow productinfo%rowtype;begin product_update_prc; /* for r in mycursor loop dbms_output.put_line(r.description); end loop;*/ open mycursor; loop fetch mycursor into myrow; exit when mycursor%notfound; dbms_output.put_line(myrow.description); end loop; close mycursor;end;show errors procedure product_update_prc;create or replace procedure test2 as v_categoryid categoryinfo.categoryid%type; v_categoryname categoryinfo.categoryname%type; cursor cursor_categoryid is select category from productinfo group by category; begin open cursor_categoryid; loop fetch cursor_categoryid into v_categoryid; exit when cursor_categoryid%notfound; select categoryname into v_categoryname from categoryinfo where categoryid=v_categoryid; dbms_output.put_line(v_categoryname); for product in ( select * from productinfo where category=v_categoryid ) loop dbms_output.put_line(product.productid||' '||product.productname||' '||product.productprice); end loop; end loop; close cursor_categoryid;end;show errors procedure test2;begin test2;end;
详细解决方案
oracle学习-存储过程.sql
热度:26 发布时间:2016-05-05 11:04:05.0
相关解决方案
- oracle 分页排序,ssi,该怎么处理
- oracle 最近的时间(而不是前一天的时间) 跪求sql语句 。解决方法
- oracle,该怎么解决
- 在 Hibernate3 查询不到 Oracle 11g 里的记录
- oracle 安装时出现 java tm 异常
- android访问其他数据库(如:oracle、MySql等),希望大家给点建议!解决方案
- oracle 安插 LONG VARCHAR 类型数据
- ORACLE 一条SQL的有关问题
- oracle loadjava如何用
- oracle,该如何处理
- C# + SQL server +oracle QQ交流群142703980解决方法
- 怎么跟踪winform应用程序发送到数据库的sql(oracle、mssql)
- , 每次玩ASP都会遇到一些恶心的有关问题, 这次是:未能加载文件或程序集“Oracle.DataAccess”或它的某一个依赖项
- 尝试加载 Oracle 客户端库时引发 BadImageFormatException。如果在安装 32 位 Oracle 客户端组件的情况下以 64 位模式运,该怎么解决
- 求解:gridview行值的计算并绑定有关问题(asp.net+oracle)
- Oracle.DataAccess 执行多条sql语句,该如何解决
- VS10连接Oracle的有关问题:"Oracle.DataAccess.Client.OracleConnection"的类型初始值设定项引发错误
- System.Data.OleDb.OleDbException: 未找到 Oracle 客户端和网络组件。
- asp.net oracle 参数化 模糊查询出错,该怎么处理
- Oracle-参数查询有关问题
- oracle,insert 语句插入一条记录后要求,返回主键id値。解决思路
- Oracle 10g下的SQL语句,有点难度.请~[同时向朋友们道歉~]
- 月统计(oracle)解决办法
- 在线紧急等一sql语句(oracle),该怎么处理
- 面试问,为什么jsp+oracle,asp+sql server这样来搭配?该如何处理
- oracle 连接数据库该如何写语句的
- System.Data.OracleClient requires Oracle client software version 8.1.7 or greater
- oracle 防sql注入有关问题!
- 求 Oracle Database Server 'TNS Listener'远路数据投毒漏洞 补丁
- oracle 客户端链接服务端的方式?该如何解决