At 02:50 PM 1/23/2012, jan johansen wrote:

It's been a while.

I need to update a number of columns in several tables from REAL to DOUBLE.
Of course I would like this to go as smooth as possible so I hope several
forms and reports don't blow up.
And these columns share the same names across tables.

Any suggestions before I write my change file?


Jan,

Here's how:

Using R:BASE eXtreme 9.1/9.5 - 64 (of course!) ...

01. CONNECT dbname
    SET NULL -0-
    -- check to make sure that IDQUOTES settings are not set to blank
    -- SHOW CHAR at the R> prompt will reveal the database character settings
    -- SET IDQUOTES=` if set to blank

02. OUTPUT dbname.str
    UNLOAD STRUCTURE
    OUTPUT SCREEN

03. OUTPUT dbname.dat
    UNLOAD DATA
    OUTPUT SCREEN

04. DISCONNECT

05. RENAME dbname.rx? dbname_backup.rx?

06. RBEDIT dbname.str to manually edit the database structure file

    SEARCH and REPLACE all REAL instances to DOUBLE

    Shift F7
    Text to Find: REAL
    Replace With: DOUBLE
    [x] Prompt on Replace
    (x) Scope - Global
    (x) Origin - Entire Scope
    Click on [Replace All] button to continue

    Carefully watch and replace every instance accordingly.

    Save the file.

07. RUN dbname.str or TRACE dbname.str

This will create a fresh database schema with every column converted from REAL to DOUBLE.

08. SET FEEDBACK ON
    RUN dbname.dat

    Watch the data being loaded ...

    SET FEEDBACK OFF

09. All Form "DB Edit" and Report "DB Label" controls should represent the data type accordingly.

That's all there is to it!

Very Best R:egards,

Razzak.

www.rbase.com
www.Razzak.com
www.RazzakMemon.com


Reply via email to