Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help! Problem with string comparisons
Because of the way char and varchar2 handle 'padding' an equate is difficult...
You could concatenate enough blanks to the varname so that is matches exactly
the full length of the field and try that....or declare Varname to be
Varchar2...
"Pilsbury" <Pilsbury_at_hotmail.com> wrote:
>Hi,
>
>I am trying to programatically select a row from a table using string
>comparisons.
>
>The column in the table is declared as NOT NULL VARCHAR2(9).
>
>I am selecting a field from a Forms 4.5 module, which is a char (9) (and
>has in fact been selected from the same table).
>
>I assign the value of that field to a variable, Varname CHAR(9);
>When I do the Select * from table where column = varname, it returns 11k
>rows instead of 1.
>
>Normally I combat this using rpad and rtrim, thought this is not working.
>If anyone has any ideas, please help! Many thanks,
>
>Nick
>
>Pilsbury_at_hotmail.com
To reply please remove the 'nospam' part of the address Received on Wed Jan 20 1999 - 12:54:26 CST