Re: Issues while storing a long dash in oracle

From: Thomas Kellerer <YQDHXVLMUBXG_at_spammotel.com>
Date: Tue, 11 Mar 2008 09:35:48 +0100
Message-ID: <63muj4F27qdlqU1@mid.individual.net>


Sandy80, 11.03.2008 09:24:
> But my problem is that even if that character is processed and stored
> correctly in the database it would still be stored as a 2 byte
> character. In that case how do I make the following command, which
> works on the basis of no. of bytes, work correctly:
>
> nvl(rpad(UPPER(substr(nvl( substr(column1,1,instr(column1,'(')-1),column1),
> 1,24)),24),' ')
>
>
>

I don't see why the statement shouldn't work. substr and instr work on *characters* not bytes:

http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/functions162.htm#i87066 "SUBSTR calculates lengths using characters as defined by the input character set"

http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/functions068.htm#i77598 "INSTR calculates strings using characters as defined by the input character set"

So why do you think your statement doesn't work?

Thomas Received on Tue Mar 11 2008 - 03:35:48 CDT

Original text of this message