Please help re function packaging...

Поиск
Список
Период
Сортировка
От brynk
Тема Please help re function packaging...
Дата
Msg-id 20040210111811.14659.qmail@web60605.mail.yahoo.com
обсуждение исходный текст
Ответы Re: Please help re function packaging...  (Richard Huxton <dev@archonet.com>)
Re: Please help re function packaging...  (Shridhar Daithankar <shridhar@frodo.hserus.net>)
Список pgsql-general
 Anyone please help... I'm a newbie on creating
functions in postgresql.

Here is an oracle package that I'm trying to port to
postgresql:

CREATE OR REPLACE  PACKAGE BODY NewsPkg.NewsTools
AS
   PROCEDURE del_news (i_id IN VARCHAR2)
   IS
   BEGIN
      DELETE FROM tbl_news_type
            WHERE uniqueid = i_id;

      DELETE FROM tbl_news
            WHERE uniqueid = i_id;
   END del_news;

   PROCEDURE upd_newstype
   IS
      CURSOR cur_news
      IS
         SELECT   uniqueid
             FROM tbl_news_type
            WHERE mother_id IS NULL
         GROUP BY uniqueid;

      v_id   tbl_news_type.uniqueid%TYPE;
   BEGIN
      OPEN cur_news;

      LOOP
         FETCH cur_news INTO v_id;
         upd_mothernews (v_id);
         COMMIT;
      END LOOP;

      CLOSE cur_news;
   END upd_newstype;
END NewsTools;

Can anyone help me on how this oracle package would
look like in postgresql... I would really appreciate
it if someone could show me even the synopsis of this
code in postgresql. I've been trying all sorts of ways
to come up with the code in postgresql but when I this
command:
    select NewsTools.del_news('20040111DN001869');
I get this error:
    ERROR:  Namespace "NewsTools" does not exist

Tnx,
Darius

__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

В списке pgsql-general по дате отправления:

Предыдущее
От: Jean-Michel POURE
Дата:
Сообщение: Re: I want to use postresql for this app, but...
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Please help re function packaging...