Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: cast function, character to integer

Re: cast function, character to integer

From: Stephen D <stephen_tx_at_my-deja.com>
Date: Fri, 08 Dec 2000 18:08:23 GMT
Message-ID: <90r82h$scd$1@nnrp1.deja.com>

Niall,

Thanks for responding. Hmmm, can't get that to work. With the types of values in the field, I can use to_number(fld,99) alright--to_number (fld,9) does not work--but the data type is still a large one. Cast (fld as integer) simply doesn't work; i get the useless "missing right parenthesis" message.

What am I missing?

Stephen

In article <90q8dt$rn2$1_at_soap.pipex.net>,   "Niall Litchfield" <n-litchfield_at_audit-commission.gov.uk> wrote:
> Hi
>
> look into precision and scale for your number datatype. This should
 give you
> the datatype you want.
>
> --
> Niall Litchfield
> Oracle DBA
> Audit Commission UK
> "Stephen D" <stephen_tx_at_my-deja.com> wrote in message
> news:90pnlt$n12$1_at_nnrp1.deja.com...
> > I have a simple question. I'm new to Oracle and am trying to get a
 SQL
> > statement to convert a character field (sample
 values '01','02','03',
> > etc.) to an integer. I can use the to_number function, but the
> > datatype is larger than what I need. I'd like to convert this to a
> > tinyint or integer data type.
> >
> > When attempting cast(fld as integer) or cast(to_number(fld) as
 integer)
> > I
> > get an error message of "missing right parenthesis".
> >
> > What am I doing wrong? I'm using Oracle 7.3.4.
> >
> > TIA,
> > 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 Fri Dec 08 2000 - 12:08:23 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US