2017-12-27 440 views
0

我有一个SQL Server数据库的查询获取存储这样的程序参数:获得Oracle存储过程的参数

SELECT 
    parameter.name, 
    types.name, 
    types.is_nullable 
FROM 
    sys.parameters AS parameter 
INNER JOIN 
    sys.procedures AS procedures ON parameter.object_id = procedures.object_id 
INNER JOIN 
    sys.types AS types ON parameter.system_type_id = types.system_type_id 
         AND parameter.user_type_id = types.user_type_id 
WHERE 
    procedures.name = 'UsernameSP' 

这将返回一个结果集:

name   name  is_nullable 
-------------------------------------- 
@Username  nvarchar 1 
@CreateDate datetime 1 

我需要这个查询一个Oracle数据库。我如何在Oracle中运行此查询?

回答

2
select argument_name,position, data_type 
from user_arguments 
where object_name = <your procedure> 
order by position 

假定您已登录到过程所在的当前模式。我不认为甲骨文有相当于“is_nullable”