Skip site navigation (1) Skip section navigation (2)

please help me with text cast to int ....

From: Theodore Petrosky <tedpet5(at)yahoo(dot)com>
To: postgres SQL <pgsql-sql(at)postgresql(dot)org>
Subject: please help me with text cast to int ....
Date: 2004-07-11 16:22:46
Message-ID: 20040711162246.34618.qmail@web41004.mail.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-sql
I give up.. what don't I understand about casting and
ints and text..  

i have a table jobinfo with:

acode text,
jobnumber text default
nextval('public.jobinfo_seq'::text),
jobtitle text

I have about 3000 rows starting with jobnumber = 1000.

SELECT jobnumber, jobtitle FROM jobinfo WHERE
jobnumber >= 999 ORDER BY jobnumber ASC;

The above SQL produces no rows. however...

SELECT jobnumber, jobtitle FROM jobinfo WHERE
jobnumber >= 200 ORDER BY jobnumber ASC;

produces rows with jobnumber >= 2000

if I change the query with jobnumber >= 201, I get
rows >= 2010.

it is as if there was a silent zero being appended to
the end of my int in the query. What am I missing,
please.

select version();
                                                      
  version                                             
           
-------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 7.4.2 on powerpc-apple-darwin7.3.0,
compiled by GCC gcc (GCC) 3.3 20030304 (Apple
Computer, Inc. build 1495)
(1 row)

Ted


	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

Responses

pgsql-sql by date

Next:From: Phil EndecottDate: 2004-07-11 17:01:45
Subject: Re: please help me with text cast to int ....
Previous:From: Rajesh Kumar MallahDate: 2004-07-11 06:35:10
Subject: Re: Problem in Stored Procedures

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group