Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: cast function to integer
As I'd mentioned, I did use the to_number function, but I'd like to specify the datatype as small as possible, and the to_number function makes it larger than what I need.
In article <90vqee$t3i$1_at_news0.skynet.be>,
"Thomas Devallé" <thomas.devalle_at_skynet.be> wrote:
> Use the TO_NUMBER function.
>
> "Stephen" <stephen_tx_at_my-deja.com> wrote in message
> news:90okfg$pur$1_at_nnrp1.deja.com...
> > I have a simple question. I'm new to Oracle, and am trying to get
> > Oracle 7.3 to change a two character text field (sample value '01')
to
> > an integer or tiny integer type (the value will never be higher than
> > 99).
> >
> > How do I do this? What is the syntax for casting this field to an
> > integer type? When I use a syntax such as "Cast(fld as integer)" I
get
> > a useless error message such as "missing right parenthesis". I can
use
> > the to_number function, but the data type is too large; I want an
> > integer or tiny integer data type. When I nest the cast and
to_number
> > functions on the field, I get the same error message above.
> >
> > TIA for any insights!
> >
> > Stephen
> >
> >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Mon Dec 11 2000 - 08:39:50 CST
![]() |
![]() |