Re: [webmaster] Question

From: Fernando Fernández <ffernandez(at)aircomp(dot)aero>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: [webmaster] Question
Date: 2004-11-15 07:17:32
Message-ID: 001f01c4cae3$2d1a45e0$2600a8c0@inf1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ok :))

I am developing a Windows application, under NT 4 version.
I am connecting to database throught ODBC (I had installed postgreSQL
drivers)
My database version... mmm... I am not sure, but I think 7.4.2 version
I am programing in Visual FoxPro 8.0, but this information is not important
I think.

In sql i can do something like this::
begin transaction
Update .... where clave= @clave
IF @@error= 0 and @@rowcount= 0
Insert ... ( @clave, .... )
commit transaction

I don't know wether "@@rowcount" exists in postgreSQL
Thanks you in general and in special to this "someone" that will be happy to
give me some help.

From Palma de Mallorca
Fernando

----- Original Message -----
From: "Robert Treat" <xzilla(at)users(dot)sourceforge(dot)net>
To: "Fernando Fernández" <ffernandez(at)aircomp(dot)aero>
Cc: <webmaster(at)postgresql(dot)org>
Sent: Friday, November 12, 2004 4:11 PM
Subject: Re: [webmaster] Question

On Fri, 2004-11-12 at 07:34, Fernando Fernández wrote:
> Hi :))
> I am Fernando, from Mallorca - Spain
>
> I am using PostgreSQL for my databases. Everything is going all right,
> but now i need in my application to know how many records has updated an
> update command.
>
> I know I can do something like:
> SELECT COUNT(*) AS xCount FROM ...
> IF xCount = 0
> INSERT ...
> ELSE
> UPDATE ...
> ENDIF
>
> but I would like do something like:
> UPDATE ...
> IF records_updated = 0
> INSERT
> ENDIF
>
> is it possible?

Yes, this is certainly possible, but there's no way we can explain it to
you without knowing some details of your work environment. Please send
an email to either pgsql-novice(at)postgresql(dot)org or
pgsql-general(at)postgresql(dot)org that includes some details of your
programming environment (pl language, php, C, whatever; database
version; any driver layers involved) and someone will be happy to give
you some more detailed help.

Robert Treat
--
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL

Browse pgsql-general by date

  From Date Subject
Next Message Michael Glaesemann 2004-11-15 07:22:01 Re: OID's
Previous Message Michael Glaesemann 2004-11-15 07:05:38 Re: OID's