I was pounding away on my keyboard, modifying a particular module in a database I am working with. I had declared and opened a cursor while testing forms and procedures for "Table1".

SET STUPID USER ON
-I did not drop the cursor.
-I did not back up the database
-At the R> prompt I did ALTER TABLE Table1 ADD SortOrder INTEGER.
- got an error message
- Again, ALTER TABLE Table1 ADD SortOrder INTEGER
- got an error message again
- EDIT USING Table1_Form
- Form won't work, and tells me some columns are missing in designer.
- LIST TABLES gave me three tables named Table1
- LIST Table1 stops at column 10 which has no name, and there are no rows in Table1 - Reloaded, unloaded and loaded, no go. Still three tables with the same name, but different sys_table_IDs
- After an hour or so, figured out how to fix it.

For anyone who is as stupid as I am, when you get three tables with the same name, this worked to fix it. I had several copies of the database by now, but made another one anyway.

- Find which table is correct.
R>sele * from sys_columns where sys_table_id = 40
R>sele * from sys_columns where sys_table_id = 49
R>sele * from sys_columns where sys_table_id = 50 < correct column list
- Rename the other two copies of the table in the table designer
- List Table1 and it looks good again!
- Drop the two renamed bad copies
- Forms and Reports are pointed to one of the bad tables, so
- Rename the forms and reports, then
- Copy the forms and tables back to their original names and select the table you just fixed.
- It worked!!!!!!

I would have saved myself a lot of time by doing this first:
RELOAD DBSave

Albert the Dummy


Reply via email to