Sorry, my response is if you wanted to be able to do this within code.  
Otherwise, yes, do what Larry said and do a simple "LIST CONSTRAINTS"

Karen

 

 

 

-----Original Message-----
From: karentellef via RBASE-L <[email protected]>
To: rbase-l <[email protected]>
Sent: Tue, Sep 27, 2016 9:33 am
Subject: Re: [RBASE-L] - How to drop a foreign key in a table using SQL



This is tricky, I always have to look it up in my notes:

SET VAR vTableID = sys_table_id from sys_tables where sys_table_name = ' ...... 
'
SET VAR vIndexName = sys_index_name from sys_indexes where sys_table_id = 
.vTableID and sys_column_name = ' .... '
ALTER TABLE <tablename> DROP CONSTRAINT &vIndexName

Karen



 

 

 

-----Original Message-----
From: Tony IJntema <[email protected]>
To: rbase-l <[email protected]>
Sent: Tue, Sep 27, 2016 9:15 am
Subject: [RBASE-L] - How to drop a foreign key in a table using SQL

Hi,

I like to remove a column from a table, which also happens to be a foreign key.
So I have ro remove the Foreign key first and then drop the column.

The proper commands are:

alter table <table> drop constraint <conname>
alter table <table> drop column <colum>

My problem is that I don't know the <conname>.
Does anybody knows how to find this conname?


Tony

-- 
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.




-- 
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to