drop function if exists sp_delete_article_category( p_article_category_id integer );
create or replace function sp_delete_article_category( p_article_category_id integer ) returns integer as $$
declare
	retval integer;
begin
	retval:=0;
	select count(*) into retval from article_categories where article_category_id=p_article_category_id;
	delete from article_category_langdefs where article_category_id=p_article_category_id;
	delete from article_categories where article_category_id=p_article_category_id;
	return retval;
end;
$$language plpgsql;

comment on function sp_delete_article_category( p_article_category_id integer ) is 'delete article_category';
