Index: openacs-4/packages/ref-currency/sql/oracle/ref-currency-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ref-currency/sql/oracle/ref-currency-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ref-currency/sql/oracle/ref-currency-drop.sql 27 Aug 2001 22:03:38 -0000 1.1 @@ -0,0 +1,35 @@ +-- Drop the ACS Reference Currency data +-- +-- @author jon@jongriffin.com +-- @cvs-id $Id: ref-currency-drop.sql,v 1.1 2001/08/27 22:03:38 jong Exp $ + +set serveroutput on + +-- drop all associated tables and packages +-- I am not sure this is a good idea since we have no way to register +-- if any other packages are using this data. + +-- This will probably fail if their is a child table using this. +-- I can probably make this cleaner also, but ... no time today + +declare + cursor refsrc_cur is + select table_name, + package_name, + repository_id + from acs_reference_repositories + where upper(table_name) = 'CURRENC' + order by repository_id desc; +begin + for rec in refsrc_cur loop + dbms_output.put_line('Dropping ' || rec.table_name); + execute immediate 'drop table ' || rec.table_name; + if rec.package_name is not null then + execute immediate 'drop package ' || rec.package_name; + end if; + acs_reference.delete(rec.repository_id); + end loop; +end; +/ +show errors +