Re: Problems with CHARs in v7.1.6
Date: 1996/04/26
Message-ID: <31814505.1D81_at_mail.netvale.com.br>#1/1
Stuart Hemming wrote:
>
> We've just inherited a DB that has a number of tables with a structure of
> mixed CHARs and VARCHARs. We don't have access to a set of v6 binaries.
>
> What we ant to do is get all of the CHARs converted to VARCHARs. I
> thought that it would be simply a case of exporting the tables, dropping
> them and re-importing them with the instance in v6 compatibility mode.
> However, the software recognises that the export was done by a v7.1.6
> version of export and so doesn't do anything to the tables.
>
> At the moment we're faced with creating a schema from the export file,
> editing it and creating the tables that way. This in itself isn't a
> difficult job (thank god for perl!) but I'm concerned about the data. As
> I understand it each, previously CHAR, field will be read in RPAD'd with
> spaces so I'm still stuck with "fixed length" VARCHARs as it were. Does
> anyone know a painless way around this problem?
Write a *before insert for each row* trigger that will *RTRIM* the blanks of the columns.
:new.your_column := rtrim(:new.your_column);
The *imp* uses the insert sql command that will fire the trigger and get the strings fixed.
>
> TIA
>
> -------------------------------------------------------------------
> These are *my* opinions. Please don't make the mistake of believing
> anybody else is stupid enough to think like this!
> -------------------------------------------------------------------
> Stuart Hemming | shemminga_at_cix.compulink.co.uk
> The Data Base | Tel: + 44 (0) 115 925 0005
> Nottingham UK | Fax: + 44 (0) 115 929 4668
> -------------------------------------------------------------------
Fernando Nantes (nantes_at_amix.com.br) Received on Fri Apr 26 1996 - 00:00:00 CEST