ITPub博客

首页 > Linux操作系统 > Linux操作系统 > pl/sql 绑定变量使用

pl/sql 绑定变量使用

原创 Linux操作系统 作者:liuzhiqiangoracle 时间:2009-08-18 11:22:14 0 删除 编辑
1,
var x number
exec :x:=1048
select user_id from fnd_user where user_id=:x;

2,
declare
  x number := 1048;
  v number;
begin
  select user_id into v from fnd_user where user_id = x;
  dbms_output.put_line(v);
end;

3, 
declare
   v varchar2(20):='1,2,3,4,5,6,7';
   r number;
   t varchar2(200);
begin
t:='select 1 from dual where 1 in ('||v||')';
execute immediate t into r;
dbms_output.put_line(r);
end;

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/22333206/viewspace-612567/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2009-08-18

  • 博文量
    9
  • 访问量
    11095