Subject | Re: [IBO] Integer Field Manipulation |
---|---|
Author | Stephen Lee-Woolf |
Post date | 2002-06-26T09:23:09Z |
Problem solved (looks like my ignorance is showing again!). Required
query is:
select (cast(pcost as real)/100) as rcost from ...
In other words I hadn't wrapped the cast statement in ()s.
Thanks to all for the suggestions.
In article <16433170671.20020626185020@...>,
geoff@... says...
Steve Lee-Woolf
University of Salford
Manchester, U.K.
query is:
select (cast(pcost as real)/100) as rcost from ...
In other words I hadn't wrapped the cast statement in ()s.
Thanks to all for the suggestions.
In article <16433170671.20020626185020@...>,
geoff@... says...
> > "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.
>
>
>
Steve Lee-Woolf
University of Salford
Manchester, U.K.