473,587 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Please help re function packaging...

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.NewsToo ls
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.u niqueid%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_n ews('20040111DN 001869');
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

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 22 '05 #1
2 1653
On Tuesday 10 February 2004 11:18, brynk wrote:
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.NewsToo ls
We don't have packages.
PROCEDURE del_news (i_id IN VARCHAR2)
These will be functions rather than procedures.
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
Post one of your functions with the Oracle equivalent and someone will be able
to point out any problems.
but when I this
command:
select NewsTools.del_n ews('20040111DN 001869');
I get this error:
ERROR: Namespace "NewsTools" does not exist


And does the namespace (i.e. schema) NewsTools exist?

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 22 '05 #2
On Tuesday 10 February 2004 16:48, brynk wrote:
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.NewsToo ls
AS
Postgresql does not have packages. However you can create the schema which
contains only functions as a satisfactory replacement of packages.

Of course some 'minor' details such as package level variables could still be
a problem..:-)

So you have to replace this create package statement with a create schema
statement.
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_n ews('20040111DN 001869');
I get this error:
ERROR: Namespace "NewsTools" does not exist


Postgresql is interpreting it as a schema access. If you define schema as I
have suggested above, it should not be a problem..

HTH

Shridhar

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postg resql.org so that your
message can get through to the mailing list cleanly

Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3127
by: Barry Edmund Wright | last post by:
Problem when using Xp Packaging Wizard and the database being able to find the Application Icon after database is deployed. Under Menu/Tools/Startup form I have: Application Icon: c:\vms\handshak.ico Unfortunately, when I use the Xp Packaging Wizard the default folder it uses to install the database vms.mdb is c:\program files\vms. Therefore when the database is started it can't find the handshak.ico in the directory c:\vms because it...
1
1884
by: Coy Howe | last post by:
This one seems bizarre! We have a database consisting of a main table and 12 - 15 "sub" tables, which are connected via cascading relationships. The database performs many complex calculations and displays the results in both forms and reports. In the process of developing the database we "entered" 12 sample clients. Before packaging the database we remove the sample clients by deleting them from the main table, which cascades the...
3
2530
by: Paul Aspinall | last post by:
Hi I want to package my C# winforms app, to be deployed with MSDE, as easily as possible for the end user. I want to create an MSI or Installshield (prefer MSI), to setup my C# app, together with MSDE (if not already installed), and the MSDE application DB. How can I detect if MSDE is already installed?? Has anyone does this?? How??
3
1661
by: VJ | last post by:
I have a MSI that installs some Add-ins for office applications. This package was generated by the Add-in project Wizard. How do I include this project as part of the package I build for my application. I am using VS.NET packaging Thanks VJ
2
1704
by: Jozef | last post by:
It's possible I might have found the problem of my previous post, but I'm really not sure. My XP Packaging wizard is adding COMCAT.DLL version 4.71. My development machine uses version 5.0 and the target machine uses version 5.0 as well. I'm not sure where the Packaging Wizard is getting this DLL, but does anyone know how I specify which version to use? Thanks!
0
5193
by: blkwebman | last post by:
I'm trying to create a "standalone" install package (without any of the dialog boxes that a standard setup package would have). I think I understand how to do it in VB6 (using PDCmdLn.exe); I have already researched this subject in the MSDN for VB6. Here is the problem: I'm trying to execute a batch file containing this command and I'm running into a couple of errors. Here is the contents of the batch file: ...
15
2939
by: John Nagle | last post by:
I've been installing Python and its supporting packages on a dedicated server with Fedora Core 6 for about a day now. This is a standard dedicated rackmount server in a colocation facility, controlled via Plesk control panel, and turned over to me with Fedora Core 6 in an empty state. This is the standard way you get a server in a colo today. Bringing Python up in this completely clean environment is a huge hassle, and it doesn't...
4
2426
by: Mr Seth T | last post by:
Hey, I have spent several days trying to find out how to do something, and i don't know if I am blind or what, but I can not find it. I am developing a web app and I need it to run an activex control. I have developed the control and it runs great on my development system (VS2005, C#, IE6, Win2000Pro, output is a DLL) because as far as I can tell, the IDE registers the DLL. The problem is packaging it so it registers itself on any...
5
1640
by: Paul Rubin | last post by:
I've been through this kind of thing a few times in the past and received excellent advice here on clpy about how to deal with specific technical aspects (e.g. how to use setuptools, InnoSetup, etc). I'm now wondering where this type of thing is best addressed in more general terms. What I usually see happening, in projects I've worked on and in others, is that developers get the code working on their own computers, using source control...
0
7924
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7854
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8221
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6629
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5395
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3845
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.