[英]Executing a Stored Procedure from Oracle SQL Developer
How can I execute the below Stored Procedure? 如何执行以下存储过程?
create or replace procedure squareOf(x IN OUT NUMBER) is
begin
x:= x*x;
end;
DECLARE
x NUMBER := 6;
BEGIN
squareOf(x => x );
dbms_output.put_line( 'X: '|| x );
END;
returns 36 返回36
@Massie already mentioned one approach using anonymous block. @Massie已经提到了一种使用匿名块的方法。
Another approach is using bind variable in command line like below - 另一种方法是在命令行中使用绑定变量,如下所示:
var c number;
exec :c:= 6;
execute squareOf(:c);
print c;
Since you're asking about 'in SQL Developer' - here's the answer from the IDE perspective. 由于您在询问“在SQL Developer中”,因此这是从IDE角度来看的答案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.