Oracle 使用标量变量接收游标数据
来源:互联网 发布:病毒 知乎 编辑:程序博客网 时间:2024/06/10 17:20
-- 使用标量变量接收游标数据
declare
v_id tg_test_user.tg_test_userid%type; -- 创建一个类型与tg_test_user表中的tg_test_userid列相同的标量变量 v_id
v_name tg_test_user.tg_test_username%type;
v_pwd tg_test_user.tg_test_password%type;
cursor e_cursor is -- 定义游标
select * from tg_test_user;
begin
open e_cursor; --打开游标
loop
fetch e_cursor into v_id,v_name,v_pwd; -- 提取数据
exit when e_cursor%notfound;
dbms_output.put_line('用户名:'||v_name||',密码:'||v_pwd||',ID:'||v_id); -- 输出
end loop;
close e_cursor; -- 关闭游标
end;
declare
v_id tg_test_user.tg_test_userid%type; -- 创建一个类型与tg_test_user表中的tg_test_userid列相同的标量变量 v_id
v_name tg_test_user.tg_test_username%type;
v_pwd tg_test_user.tg_test_password%type;
cursor e_cursor is -- 定义游标
select * from tg_test_user;
begin
open e_cursor; --打开游标
loop
fetch e_cursor into v_id,v_name,v_pwd; -- 提取数据
exit when e_cursor%notfound;
dbms_output.put_line('用户名:'||v_name||',密码:'||v_pwd||',ID:'||v_id); -- 输出
end loop;
close e_cursor; -- 关闭游标
end;
0 0
- Oracle 使用标量变量接收游标数据
- [oracle编程]pl/sql --标量 复合变量以及游标的简单使用
- 使用PL/SQL 记录变量接收游标数据
- Oracle游标变量的使用实例
- Oracle游标使用方法(&游标里使用变量绑定)
- oracle 游标变量
- oracle 使用游标批量分段插入数据
- Oracle数据中如何使用游标
- Oracle游标中直接使用日期变量的问题解决
- ORACLE 游标和游标变量的区别
- ORACLE 游标和游标变量的区别
- 标量数据
- Oracle pl/sql编程 16---游标变量使用游标更新数据库
- Oracle 游标与绑定变量
- Oracle游标与绑定变量
- Oracle游标绑定变量应用
- oracle 游标之 定义变量
- oracle 游标变量REF Cursor
- java基础----1
- golang简单的抓取
- 菜鸟教程链接
- iOS Line drawing tool(画线类, 直线和 折线)
- Windows pip不是内部命令
- Oracle 使用标量变量接收游标数据
- STL
- BZOJ 2081 [Poi2010]Beads 哈希
- 获取用户基本信息subscribe_time单位问题
- c++中cin与cout处理不同进制
- 最简单的数据源,数据库连接池。
- 日期格式化和SimpleDateFormat问题
- Trie树
- Java transient关键字使用小记