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: a problem in about CHAR column in the select statement

Re: a problem in about CHAR column in the select statement

From: C. Ferguson <c_ferguson_at_rationalconcepts.com>
Date: 2000/07/07
Message-ID: <39663EF1.DA941A03@rationalconcepts.com>#1/1

Hi,
  nothing magical about java and the results seen. If you were to issue that select statement in sqlplus, you get no rows returned which is what came back to the java program.

  I would change the table definition to varchar2(128). In general, I only use the char type to represent say a boolean (t or f) but in most cases where the string is > 1 char, I go with the varchar2.

hth,
cindy

Mark D Powell wrote:

> I do not know anything about JAVA to Oracle but it sounds like
> your table is defined with a char column. You might want to try
> redefining it to be varchar2.
>
> You may also want to check the JAVA documentation for JAVA
> datatype to Oracle conversion rules to see if changing the
> datatype will affect the comparison.
>
> In worst case you should be able to use the rtrim(col) to remove
> trailing blacks from the database column data; however using a
> function on the column will disable retriving the data via an
> index which is probably not good.
>
> If the table column is varchar2 check to see if trailing blanks,
> nulls, or newlines were stored in the column. It is possible to
> do that and you can use the ltrim function in an update
> statement to clean the data and then retest.
>
> I hope this helps until someone more knowlegable about JAVA sees
> your post.
>
> -----------------------------------------------------------
>
> Got questions? Get answers over the phone at Keen.com.
> Up to 100 minutes free!
> http://www.keen.com
Received on Fri Jul 07 2000 - 00:00:00 CDT

Original text of this message

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