how can params type be determined?

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
mighty
Posts: 18
Joined: Thu 01 Jun 2006 11:35

how can params type be determined?

Post by mighty » Sat 19 May 2007 15:17

After preparing query by executing prepare method, can be get paramcount, paramnames, but not params.datatype!

There is a description in help, "DataType is set automatically when a value is assigned to the parameter.".

So how can this be done, without assigning any value to the parameter?

Kadri.

Alex
Posts: 655
Joined: Mon 08 Nov 2004 08:39

Post by Alex » Mon 21 May 2007 07:45

In the general case the query parameter type is undetermined (except stored procedure parameters).
The PARAM1 parameter has the unknown data type in queries like this: "SELECT * FROM emp WHERE empno = :PARAM1". When you set its value, the value type will determine the parameter datatype. Until this moment the parameter type is unknown.

Jank
Posts: 35
Joined: Tue 11 May 2010 11:57

Post by Jank » Tue 12 Jul 2011 08:55

Hi,

i have the same Problem. Is there a new way to determine the datatype.

If I set a value of a param the datatype is determined by the way I set the value. If I assign the value asstring, the datatype is ftstring; if I assign the value as integer it's ftInteger, whatever the datatype is in fact.
I don't know the datatype but i have to know it.
I have a merge-Statement that is dynamicly created and it has a poor Subselect with a parameter and I need to know the datatype of this param.

Jan

Jank
Posts: 35
Joined: Tue 11 May 2010 11:57

Post by Jank » Tue 12 Jul 2011 09:08

oh, I found a solution (tibcQuery.Options.DescribeParams := true) myself.
But thank you.


Jan

AndreyZ

Post by AndreyZ » Tue 12 Jul 2011 10:45

It's good to see that you've found a solution. If any other questions come up, please contact us.

Post Reply