-- Classified Ads Package
--
-- @author Deds Castillo (deds@infiniteinfo.com)
-- @creation-date 2002-10-08
-- @cvs-id $Id: ads-package-drop.sql,v 1.2 2003/07/27 00:46:16 rmello Exp $
--

create function inline_0 () returns integer as '
declare
    v_rec       record;
begin

	-- delete all ads

	FOR v_rec IN SELECT ad_id FROM cr_ca_ads LOOP
		SELET ca_ad__delete(v_rec.ad_id);
		SELECT select content_item__delete(v_rec.ad_id);
	END LOOP;

	return 0;
end;
' language 'plpgsql';

SELECT inline_0();
DROP FUNCTION inline_0();
drop function ca_ad__delete (integer);
