[Oracle connector] Errors & Problems

[Oracle connector] Errors & Problems

  
Forge Component
(12)
Published on 2013-04-01 by Francisco Menezes
12 votes
Published on 2013-04-01 by Francisco Menezes
Hi,

I´m trying to use this component and now i´m receiving this error every time 

Unable to cast object of type 'ss*******.RC*******DTORecord' to type 'OutSystems.HubEdition.RuntimePlatform.Db.RecordList'.

I´m not sure if "Simple Output" must be Record List or i can use an Record to get the output from Procedure.

Can anyone give me some enlightment? :)

Best Reards and thanks in advance,
César Mateus
 

Hi Cesar,

Simple Output is a record list that will be populated by a single entry with the outputs of a function.
It should be passed as a reference (using ToObject()) and the record type should be a structure whose attributes have the exact name and types as the Oracle function output parameters.

Francisco
How the treatment about CLOB in oracle if return in SimpleOutput Text(30000)?
I receive a large data from Oracle Database and always receive an Oracle error about the exceeded Length in Text DataType. How can resolve this? Need receive in output a large data like OracleDataType CLOB.

Example (Ilustrate)
OracleParameter par = new OracleParameter();
par.ParameterName = "p_msg_retorno";
par.OracleType = OracleType.Clob;
par.Direction = ParameterDirection.Output;

Francisco,

Thanks everything works fine. The problem now is in SimpleOutput. Need load the object a large data from CLOB type in our OracleDatabase. Other issue that i posted.

Thanks again and best regards

Francisco Menezes wrote:
Hi Cesar,

Simple Output is a record list that will be populated by a single entry with the outputs of a function.
It should be passed as a reference (using ToObject()) and the record type should be a structure whose attributes have the exact name and types as the Oracle function output parameters.

Francisco
 
 
In a part of SimpleOutput in the source of Extension we have a 2048 hardcoded. How can i make this dynamic?

ClOracle.addOutputParameter(cmd,
                                                         Field.Name.Substring(2),
                                                         convertToOracleType(Field.GetValue(SORecValueStruct).GetType()),
                                                         //2048, // Make size dynamic
                                                         80000,
                                                         CallType);
Hi,

Im trying to use this Extension to run a fuction, but the Extension gives me this error:

Connector unsupported type : ST(nameofstructure)Structure
and
Unable to cast object of type 'ssTestPT.STStructureOutStructure' to type 'OutSystems.HubEdition.RuntimePlatform.Db.RecordList'.

Can anyone help me or attach an exemple?

Regards,
vfa

Vfa,

Params IN your Structure, params converted with toobject() need to be exactly what your function have.
Example:

























If you have any doubt just ask, dude


F vaz

Look this eSpace that i created eSpaceTeste_v4. Try to figure out how the mecanism works. If you have any doubt just contact ok?

?Best Regards
César,

Thanks, ill test it now.
I give you a feedback asap.

Regards,
Vfa
That´s great you solve the problem! Best Regards :)
Hi again,

I was try the Extension again, now on "SP", i try with "FUN" but i get the same error..

I send a word doc as ATTACH with the process and error.

Best Regards,
FVAZ
Hi fvaz,

I think that your problem is in the output, you need to make a toobject() from a Record List not a Record.
Thanks Nuno,

I change "RLIn.Input" to "RLIN" and still the same error..

Regards,
FVAZ
The input is a Record, the output it's a RecordList.
Nuno Rolo wrote:
The input is a Record, the output it's a RecordList.
That's what i have "RLIn.Input" and "RLOut"
 
Ok, only now i saw that your SP returns a number, sou the output can't be like you defined.
The way you defined your SP should have an OUT parameter named O_ERROR_MSG. Something like this:
PROCEDURE procName(I_DATA_VALOR          IN DATE,I_CODIGO          IN NUMBER  ,I_NUMERO        IN VARCHAR2,I_CODIGO2        IN NUMBER,I_CODIGO_TRABALHO IN VARCHAR2,I_CODIGO3        IN VARCHAR2,I_NATUREZA            IN VARCHAR2,I_VALOR      IN NUMBER,I_COT     IN NUMBER,I_OBSERVACOES        IN VARCHAR2  ,I_REF_EXT  IN VARCHAR2,I_ CONTRA IN VARCHAR2,I_REF IN VARCHAR2, O_ERROR_MSG OUT VARCHAR2)
Hmm, so i only put In Parameters and leave simpleOuts and outputlist empty?

I set only the Parameters.. same error:(
Sorry for the late answer.

No, you have two approachs.
1-> Change the SP signature to have the output parameter instead of the return, like my previous post;
2-> If you can't change the SP, you have to change the name of the atribute of youre structure to be RETURN_VALUE;

fvaz wrote:
Hmm, so i only put In Parameters and leave simpleOuts and outputlist empty?

I set only the Parameters.. same error:(
 
fvaz ... I updated the eSpace just for your view.


Hi Francisco,

I am trying to run an Oracle SP which returns a resultset of a few rows, each containing a number of fields and I can not find a way to map the SPOut parameters to a datatype to successfully read them. Can you please advise?

A sample Sp looks like this
create or replace procedure ANTONIS (InText IN VARCHAR2,dataset OUT SYS_REFCURSOR ) 
IS
strSqlText varchar2(500);
begin
strSqlText := 'Select ''Text1'',''Text2'' from dual union Select ''Text3'',''Text4'' from dual';
OPEN dataset for strSqlText;
end;

Regards,
Antonis-

Hi,

I have an input as number. How to handle that in this extension?

Furthermore. I have functions that simply return a value, so no OUT parameters.
how to grab those?

replying to myself, but this is this case:

When binding by position (default) to a function, ODP.NET expects the return value to be bound first, before any other parameters.
same question as in P9.

how to call a stored procedure with parameters which can be null as well?

thanks in advance
me again,

I noticed that you convert empty string, zeroes to nulls, but the date you are not converting to null?
Why is that?

Hi,
 
I have a function with 3 input parameters, one output parameter and a return value:
FUNCTION    FUN1   ( P_IN1   IN  NVARCHAR2, P_IN2   IN  NVARCHAR2, P_OUT   OUT  NUMBER,   P_IN3 IN   NVARCHAR2)
RETURN NUMBER IS
 
In ExecuteFunction, I'm using a record passed as reference (using ToObject()) for the input structure (with attributes P_IN1, P_IN2 and P_IN3) and a record list for the output structure (I tried only with one attribute P_OUT and with 2 attributes: P_OUT and RETURN_VALUE). I cannot get the correct results from the function...
 
Note: I can't change the function.
 
Can anyone help me and tell me the correct way to use Oracle Connector for this particular case?
 
Thank you.

 

Hi,

Its just a guess, but i think that you can only have out parameters or a return value, can't have both in the same action.

When you used just one attribute (p_out) you get the correct value? If so you have to create to actions in OS, one to get the p_out and other to get the RETURN_VALUE.

But like i said in the begin it's just a guess, since always use out or return never the two.
Nuno Rolo wrote:
Hi,

Its just a guess, but i think that you can only have out parameters or a return value, can't have both in the same action.

When you used just one attribute (p_out) you get the correct value? If so you have to create to actions in OS, one to get the p_out and other to get the RETURN_VALUE.

But like i said in the begin it's just a guess, since always use out or return never the two.
 Thanks Nuno. 

If I use just one attribute (p_out or RETURN_VALUE) on the output structure I get an error: 
PLS-00306: wrong number or types of arguments

With p_Out and RETURN_VALUE I get an error:

PLS-00103: Encountered the symbol "=" when expecting one of the following:
   . ( * @ % & = - + ; < / > at in is mod remainder not rem
   <an exponent (**)> <> or != or ~= >= <= <> and or like like2
   like4 likec between || indicator multiset member submultiset
PLS-00103: Encountered the symbol "END" when expecting one of the following:
  begin function pragma procedure subtype type <an identifier>
   <a double-quoted delimited-identifier> current cursor delete
   exists prior
 
Using a function only with return value (and no output parameters) it works. 
did you make sure the RETURN_VALUE is the first parameter?