Please help re function packaging... - Mailing list pgsql-hackers

From Darius
Subject Please help re function packaging...
Date
Msg-id 40274B9C.1020709@netscape.net
Whole thread Raw
List pgsql-hackers
Anyone please help... I'm a newbie on creating functions in postgresql.<br /><br /> Here is an oracle package that I'm
tryingto port to postgresql:<br /><br /><small>CREATE OR REPLACE  PACKAGE BODY NewsPkg.NewsTools <br /> AS<br />   
PROCEDUREdel_news (i_id IN VARCHAR2)<br />    IS<br />    BEGIN<br />       DELETE FROM tbl_news_type<br />            
WHEREuniqueid = i_id;<br /><br />       DELETE FROM tbl_news<br />             WHERE uniqueid = i_id;<br />    END
del_news;<br/><br />    PROCEDURE upd_newstype<br />    IS<br />       CURSOR cur_news<br />       IS<br />         
SELECT  uniqueid<br />              FROM tbl_news_type<br />             WHERE mother_id IS NULL<br />          GROUP
BYuniqueid;<br /><br />       v_id   tbl_news_type.uniqueid%TYPE;<br />    BEGIN<br />       OPEN cur_news;<br /><br />
     LOOP<br />          FETCH cur_news INTO v_id;<br />          upd_mothernews (v_id);<br />          COMMIT;<br />
     END LOOP;<br /><br />       CLOSE cur_news;<br />    END upd_newstype;<br /> END NewsTools;</small><br /><br />
Cananyone help me on how this oracle package would look like in postgresql... I would really appreciate it if someone
couldshow me even the synopsis of this code in postgresql. I've been trying all sorts of ways to come up with the code
inpostgresql but when I this command:<br />     select NewsTools.del_news('20040111DN001869');<br /> I get this
error:<br/>     ERROR:  Namespace "NewsTools" does not exist<br /><br /> Tnx,<br /> Darius<br /> 

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Proposed Query Planner TODO items
Next
From: Rod Taylor
Date:
Subject: Re: Renaming tables to other schemas