Page 1 of 1
how can params type be determined?
Posted: Sat 19 May 2007 15:17
by mighty
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.
Posted: Mon 21 May 2007 07:45
by Alex
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.
Posted: Tue 12 Jul 2011 08:55
by Jank
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
Posted: Tue 12 Jul 2011 09:08
by Jank
oh, I found a solution (tibcQuery.Options.DescribeParams := true) myself.
But thank you.
Jan
Posted: Tue 12 Jul 2011 10:45
by AndreyZ
It's good to see that you've found a solution. If any other questions come up, please contact us.