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

Home -> Community -> Usenet -> c.d.o.server -> Re: VARCHAR2 and trailing spaces - what's going on!

Re: VARCHAR2 and trailing spaces - what's going on!

From: Anton Buijs <aammbuijs_at_xs4all.nl>
Date: Mon, 30 Sep 2002 18:08:39 +0200
Message-ID: <an9sul$hgm$1@news1.xs4all.nl>


Hello Nigel,

I know that Oracle Forms strips off typed in trailing blanks from a varchar2 field before it sends the data to the database. Maybe other tools do this too. Sql*Plus is not, that's for sure. It's intended behaviour of the tool, not the database.
Maybe the documentation you read about stripping of spaces should be placed in this context?

Anton

dnh <nigel.hurst_at_food.ds-s.com> schreef in berichtnieuws 3d983d0e.12979312_at_139.121.16.43...
| On Mon, 30 Sep 2002 10:42:35 GMT, Kenneth Koenraadt wrote:
|
| Hi Kenneth, Richard
|
| I know what it does and, in a way, why; but I'm sure I've read in many
| places that varchar2s strip off spaces - am I imagining that detail or
| is some documentation in error???
|
| nigel
|
| >Hi Nigel,
| >
| >You have already discovered the fact - it does not strip trailing
| >spaces when inserting. Better trust your own eyes.
| >
| >a) Inserting 'Hello world ' into a varchar2(100) takes up 16
| >chars. That's good, because sometimes you reallly need to store
| >trailing blanks.
| >
| >b) Inserting 'hello world' into a varchar2(100) will take up 11 chars.
| >Whereas inserting 'hello world' into char(100) will take up 100 chars
| >= 11 chars + 89 trailing blanks. In this sense, varchar2(n) "strips"
| >trailing blanks in opposition to char(n). But that is not to be
| >confused with a)
| >
| >
| >- Kenneth Koenraadt
| >
| >
| >
| >
| >
| >
| >On Mon, 30 Sep 2002 10:05:31 GMT, nigel.hurst_at_food.ds-s.com (dnh)
| >wrote:
| >
| >>Now then
| >>
| >>I have always thought that when you insert a string into a varchar2
| >>column any trailing spaces would be stripped off but am discovering
| >>that this is not so.
| >>
| >>being a child of the net I then did a quick search to find both
| >>situations described as true - it does strip trailing spaces and it
| >>doesn't !!!!!!
| >>
| >>I'm so confused and , well, confused - what is the truth, somebody
| >>help.
| >>
| >>cheers
| >> nigel
| >>-------------------------------------------------
| >>Take out food to reply to nigel.hurst_at_food.ds-s.com
| >>-------------------------------------------------
| >
|
| -------------------------------------------------
| Take out food to reply to nigel.hurst_at_food.ds-s.com
| -------------------------------------------------
Received on Mon Sep 30 2002 - 11:08:39 CDT

Original text of this message

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