Hi.
Hi have this function above that I have to run, but I'm having the error: ORA-06550: linha 1, coluna 7:
PLS-00306: wrong number or types of arguments in call to 'RDS_VALIDA_LEI'
FUNCTION RDS_VALIDA_LEI RETURNS NUMBER
Argument Name Type In/Out Default?
------------------------------ ----------------------- ------ --------
P_LEI VARCHAR2 IN
P_DATE DATE IN DEFAULT
NUM_ENT VARCHAR2(20) IN DEFAULT
I also tried to put the ToObject(Result) on the input OutputList but the error is the same.
Can anyone help me?
Thanks!
Hi Rui,
What is the data type of the attributes in the structure?
Is it the date format the same of the database?
Regards,
Leandro.
Hi Leandro.
The detail of the function is this one:
This is the structure that I'm using in OutSystems:
P_LEI - Text
P_DATE - Date
NUM_ENT - Text
How can I check if the date format is the same of the database?
Hello Rui.
I had a customer run into something similar recently. The problem ended up being this.
https://support.oracle.com/knowledge/Oracle%20Database%20Products/261084_1.html
I was able to work around it by editing the C# code for the Oracle Connector. Please note that my changes have only been minimally tested and specifically for my customer's use case which was slightly different, but in short, this is the process I followed.
If the callType is "FUN" then I register the return parameter before the in parameter(s). Also, when retrieving the outputs, if the callType is "FUN" I retrieved the first parameter instead of the last parameter since the return parameter was registered first.
Again, this is not well tested and probably isn't the best way to approach this problem but the code ended up like this.
cmd = CreateCommand(connectionName, oracleBD, oracleUser, oraclePass, PKGName, callName, ref cn, ref trans);
// Input parameters
int NrOfParameters = 0;
if (callType == "SP")
{
NrOfParameters = AddInputParameters(parameters, cmd, callName);
}
// Add Simple Outputs
int NrOfSimpleOutputs = AddSimpleOutputs(callType, simpleOutputs, simpleOutputTextSize, cmd, callName, ref SimpleOutputRec, ref SORecBaseStruct, ref SORecValueStruct, ref SORecFields);
// Add Cursor Output
if (outputList != null)
if (!String.IsNullOrEmpty(cursorName))
ClOracle.addOutputParameter(cmd, cursorName, OracleDbType.RefCursor);
else
ClOracle.addOutputParameter(cmd, "a_cursor", OracleDbType.RefCursor);
if (callType == "FUN")
// Execute Command
if (cn != null) { cn.Open(); }
// According to the specified output, perform a different execution method
dReader = cmd.ExecuteReader();
cmd.ExecuteNonQuery();
// Retrieve Simple Outputs
RetrieveOutputs(simpleOutputs, 0, cmd, SimpleOutputRec, SORecBaseStruct, SORecValueStruct, SORecFields);
RetrieveOutputs(simpleOutputs, NrOfParameters, cmd, SimpleOutputRec, SORecBaseStruct, SORecValueStruct, SORecFields);
You should use the ExecuteFunction for functions instead of ExecuteSP (this one is used for StoredProcedure).
Regards.