Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > string loses last (escaped) character in oracle db

Reply
Thread Tools

string loses last (escaped) character in oracle db

 
 
tamer kavlak
Guest
Posts: n/a
 
      10-14-2004
hallo

I'm storing a string message into a varchar2(4000) column in oracle
db. the message is a concatination of multiple "small" strings with
"\u0001" as a delimiter. that delimiter is also the very last
character in the builded message, e.g.

"somertext" + "\u0001" + "somethingelse" + "\u0001" + ... + "\u0001"

when I read back the contetn from the db, the very last delimiter is
gone !

"somertext" + "\u0001" + "smethingelse" + "\u0001" + ...

can anybody give me a hint on that problem.

of course I can do a check and add the delimiter, but I would like to
understand the problem.

wI use pl/sql store procedure to pass in the values and also for
reading.

thx

tamer
 
Reply With Quote
 
 
 
 
Chris Smith
Guest
Posts: n/a
 
      10-14-2004
tamer kavlak wrote:
> I'm storing a string message into a varchar2(4000) column in oracle
> db. the message is a concatination of multiple "small" strings with
> "\u0001" as a delimiter. that delimiter is also the very last
> character in the builded message, e.g.
>
> "somertext" + "\u0001" + "somethingelse" + "\u0001" + ... + "\u0001"
>
> when I read back the contetn from the db, the very last delimiter is
> gone !


Just a guess. If this is a CHAR column, then the driver may be trying
to strip excess whitespace surrounding the String. A control character
is often treated as whitespace (and in particular, if the driver uses
String.trim() to do this, then that will remove the trailing
whitespace). The fact that Oracle adds whitespace to the end of a CHAR
column is a fundamental limitation that you'll need to work around,
perhaps by adding a special character at the end, or using VARCHAR
instead.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
Reply With Quote
 
 
 
 
steve
Guest
Posts: n/a
 
      10-18-2004
On Fri, 15 Oct 2004 00:51:47 +0800, tamer kavlak wrote
(in article <(E-Mail Removed)>) :

> hallo
>
> I'm storing a string message into a varchar2(4000) column in oracle
> db. the message is a concatination of multiple "small" strings with
> "\u0001" as a delimiter. that delimiter is also the very last
> character in the builded message, e.g.
>
> "somertext" + "\u0001" + "somethingelse" + "\u0001" + ... + "\u0001"
>
> when I read back the contetn from the db, the very last delimiter is
> gone !
>
> "somertext" + "\u0001" + "smethingelse" + "\u0001" + ...
>
> can anybody give me a hint on that problem.
>
> of course I can do a check and add the delimiter, but I would like to
> understand the problem.
>
> wI use pl/sql store procedure to pass in the values and also for
> reading.
>
> thx
>
> tamer


give us the sql/ java you are using to do the actual storing of the string,
the above tells us nothing.


steve

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert string with control character in caret notation to realcontrol character string. Bart Vandewoestyne C Programming 8 09-25-2012 12:41 PM
How to replace the last (and only last) character in a string? Johny Python 8 05-03-2007 09:24 PM
remove the last character or the newline character? Daniel Mark Python 6 09-28-2006 02:40 PM
8 bit character string to 16 bit character string Brand Bogard C Programming 8 05-28-2006 05:05 PM
install_driver(Oracle) failed: Can't load 'C:/Perl/site/lib/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle: load_file:The specified procedure could not be found at C:/Perl/lib/DynaLoader.pm line 230. Feyruz Perl Misc 4 10-14-2005 06:47 PM



Advertisments