help with a procedure

From: Carlos Carcamo <eazyduiz(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: help with a procedure
Date: 2014-06-05 15:32:22
Message-ID: CADpTsTa4d7BO3+RnmuQPtxAS_KdxKveJohyDxJEnwaeSEZptsw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi everyone, I wonder if you could help me with a procedure that I would
like to perform in postgresql.

I have an insert query like this:

INSERT INTO products (product_id, description, price, qty, ...) values
('01', 'some description', 10.15, 5, ...)

then if there is no problem, perform another query like:

INSERT INTO store(store_id, description, price, qty, ...) values ('02',
'some description', 10.15, 5, ...)

So the second query depends of the first query, if the first one succeed
the second will perform the second insert

I would like to do something like:

SELECT myProcedure(product_id, p_description, price, qty, store_id,
store_description );

waiting for a response from procedure, maybe true or false.

Thanks in advance...

--
"El desarrollo no es material es un estado de conciencia metal"

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Carlos Carcamo 2014-06-05 15:36:29 Re: help with a procedure
Previous Message Kalai R 2014-06-05 12:59:20 Re: Postgresql service stopped automatically after restart