动态访问光标的列名 [英] Access cursor by column name dynamically

查看:121
本文介绍了动态访问光标的列名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以动态存取游标的栏位吗?我的意思是按名字?像这样:

Can I access a cursor's column dynamically? I mean by name? something like this:

declare
 v_cursor := select * from emp;
begin
 FOR reg IN v_cursor LOOP
   dbms_output.put_line(**reg['column_name_as_string']**);
 end loop;
end;

我知道粗体部分不是 PL / SQL, m寻找这样的东西,不能找到它在任何地方。

I know the bold part is not PL/SQL, but I'm looking for something like that and can't find it anywhere.

谢谢!

推荐答案

=http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/toc.htm =nofollow> DBMS_SQL 使用动态查询创建和访问游标。

You can use the package DBMS_SQL to create and access cursors with dynamic queries.

这篇关于动态访问光标的列名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆