SAS 中的 Oracle 连接
我在 sas 中使用这个 oracle 连接代码并收到此错误:
ORACLE 准备错误:ORA-06553:PLS-306:调用“get_pat_fix”时参数数量或类型错误;
我的代码如下所示:
proc sql;
connect to oracle(user='XXXXX'orapw='XXXXXX'path='');
create table work.XXX as select * from connection to oracle (
select to_char(yy.XXXX) as XXXXXX,
substr(get_pat_fix ('XX', yy.XXXX , 'XX','XX'),1,5) XXXX,
from XXX;
我尝试多次修改它但无法修复它。 我非常感谢您在这方面的帮助。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 TOAD 或 SQL Developer 等 IDE 中浏览该函数,或者在 SQL*Plus 中对其进行描述,如下所示:
这将显示参数的数字和数据类型。我们必须为每个没有默认值的参数传递值,并且必须为任何 OUT 或 IN OUT 参数传递一个变量。传递的值必须与参数的数据类型匹配。
参数可以按位置传递...
...或按命名符号...
无论哪种方式,参数都需要匹配:
当然,我错过了最明显的答案:查阅您的应用程序的文档,其中会有详细的描述GET_PAT_FIX() 函数的详细信息(包括其签名)。 :-D 抱歉,我以为我在打字时可以板着脸。
唉,在现实世界中,我们中有太多人不得不在没有像样的应用程序文档的情况下挣扎。所以我们必须询问数据库模式。我认为没有任何 SAS 工具可以执行此操作(在此处查找< /a>.
Browse the function in an IDE like TOAD or SQL Developer, or describe it in SQL*Plus like this:
This shows you the number and datatype of the parameters. We must pass values for every paramater which doesn't have a default, and we must pass a variable for any OUT or IN OUT parameter. The passed values must match the datatype of the parameter.
Parameters can be passed by position...
... or by named notation...
Either way, the parameters need to match:
Of course, I missed out the most obvious answer: consult your application's documentation, which will have a detailed description of the GET_PAT_FIX() function including its signature. :-D Sorry, thought I could keep a straight face while I typed that.
Alas, in the real world too many of us have to struggle along without decent documentation for our apps. So we have to interrogate the database schema. I don't think there are any SAS tools for doing this (the ones Google throws up all seem to be just data browsers). So that means you'll need a database tool. I'm going to suggest Oracle's SQL Developer not because it's the best (that's a matter of taste) but because it is free, and it works. Find it here.