M
M
maxwolf2014-02-12 13:01:11
Oracle
maxwolf, 2014-02-12 13:01:11

Convert NUMBER to otl types: how?

When executing a SELECT in otl4 (OCI/Oracle 11 environment) and trying to get the types of the returned data via describe_select, otl describes the fields of the NUMBER type base in otl_column_desc.otl_var_dbtype as otl_var_double (in this case, the value of otl_column_desc.prec == 0 and otl_column_desc.scale == 129, the meaning of which eludes me...)
It turns out uncertainty: both fields that obviously do not have a fractional part (ID of the NUMBER type) and fields that can potentially contain a fractional part (AMOUNT of the NUMBER type) are represented as a double.
What would be the most correct, and with the least overhead, to distinguish between these two cases? Those. if I counted double v from the stream, what to write in CheckInt (v) in order for the code to work correctly

if (CheckInt(v)) 
 printf("%.0f", v);
else
 printf("%.2f, v);

PS You can also pass otl_column_desc to CheckInt(), but, as far as I understand, this will not add any sense ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
maxwolf, 2014-02-24
@maxwolf

I will answer myself: set_all_column_types / set_column_type keywords and, at the same time, for create_stored_proc_call there is an all_num2type parameter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question