tobbe wrote:
Hi.
I have a little problem.
In a system of mine i need to insert records into table [tbStat], and
if the records exist i need to update them instead and increase a
column [cQuantity] for every update.
I.e. the first insert sets cQuantity to 1, and for every other run
cQuantity i
The following trigger procedure works for me you'd need to adjust this
to manipulate YOUR table schema:
DROP FUNCTION dmc_comp_plan_duplicates() CASCADE;
CREATE OR REPLACE FUNCTION dmc_comp_plan_duplicates() RETURNS "trigger" AS
$BODY$
DECLARE did integer;
BEGIN
SELECT COALESCE(id,
tobbe wrote:
Hi.
I have a little problem.
In a system of mine i need to insert records into table [tbStat], and
if the records exist i need to update them instead and increase a
column [cQuantity] for every update.
I.e. the first insert sets cQuantity to 1, and for every other run
cQuantity is
In a system of mine i need to insert records into table [tbStat], and
if the records exist i need to update them instead and increase a
column [cQuantity] for every update.
I.e. the first insert sets cQuantity to 1, and for every other run
cQuantity is increased.
Currently i have implemented t
> Currently i have implemented this as a stored procedure in the plpgsql
> language. This means that in my stored procedure i first do a
> select to
> find out if the row exists or not, then i do a insert or update
> depending if the row existed.
>
> Unfortunately, stored procedures seems awfull
Hi.
I have a little problem.
In a system of mine i need to insert records into table [tbStat], and
if the records exist i need to update them instead and increase a
column [cQuantity] for every update.
I.e. the first insert sets cQuantity to 1, and for every other run
cQuantity is increased.
Cu