Re: [SQL] Returning String as Integer

2006-05-07 Thread Markus Schaber
Hi, Ben, Ben K. schrieb: > I tried int8(id) but java didn't take it as Integer. (It took int8 as > something like Long.) Yes, and that's good, as PostgreSQL int8 and java long actually are the same datatype (64-bit signed two's-complement). PostgreSQL int4 and Java int are the same (32-bit), as

Re: [SQL] Returning String as Integer

2006-05-06 Thread Ben K.
My twopence. I just happened to have the same problem with iReports for a 10 digit number - it may be case specific but in my case Please, take care with your quote attributions. I've never asked such a question here and, in fact, I was answering it. The person who asked such a question was Ka

Re: [SQL] Returning String as Integer

2006-05-06 Thread Jorge Godoy
Em Sábado 06 Maio 2006 17:05, Ben K. escreveu: > Jorge Godoy <[EMAIL PROTECTED]> wrote: > > numbers. Is there any way to select a value from this column and return > > it as an integer? > > My twopence. I just happened to have the same problem with iReports for a > 10 digit number - it may be case

Re: [SQL] Returning String as Integer

2006-05-06 Thread Ben K.
Jorge Godoy <[EMAIL PROTECTED]> wrote: numbers. Is there any way to select a value from this column and return it as an integer? My twopence. I just happened to have the same problem with iReports for a 10 digit number - it may be case specific but in my case # select ... int4(id) ..

Re: [SQL] Returning String as Integer

2006-05-06 Thread Bruno Wolff III
On Fri, May 05, 2006 at 18:52:19 -0300, Jorge Godoy <[EMAIL PROTECTED]> wrote: > Em Sexta 05 Maio 2006 18:37, Kashmira Patel (kupatel) escreveu: > > Hi all, > >I have a table with a column of type 'text'. It mainly contains > > numbers. Is there any way to select a value from this column and

Re: [SQL] Returning String as Integer

2006-05-05 Thread Kashmira Patel (kupatel)
Thanks everyone :) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jorge Godoy Sent: Friday, May 05, 2006 2:52 PM To: pgsql-sql@postgresql.org Subject: Re: [SQL] Returning String as Integer Em Sexta 05 Maio 2006 18:37, Kashmira Patel (kupatel) escreveu

Re: [SQL] Returning String as Integer

2006-05-05 Thread Hogan, James F. Jr.
x * 1; return $x; -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jorge Godoy Sent: Friday, May 05, 2006 4:52 PM To: pgsql-sql@postgresql.org Subject: Re: [SQL] Returning String as Integer Em Sexta 05 Maio 2006 18:37, Kashmira Patel (kupatel) escreveu:

Re: [SQL] Returning String as Integer

2006-05-05 Thread elein
Use the to_number() function to convert text to numbers. In the manual under functions and operators. The other function like it is to_date(). --elein [EMAIL PROTECTED] On Fri, May 05, 2006 at 02:37:13PM -0700, Kashmira Patel (kupatel) wrote: > Hi all, >I have a table with a column of type '

Re: [SQL] Returning String as Integer

2006-05-05 Thread Jorge Godoy
Em Sexta 05 Maio 2006 18:37, Kashmira Patel (kupatel) escreveu: > Hi all, >I have a table with a column of type 'text'. It mainly contains > numbers. Is there any way to select a value from this column and return > it as an integer? testing=# select '123'::integer; int4 -- 123 (1 regis

[SQL] Returning String as Integer

2006-05-05 Thread Kashmira Patel \(kupatel\)
Hi all,    I have a table with a column of type 'text'. It mainly contains numbers. Is there any way to select a value from this column and return it as an integer?   Thanks, Kashmira