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

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Conversion (VARCHAR2 and CHAR) in ORACLE 7

Re: SQL Conversion (VARCHAR2 and CHAR) in ORACLE 7

From: Brijesh <brijesh_at_enteract.com>
Date: 1997/07/08
Message-ID: <33C1407F.5160B504@enteract.com>#1/1

Hi Alvaro

With you insert statement you are inserting blank too in the final_table.

so after that try this

update final_table
set code = rtrim(code);
commit;

This will remove the blank padding from finmal table. Any new insert will not have blank padding.

Hope is helps

Bye

Alvaro Illarze wrote:

> Hi:
> I'm having a little problem here and perhaps somebody can help me.
> I'm trying to do a join between 2 tables which should have the same
>
> keys in the CODE column, but one is a CHAR column and the other is a
> VARCHAR2 (anybody knows why). Both of them are of length 5, and the
> keys are of length 4 (they are supposed to grow, so we need length 5),
>
> so in the CHAR column they have a blank-pad of one character and
> this makes the problem.
> What I'm trying to do is to change the first table CODE column to
> a VARCHAR2, but I couldn't manage to do it. I have ORACLE 7, does
> anybody
> know how can I do this?.
>
> P.S.: I tried a
> insert into final_table
> select *
> from initial_table;
>
> where:
> final_table is the table with CODE as VARCHAR2 and
> initial_table is the table with CODE as CHAR,
> to see if ORACLE made a implicit conversion, but it does not.
>
> Thanks
>
> Alvaro
>
> -------------------==== Posted via Deja News
> ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
Received on Tue Jul 08 1997 - 00:00:00 CDT

Original text of this message

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