I am using this oracle connection code in sas and getting this error:
ORACLE prepare error: ORA-06553: PLS-306: wrong number or types of arguments in call to 'get_pat_fix';
my code looks like this:
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;
I have tried to modify it several times but could not get it fixed.
I would extremely appreciate your help regarding the same.
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. 😀 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.