cancel
Showing results for 
Search instead for 
Did you mean: 

Why is return value different ?

Former Member
0 Kudos

Hi, Experts

env

====

Sybase IQ 15.4

[query1]

select convert(numeric(18,1), 0.8488*100) from iq_dummy;

84.8

[query2]

select convert(numeric(18,1), 0.8488*100);

84.9


why are return values different ?

one is 84.8 the other is 84.9....??


thanks in advance...

Accepted Solutions (1)

Accepted Solutions (1)

tayeb_hadjou
Advisor
Advisor
0 Kudos

Hi,

In IQ database applications, always use "from iq_dummy" when user table is not required (case of SQL functions).

Otherwise, the query would be handled by Sql Anwyhere Engine, and then result could be different:

http://help.sap.com/saphelp_iq1610_iqrefbb/helpdata/en/a5/266adc84f210159f7ce9b53c36e5d7/frameset.ht...

So, here rely to 1st query/result. 84.8.

How IQ converts numeric (or decimal) values to a lower precision/scale?

Answer:

Rounded or Truncated Results - SAP IQ Load Management - SAP Library

"Whenever SAP Sybase IQ requires an explicit or implicit conversion from one data type to another during a query or insert, it always truncates the results."

Hope this helps.

Regards, Tayeb.

Former Member
0 Kudos

Thank you

Perfect answer.

Answers (0)