Changing OraQuery.SQL.text at runtime and incorrect param DataType ftUnknown after...

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Alexys
Posts: 5
Joined: Thu 12 Jul 2007 17:49

Changing OraQuery.SQL.text at runtime and incorrect param DataType ftUnknown after...

Post by Alexys » Thu 12 Jul 2007 18:59

Then I try to change
TOraQuery.SQL.text at runtime (for execute query with stored procedure),
I can access any parameter of this procedure, it's correct.
But type of any parameter is ftUnknown, it's not correst!
However, in design-time, then I put my SQL into TOraQuery, parameter's DataType recognized correctly.
How can I get correct DataType of parameters after changing SQL at runtime?
Thanks.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 13 Jul 2007 10:59

Please specify whether the SQL property of the TOraQuery component is empty before you are changing it, or it already contains another query that has the same parameters with correct data type.

Alexys
Posts: 5
Joined: Thu 12 Jul 2007 17:49

Post by Alexys » Fri 13 Jul 2007 11:42

Please specify whether the SQL property of the TOraQuery component is empty before you are changing it, or it already contains another query that has the same parameters with correct data type.
I try with empty SQL and not-empty before changing, any case - DataType of all parameters is ftUnknown.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 16 Jul 2007 09:15

To make ODAC automatically detect data type for stored procedure parameters, you should use the TOraStoredProc component.

When you set the SQL property for the TOraQuery component, the DataType property for all parameters is set to ftUnknown. But DataType of parameters that was present in previous SQL text remains unchanged.

Please provide us a sample demonstrating the problem: value of the SQL property before and after the change, and data types of parameters before and after the SQL property has been changed.

Alexys
Posts: 5
Joined: Thu 12 Jul 2007 17:49

I understand my mistake.

Post by Alexys » Mon 16 Jul 2007 11:16

Sorry.
I understand my mistake.
I tried to use PL/SQL block with stored procedure call in TOraQuery SQL, but TOraQuery can’t retrieve DataType of parameters in this case, like TOraStoredProc (may be SELECT ... FROM ALL_ARGUMENTS WHERE ... or any other way).
However, may be it's good to add this functionality to TOraQuery with PL/SQL stored procedure call in the future.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 18 Jul 2007 11:28

We will investigate possibility to add such functionality, but that is hardly to happen in the nearest future.

Post Reply