在sql plus中执行一个函数 [英] executing a function in sql plus

查看:99
本文介绍了在sql plus中执行一个函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在oracle中创建了一个函数,它在特定的表中插入记录,并根据函数中的内容返回输出。例如(ins_rec返回数字)

如何调用此函数并在sql plus中查看其输出

解决方案

 申报
x号码;
begin
x:= myfunc(myargs);
end;

或者:

 从双重选择myfunc(myargs); 


I created a function in oracle that inserts records in specific tables and return an output according to what occurs within the function. e.g (ins_rec return number)

How do I call this function and see its output in sql plus

解决方案

declare
  x number;
begin
  x := myfunc(myargs);
end;

Alternatively:

select myfunc(myargs) from dual;

这篇关于在sql plus中执行一个函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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