storing transactions

Started by Nonameover 19 years ago5 messagesgeneral
Jump to latest
#1Noname
kaspro@web.de

Hi all,
I’ve been studying the whole evening and don’t seem to find an answer:
I want to “store” transactions on the server- like view’s, or, (sorry) as in M$ SQL Server CREATE OR REPLACE TRANSACTION xyz()........
Is this possible with postgres or do I have to store all these at the client side?!

Thanks heaps,
Chris

_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066

#2Talha Khan
talha.amjad@gmail.com
In reply to: Noname (#1)
Re: storing transactions

You can save your transactions in an sql file and then run that file
whenever you need to run those transactions.

Regards
Talha Khan

Show quoted text

On 10/3/06, kaspro@web.de <kaspro@web.de> wrote:

Hi all,
I've been studying the whole evening and don't seem to find an answer:
I want to "store" transactions on the server- like view's, or, (sorry) as
in M$ SQL Server CREATE OR REPLACE TRANSACTION xyz()........
Is this possible with postgres or do I have to store all these at the
client side?!

Thanks heaps,
Chris

_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&amp;distributionid=000000000066

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

#3Ron Johnson
ron.l.johnson@cox.net
In reply to: Talha Khan (#2)
Re: storing transactions

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

In this context, what is a "transaction"?

On 10/04/06 14:32, Talha Khan wrote:

You can save your transactions in an sql file and then run that file
whenever you need to run those transactions.

Regards
Talha Khan

On 10/3/06, *kaspro@web.de <mailto:kaspro@web.de>* <kaspro@web.de
<mailto:kaspro@web.de>> wrote:

Hi all,
I've been studying the whole evening and don't seem to find an answer:
I want to "store" transactions on the server- like view's, or,
(sorry) as in M$ SQL Server CREATE OR REPLACE TRANSACTION xyz()........
Is this possible with postgres or do I have to store all these at
the client side?!

- --
Ron Johnson, Jr.
Jefferson LA USA

Is "common sense" really valid?
For example, it is "common sense" to white-power racists that
whites are superior to blacks, and that those with brown skins
are mud people.
However, that "common sense" is obviously wrong.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFJA+SS9HxQb37XmcRAgRHAKDf0wqR78o2ImFV+le9gH3ETX051ACcC25X
Y5N2tk9XweRCKSwVVMQFP1Q=
=zG8a
-----END PGP SIGNATURE-----

#4Chris Mair
chrisnospam@1006.org
In reply to: Noname (#1)
Re: storing transactions

I’ve been studying the whole evening and don’t seem to find an answer:
I want to “store” transactions on the server- like view’s, or, (sorry) as in M$ SQL Server CREATE OR REPLACE TRANSACTION xyz()........

Of course, it's possible.
What you need is
CREATE OR REPLACE FUNCTION xyz() RETURNS trigger AS ...
then
CREATE TRIGGER ... EXECUTE PROCEDURE xyz();

Look here for an example:
http://www.postgresql.org/docs/8.1/static/plpgsql-trigger.html

Bye,
Chris.

#5Noname
kaspro@web.de
In reply to: Chris Mair (#4)
Re: storing transactions

Mabye I made myself not clear enough- sorry for that...
What I want is having a statement like:

PROCEDURE MyProcedure(Value1 int, Value2 text, Value3 varchar(30))
BEGIN
---check if something is valid
---compute something
---store values I got via THIS query and put them in table A, B and C
---see wether everything is ok
COMMIT;

...which I execute from a client like: exec MyProcedure(Value1, Value2, Value3)

Sorry for beeing not exact enough...

Thanks in advance,
Chris

-----Ursprüngliche Nachricht-----
Von: Chris Mair <chrisnospam@1006.org>
Gesendet: 05.10.06 18:43:23
An: kaspro@web.de
CC: pgsql-general@postgresql.org
Betreff: Re: [GENERAL] storing transactions

I’ve been studying the whole evening and don’t seem to find an answer:
I want to “store” transactions on the server- like view’s, or, (sorry) as in M$ SQL Server CREATE OR REPLACE TRANSACTION xyz()........

Of course, it's possible.
What you need is
CREATE OR REPLACE FUNCTION xyz() RETURNS trigger AS ...
then
CREATE TRIGGER ... EXECUTE PROCEDURE xyz();

Look here for an example:
http://www.postgresql.org/docs/8.1/static/plpgsql-trigger.html

Bye,
Chris.

_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&amp;distributionid=000000000066