Index: openacs-4/packages/ref-gifi/sql/oracle/00-gifi-sets.ctl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ref-gifi/sql/oracle/00-gifi-sets.ctl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ref-gifi/sql/oracle/00-gifi-sets.ctl 15 Nov 2005 06:04:00 -0000 1.1 @@ -0,0 +1,10 @@ +load data infile '[acs_root_dir]/packages/ref-gifi/sql/common/gifi_templates.dat' +into table gifi_templates +replace +fields terminated by "," optionally enclosed by "'" +(code,comments,title) +load data infile '[acs_root_dir]/packages/ref-gifi/sql/common/gifi_template_columns.dat' +into table gifi_template_columns +replace +fields terminated by "," optionally enclosed by "'" +(code,title,accno) Index: openacs-4/packages/ref-gifi/sql/oracle/ref-gifi-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ref-gifi/sql/oracle/ref-gifi-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ref-gifi/sql/oracle/ref-gifi-create.sql 15 Nov 2005 06:04:00 -0000 1.1 @@ -0,0 +1,73 @@ +-- packages/ref-gifi/sql/oracle/ref-gifi-create.sql +-- +-- @author torben@kappacorp.com +-- @creation-date 2005-09-27 +-- @cvs-id $Id: + +-- gifi_registry contains GIFIs available through ref-gifi package + +create table gifi_templates ( + -- gifi abbreviation or code, a reference which is used to match key in gifi_template_columns + code char(30) + constraint gifi_template_pk primary key, + + -- contains comments, description, vendor of this gifi etc. + comments varchar(4000) + not null, + + -- gifi title, should contain a two letter reference to entity/country published + title varchar(200) + not null, +); + +comment on table gifi_templates is ' + This table contains the gifis available from ref-gifi package +'; + +-- add this table into the reference repository +declare + v_id integer; +begin + v_id := acs_reference.new( + table_name => 'GIFI_TEMPLATES', + source => 'GIFI PUBLISHERS', + source_url => 'http://openacs.org/doc/current/ref-gifi', + last_update => to_date('2005-09-28','YYYY-MM-DD'), + effective_date => sysdate + ); +commit; +end; +/ + +create table gifi_template_columns ( + -- gifi abbreviation or code, a reference which is used to match key in gifi_templates + -- there should be a constraint added here that points to gifi_templates.code + code char(30), + + -- gifi title, should contain a two letter reference to entity/country published + title varchar(300) not null, + + -- accno, account number for one column/item in the gifi + accno varchar(100) not null + +); + +comment on table gifi_template_columns is ' + This table contains the gifis available from ref-gifi package +'; + +-- add this table into the reference repository +declare + v_id integer; +begin + v_id := acs_reference.new( + table_name => 'GIFI_TEMPLATE_COLUMNS', + source => 'GIFI PUBLISHERS', + source_url => 'http://openacs.org/doc/current/ref-gifi', + last_update => to_date('2005-09-28','YYYY-MM-DD'), + effective_date => sysdate + ); +commit; +end; +/ + Index: openacs-4/packages/ref-gifi/sql/oracle/ref-gifi-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ref-gifi/sql/oracle/ref-gifi-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ref-gifi/sql/oracle/ref-gifi-drop.sql 15 Nov 2005 06:04:00 -0000 1.1 @@ -0,0 +1,35 @@ +-- Drop the ACS Reference GIFI data +-- +-- @author torben@kappacorp.com +-- @cvs-id $Id: + +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. + +declare + cursor refsrc_cur is + select table_name, + package_name, + repository_id + from acs_reference_repositories + where upper(table_name) like 'GIFI%' + 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.del(rec.repository_id); + end loop; +end; +/ +show errors + +