如何使用 plsql 表参数在匿名块中传递值

编程入门 行业动态 更新时间:2024-10-24 15:27:06
本文介绍了如何使用 plsql 表参数在匿名块中传递值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

表 abc 有以下列

 approved_ain
    1
    2
    12
    34

我有一个程序

create or replace procedure abc( p_admin varchar2,
p_approved_ain  abc.approved_ain)--plsql table in parameter

begin

end;

现在,当我在匿名块中调用此过程时:-

now when i call this procedure in an anonymous block :-

declare 
l_Admin varchar2(100);
l_approved_ain abc.approved_ain;

begin
abc(l_Admin ,l_approved_ain);
commit;

end;

如何将plsql表的approved_ain的值传递给这个匿名块.?那就是我想通过传递 abc 表批准_ain 列的值来测试它......

How can i pass values of the approved_ain of plsql table to this anonymous block.? that is i want to test it by passing the values of abc table approved_ain column.......

答案:

 declare 
    l_Admin varchar2(100);
    l_approved_ain abc.approved_ain;

    begin
l_approved_ain(1) :=123;
l_approved_ain(2) :=4645;
    abc(l_Admin ,l_approved_ain);
    commit;

    end;

推荐答案

鉴于您只想测试,那么只在匿名块中设置值怎么样:

Given the fact that you only want to test, what about just setting the values in the anonymous block:

declare 
l_Admin varchar2(100) := 'string';
l_approved_ain abc.approved_ain := ???;

begin
abc(l_Admin ,l_approved_ain);
commit;

end;

这篇关于如何使用 plsql 表参数在匿名块中传递值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-30 05:03:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1390209.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   参数   plsql

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!