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

Re: Re[2]: Problems with varchar/text

From: ghaverla(at)freenet(dot)edmonton(dot)ab(dot)ca
To: FMK <meyer-kassel(at)online-shop-ag(dot)de>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Re[2]: Problems with varchar/text
Date: 2000-08-30 14:06:46
Message-ID: Pine.A41.3.95.1000830080134.33064C-100000@freenet.edmonton.ab.ca (view raw or flat)
Thread:
Lists: pgsql-novice
On Wed, 30 Aug 2000, FMK wrote:

> I'm using ColdFusion with a native PostgreSQL-Driver. OS is Linux, and
> my insert-statement looks like this:
> 
> INSERT INTO billing (billnumber) VALUES (00086901)
> 
> > Maybe you have forgot to quote the string.
> > Could you mail us the exact SQL that you use to insert the data.

Your answer is right there.  Most languages are going to
see your INSERT statement as:

 INSERT INTO billing (billnumber) VALUES (some_number)

If you want to insert a string, you need to quote it:

 INSERT INTO billing (billnumber) VALUES ("00086901")

I don't know if you need double quotes, single quotes or
something else.  They are quite often different (certainly
they are using the perl-postgres interface, which is what
I have some experience with).

But your interpretter is seeing a number (00086901) with leading,
insignificant zeros.  It is deleting those zeros before executing
the statement.  Just like 9.0000000000000000000000000000000000000
gets executed as 9.

Gord

Matter Realisations     http://www.materialisations.com/
Gordon Haverland, B.Sc. M.Eng. President
101  9504 182 St. NW    Edmonton, AB, CA  T5T 3A7
780/481-8019            ghaverla @ freenet.edmonton.ab.ca


In response to

Responses

pgsql-novice by date

Next:From: FMKDate: 2000-08-30 14:16:34
Subject: Re[2]: Problems with varchar/text
Previous:From: Poul L. ChristiansenDate: 2000-08-30 14:04:59
Subject: Re: Problems with varchar/text

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