This works, of course.  However, if there are a lot of columns involved, this can get tedious.

I've had good luck with doing this:

1.Unload the database schema to some other directory. For example:
R>connect MYdbase
R>output C:\Temp\Mydbase.sch
R>unload schema
R>output screen

2. Then unload the database data to the same "other" directory:
R>output C:\Temp\Mydbase.dat
R>unload data
R>output screen

3. Use a text editor to edit c:\Temp\Mydbase.sch.
If the file is smaller than 30K, you can use RBedit.  When it is larger than that, I pull the file up in WordPerfect as an ASCII file.
Using "Search and Replace" I search for the code that defines the column I want to redefine along with its definition:
For example to redefine a column entitled "Roster" from Text 40 to Text 50:
Search:
 `Roster` TEXT    (40)
Replace:
 `Roster` TEXT    (50)

4. Then (if you are using a word processing program to do this), be sure to save the file as an ASCII file and exit.

5. When you return to R:base, switch to the directory that has the Mydbase.sch and Mydbase.dat files:
R> cd C:\Temp
R> disconnect
R> input Mydbase.sch
(this recreates the schema for the database)
R>input MyDBase.dat
(this input the data)

Then you can copy the fixed version of the database back to its original directory.

-- Lou

"David M. Blocker" wrote:

CHeryl

Lets say you want to redefine MyCol TEXT 6 to MyCol TEXT 12

Lets say it appears in tables DAVID and CHERYL

Let's say it appears in the computed column MyCompCol in both tables as
MyCompCol=(MyCol&LastName) TEXT 20

Here are the steps:

AUTOCHK the database and back it up

-- Remove computed column definition temporarily in
--CHERYL
ALTER TABLE CHERYL ALTER COLUMN MyCompCol TO MyCompCol TEXT 20

--Temp rename MyCol to MyCol1 and change size in
--CHERYL
ALTER TABLE CHERYL ALTER COLUMN MyCol TO MyCol1 TEXT 12

-- Remove computed column definition temporarily in
--DAVID
ALTER TABLE DAVID ALTER COLUMN MyCompCol TO MyCompCol TEXT 20

--Do the permanent redefine in DAVID
ALTER TABLE DAVID ALTER COLUMN MyCol TO MyCol TEXT 12

-- Put back computed col definition in DAVID
ALTER TABLE DAVID ALTER COLUMN MyCompCol to MyCompCol=(MyCol&LastName) TEXT
20

--Rename back to original name in CHERYL
ALTER TABLE CHERYL ALTER COLUMN MyCol1 TO MyCol TEXT 12

--Put back computed col definition in CHERYL
ALTER TABLE CHERYL ALTER COLUMN MyCompCol to MyCompCol=(MyCol&LastName) TEXT
20

Now you'll need to PACK the database, check it again and back it up.

David Blocker

----- Original Message -----
From: "McClure, Cheryl" <[EMAIL PROTECTED]>
To: "RBASE-L Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, July 16, 2003 12:51 PM
Subject: [RBASE-L] - Redefining column when column exists in multiple tables

> Running current Windows 6.5 version of R:BASE:  I need to change a text
> column in a table from 6 characters to 12 characters.  This column appears
> in more than one table and is used in a computed column.  I know there is
> some sort of round robin type method to change the column, but the details
> have slipped my mind.  Could someone refresh me please?
>
> Thanks!
>
> Cheryl McClure
> CDC
>
>

--
Louis L. Hirsh
Director of Admissions and Chair,
University Scholarship Committee
University of Delaware
116 Hullihen Hall
Newark, DE 19716
Phone: 302-831-1209
FAX:   302-831-6905
 
begin:vcard 
n:Hirsh;Louis
tel;fax:302-831-6905
tel;work:302-831-1209
x-mozilla-html:TRUE
url:www.udel.edu
org:University of Delaware;Admissions
adr:;;116 Hullihen Hall;Newark;DE;19716;
version:2.1
email;internet:[EMAIL PROTECTED]
title:Director of Admissions
fn:Louis L. Hirsh
end:vcard

Reply via email to