Skip site navigation (1) Skip section navigation (2)

Re: Update on existence?

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: Jan Danielsson <jan(dot)m(dot)danielsson(at)gmail(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Update on existence?
Date: 2007-04-05 02:56:26
Message-ID: 113025.71130.qm@web31805.mail.mud.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-novice
> ------------------
>   select id, username, settings from sessions where id='foobar'
this is handled using this link:
http://www.postgresql.org/docs/8.2/interactive/plpgsql-declarations.html#PLPGSQL-DECLARATION-ROWTYPES
However, I seen it mentioned that there is a variable called FOUND that may be used for this also.
It might be worth reading up on. 
http://www.postgresql.org/docs/8.2/interactive/plpgsql-statements.html#PLPGSQL-STATEMENTS-SQL-NORESULT

>   If a result was found
this can be achieved from this link:
http://www.postgresql.org/docs/8.2/interactive/plpgsql-control-structures.html#PLPGSQL-CONDITIONALS


>      update sessions set last_access=current_timestamp where id='foobar'
this is just about correct using the rowtype variable

I hope this helps,
Regards,
Richard Broersma Jr.

In response to

Responses

pgsql-novice by date

Next:From: Jan DanielssonDate: 2007-04-05 03:47:30
Subject: Re: Update on existence?
Previous:From: Jan DanielssonDate: 2007-04-05 00:48:40
Subject: Update on existence?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group