Oracle 存储过程A
- create or replace procedure users_procedure is
- cursor users_cursor is select * from users;
- v_id users.id%type;
- v_username users.username%type;
- v_password users.password%type;
- begin
- open users_cursor;
- fetch users_cursor into v_id, v_username, v_password;
- while users_cursor%found
- loop
- dbms_output.put_line('v_id = ' || v_id || 'v_username = ' || v_username || 'v_password = ' || v_password);
- fetch users_cursor into v_id, v_username, v_password;
- end loop;
- close users_cursor;
- end;
- /
- create or replace procedure users_batch_insert_procedure is
- v_id users.id%type;
- v_username users.username%type;
- v_password users.password%type;
- begin
- for i in 0..1000
- loop
- v_id := i;
- v_username := 'abc' || i;
- v_password := 'efg' || i;
- insert into users values(v_id, v_username, v_password);
- commit;
- end loop;
- end;
- /
- create or replace procedure users_a is
- type users_cursor_type is ref cursor; --return users%rowtype;
- type users_record_type is record (v_id users.id%type, v_username users.username%type, v_password users.password%type);
- v_sql varchar2(2000);
- users_cursor_a users_cursor_type;
- users_record users_record_type;
- begin
- v_sql := 'select * from users';
- open users_cursor_a for v_sql;
- fetch users_cursor_a into users_record;
- while users_cursor_a%found
- loop
- dbms_output.put_line('v_id = ' || users_record.v_id || 'v_username = ' || users_record.v_username || 'v_password = ' || users_record.v_password);
- fetch users_cursor_a into users_record;
- end loop;
- close users_cursor_a;
- end;
- /
- create or replace procedure users_a is
- type users_cursor_type is ref cursor return users%rowtype;
- v_row users%rowtype;
- v_sql varchar2(2000);
- users_cursor_a users_cursor_type;
- begin
- open users_cursor_a for select * from users;
- fetch users_cursor_a into v_row;
- while users_cursor_a%found
- loop
- dbms_output.put_line('v_id = ' || v_row.id || 'v_username = ' || v_row.username || 'v_password = ' || v_row.password);
- fetch users_cursor_a into v_row;
- end loop;
- close users_cursor_a;
- end;
- /
- set serveroutput on size 1000000;
Oracle 存储过程A的更多相关文章
- oracle 存储过程
来自:http://www.jb51.net/article/31805.htm Oracle存储过程基本语法 存储过程 1 CREATE OR REPLACE PROCEDURE 存储过程名 2 I ...
- Oracle存储过程语法
原文链接:http://www.jb51.net/article/31805.htm Oracle存储过程基本语法 存储过程 1 CREATE OR REPLACE PROCEDURE 存储过程名 ...
- ORACLE存储过程调用Web Service
1. 概述 最近在ESB项目中,客户在各个系统之间的服务调用大多都是在oracle存储过程中进行的,本文就oracle存储过程调用web service来进行说明.其他主流数据库,比如mysql和sq ...
- Oracle存储过程基本语法介绍
Oracle存储过程基本语法 存储过程 1 CREATE OR REPLACE PROCEDURE 存储过程名 2 IS 3 BEGIN 4 NULL; 5 END; 行1: CREATE OR RE ...
- MyBatis调用Oracle存储过程
MyBatis调用Oracle存储过程 1.无输入和输出参数的存储过程 2.带有输入和输出参数的存储过程 3.返回游标的存储过程 mybatis中的配置文件代码 <resultMap type= ...
- Oracle存储过程(转)
Oracle存储过程基本语法 存储过程 1 CREATE OR REPLACE PROCEDURE 存储过程名 2 IS 3 BEGIN 4 NULL; 5 END; 行1: CREATE OR RE ...
- Oracle存储过程中异常Exception的捕捉和处理
Oracle存储过程中异常的捕捉和处理 CREATE OR REPLACE Procedure Proc_error_process ( v_IN in Varchar2, v_OUT Out Var ...
- Oracle存储过程动态创建临时表/存储过程执行权限问题--AUTHID CURRENT_USER
关于Oracle存储过程执行权限问题的解决 http://blog.sina.com.cn/s/blog_6ceed3280101hvlo.html (2014-04-02 04:06:28) 转载▼ ...
- ORACLE存储过程学习
存储过程 1 CREATE OR REPLACE PROCEDURE 存储过程名 2 IS 3 BEGIN 4 NULL; 5 END; 行1: CREATE OR REPLACE PROCEDURE ...
- C# 获取 oracle 存储过程的 返回值1
/// <summary> /// 返回对应表的模拟自增字段值 /// </summary> /// <param name="tablename"& ...
随机推荐
- c#中sealed修饰符
sealed 修饰符表示密封 用法: 1.用于类时,表示该类不能再被继承,不能和abstract同时使用,因为这两个修饰符在含义上互相排斥 2.用于方法和属性时,表示该方法或属性不能再被重写,必须和o ...
- js判断是移动端还是PC端访问网站
window.location.href = /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? "htt ...
- c#设计模式之装饰器模式(Decorator Pattern)
引子 在面向对象语言中,我们常常会听到这样一句话:组合优于继承.那么该如何去理解这句话呢? 下面我将以游戏装备为模型用简单的代码去展示它 先创建一个装备的抽象类,然后创建刀枪2个具体的业务子类 pub ...
- qi zi
#include<stdio.h> ]; ][]; int N; typedef struct node{ int x; }node; node dui[]; int se(int a) ...
- 洛谷P3964 [TJOI2013]松鼠聚会(坐标系变换)
题面 传送门 题解 对于两个点\((x_i,y_i)\)和\(x_j,y_j\),我们定义它们之间的曼哈顿距离为 \[|x_i-x_j|+|y_i-y_j|\] 定义它们的切比雪夫距离为 \[\max ...
- 基于.NET的开源搜索引擎-DotLucene(2)
NLucene是将 Lucene 从 Java 移植到 .NET 的一个 SourceForge 项目,它从 Lucene 1.2 版本转化而来. Lucene.Net因为 NLucene 项目到20 ...
- scrapy入门例子
使用爬取http://quotes.toscrape.com/内容,网站内容很简单 一. 使用scrapy创建项目 scrapy startproject myscrapy1 scrapy gensp ...
- 终于搞定在VS2010中将CString转换为const char*
最近碰到了CString 转 const char *的问题. 以前只要简单的一个强制转换就OK了,可现在是不行了,搜索了很多资料,终于搞定,主要是Unicode和ANSI的问题,只要做一个转换就可以 ...
- 总结day1 ---- 基础内容学习 ,以及历史了解
知识目录 一 : python 的发展历史 1. pyhton2 和pyhton3 的区别 二: python的语言分类 三 :变量 四: 常量 五 :注释 六 : 基本数据类型 1 : int 2 ...
- 回归到jquery
最近在做一个公司的老产品的新功能,使用原来的技术框架,jquery和一堆插件,使用jquery的话,灵活性是有了,但是对于一个工作了3年多的我来说,很low,没什么成就感,技术本身比较简单,但是业务的 ...