Hi Phil,
since optcode exists in other tables, you will have to rename it in those 
tables first
then
You could create another column OptcodeTxt text 6
then
update BlockCodes set OptCodeTxt = (ctxt(OptCode))
then
alter table BlockCodes drop col OptCode
then
ren col OptcodeTxt to OptCode in BlockCode

Have fun,
Bernie Lis
  ----- Original Message ----- 
  From: [EMAIL PROTECTED] 
  To: RBASE-L Mailing List 
  Sent: Thursday, April 24, 2008 10:26 PM
  Subject: [RBASE-L] - Alter table in 6.5++


  We are currently on Rbase 6.5++.  I defined a table and its primary key with 
the following commands:
  CREATE TABLE blockcodes +
  (cptcode INTEGER NOT NULL,+
  blockcatcode INTEGER,+
  epidural TEXT (1) DEFAULT 'N' NOT NULL)
  ALTER TABLE blockcodes ADD PRIMARY KEY (cptcode) +
  ('cptcode already on file.', +
  'Cannot delete--value exists in another table.', +
  'Cannot update--value exists in another table.')

  I now need to redefine cptcode to a text field.  I tried the following:  
ALTER TABLE blockcodes ALTER cptcode TO cptcodet TEXT (6).  Rbase gave me the 
following error:  -ERROR- Column cptcode is indexed and may not be altered. 
(1143).  Cptcode is the primary key of the blockcodes table so I tried to 
removed it with the following:  ALTER TABLE blockcodes DROP CONSTRAINT PRIMARY 
KEY (cptcode).  This gave me the error: -ERROR- Invalid constraint identifier. 
(2743).  

  Can someone advise how I can redefine the cptcode column as text or how to 
remove the primary key from the table?

  Thanks a bunch,
  Phillip Cecil

Reply via email to