Re: ora6 -> ora7 problem

From: <la_at_datani.dk>
Date: 19 Jan 94 16:29:48 +0100
Message-ID: <1994Jan19.162948.125_at_datani.dk>


Hello Juergen.

>
> And now the problem:
> On Oracle V6 all things worked fine. I defined a table to store
> the names of patients.
>
> EXEC SQL CREATE TABLE patient
> ( id DECIMAL,
> firstname CHAR(50),
> secname CHAR(50),
> ...
> ...
> );
>
> When i store the name 'Smith' and i want to retrieve the name later,
> i get 'Smith' from the database back.
>
> But with Oracle V7: I get 'Smith '
> ^^^^^^^^^^^^
> 50 characters
>

In Oracle7 is CHAR-fields blank-padded, which explains all your blanks.

CHAR-fields should be converted into VARCHAR2-fields in Oracle7.

An automatic way for doing it, is to put the following line in your SQL-script, which defines your table :

SET COMPATIBILITY V6 or to convert all CHAR-fields into VARCHAR2-fields.

Lone Aalekjær

Datani A/S
A consulting Firm in Copenhagen Received on Wed Jan 19 1994 - 16:29:48 CET

Original text of this message