Subject Re: [IBO] Integer Field Manipulation
Author Geoff Worboys
> "select cast(pcost as real) / 100 from .... " Fieldname: not found
> "select cast('pcost' as real) / 100 from ..." Fieldname: not found
> "select cast("pcost" as real) / 100 from ..." SQLError code - 206
> Column unknown pcost.

I just tried the following under IBO's IB_SQL utility:

SELECT CAST(EMP_NO AS DOUBLE PRECISION)/100 AS Test
FROM EMPLOYEE

and it works fine. I was surprised to see that...

SELECT CAST(EMP_NO AS REAL)/100 AS Test
FROM EMPLOYEE

also worked, since "REAL" is not actually a valid data type under
IB/FB (or SQL?). I guess it must be a hidden pseudonym provided for
compatibility reasons. I dont know if real equates to float or
double, since it is not documented (and I would suggest not
recommended).

I suggest that you look at your table definition. If you are using
dialect 3 and quoted identifiers then make sure you are using
identical character case in your names, and use " quotes in your
select.

(NB. I cannot see mention of IB/FB versions, IBO versions etc.)

I cannot think of any reason for your problem that would stem from
IBO. It may be worth checking whether there is any other problem with
the table definition. If you can reproduce the problem in a small
database you could email it to myself or Jason for further
investigation.


--
Geoff Worboys
Telesis Computing