Index: openacs-4/packages/static-portlet/sql/postgresql/static-portlet-portlet-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/sql/postgresql/static-portlet-portlet-drop.sql,v diff -u -N -r1.2 -r1.2.22.1 --- openacs-4/packages/static-portlet/sql/postgresql/static-portlet-portlet-drop.sql 9 Aug 2002 18:39:33 -0000 1.2 +++ openacs-4/packages/static-portlet/sql/postgresql/static-portlet-portlet-drop.sql 19 Aug 2014 17:11:31 -0000 1.2.22.1 @@ -34,18 +34,24 @@ -create function inline_1() -returns integer as ' -declare + + +-- +-- procedure inline_1/0 +-- +CREATE OR REPLACE FUNCTION inline_1( + +) RETURNS integer AS $$ +DECLARE ds_id portal_datasources.datasource_id%TYPE; -begin +BEGIN select datasource_id into ds_id from portal_datasources - where name = ''static_portlet''; + where name = 'static_portlet'; if not found then - RAISE EXCEPTION '' No datasource id found '', ds_id; + RAISE EXCEPTION ' No datasource id found ', ds_id; ds_id := null; end if; @@ -55,62 +61,63 @@ -- drop the hooks perform acs_sc_impl_alias__delete ( - ''portal_datasource'', - ''static_portlet'', - ''GetMyName'' + 'portal_datasource', + 'static_portlet', + 'GetMyName' ); perform acs_sc_impl_alias__delete ( - ''portal_datasource'', - ''static_portlet'', - ''GetPrettyName'' + 'portal_datasource', + 'static_portlet', + 'GetPrettyName' ); perform acs_sc_impl_alias__delete ( - ''portal_datasource'', - ''static_portlet'', - ''Link'' + 'portal_datasource', + 'static_portlet', + 'Link' ); perform acs_sc_impl_alias__delete ( - ''portal_datasource'', - ''static_portlet'', - ''AddSelfToPage'' + 'portal_datasource', + 'static_portlet', + 'AddSelfToPage' ); perform acs_sc_impl_alias__delete ( - ''portal_datasource'', - ''static_portlet'', - ''Show'' + 'portal_datasource', + 'static_portlet', + 'Show' ); perform acs_sc_impl_alias__delete ( - ''portal_datasource'', - ''static_portlet'', - ''Edit'' + 'portal_datasource', + 'static_portlet', + 'Edit' ); perform acs_sc_impl_alias__delete ( - ''portal_datasource'', - ''static_portlet'', - ''RemoveSelfFromPage'' + 'portal_datasource', + 'static_portlet', + 'RemoveSelfFromPage' ); -- Drop the binding perform acs_sc_binding__delete ( - ''portal_datasource'', - ''static_portlet'' + 'portal_datasource', + 'static_portlet' ); -- drop the impl perform acs_sc_impl__delete ( - ''portal_datasource'', - ''static_portlet'' + 'portal_datasource', + 'static_portlet' ); return 0; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql; select inline_1(); drop function inline_1();