GET DIAGNOSTICS SELECT PROCESSED INTO <int4_variable>

Поиск
Список
Период
Сортировка
Искать

GET DIAGNOSTICS SELECT PROCESSED INTO <int4_variable>

От:
"Dan Langille" <dan@langille.org>
Дата:
Does anyone know if this feature exists?  If so, what version or where 
can a patch be obtained?

Thanks

------- Forwarded message follows -------
Date sent:      	Mon, 15 Jan 2001 08:44:46 +0100
From:           	"J.H.M. Dassen (Ray)" 
To:             	pgsql-general@postgresql.org
Subject:        	Re: getting number of rows updated within a procedure

On Sun, Jan 14, 2001 at 23:27:06 +1300, Dan Langille wrote:
> I'm writing some stuff in PL/pgsql (actually, a lot of stuff).  I have a
> question: At various times, it does UPDATEs.  Is there a way to tell if
> the UPDATE actually affected any rows or not?  I couldn't see how to get
> UPDATE to return anything.
  
Quoting a recent message by Jan Wieck :
:Do a
:
:    GET DIAGNOSTICS SELECT PROCESSED INTO ;  
:
:directly  after  an  INSERT,  UPDATE  or DELETE statement and you'll know
:how many rows have been hit.
:
:Also you can get the OID of an inserted row with
:
:    GET DIAGNOSTICS SELECT RESULT INTO ;

HTH,
Ray
-- 
"The software `wizard' is the single greatest obstacle to computer literacy
since the Mac."
	http://www.osopinion.com/Opinions/MichaelKellen/MichaelKellen1.html
------- End of forwarded message -------

--
Dan Langille
The FreeBSD Diary - http://freebsddiary.org/
       FreshPorts - http://freshports.org/
     NZ Broadband - http://unixathome.org/broadband/

Re: GET DIAGNOSTICS SELECT PROCESSED INTO <int4_variable>

От:
Bruce Momjian <pgman@candle.pha.pa.us>
Дата:
It is in 7.1beta, and is not documented yet.


it> Does anyone know if this feature exists?  If so, what version or where 
> can a patch be obtained?
> 
> Thanks
> 
> ------- Forwarded message follows -------
> Date sent:      	Mon, 15 Jan 2001 08:44:46 +0100
> From:           	"J.H.M. Dassen (Ray)" 
> To:             	pgsql-general@postgresql.org
> Subject:        	Re: getting number of rows updated within a procedure
> 
> On Sun, Jan 14, 2001 at 23:27:06 +1300, Dan Langille wrote:
> > I'm writing some stuff in PL/pgsql (actually, a lot of stuff).  I have a
> > question: At various times, it does UPDATEs.  Is there a way to tell if
> > the UPDATE actually affected any rows or not?  I couldn't see how to get
> > UPDATE to return anything.
>   
> Quoting a recent message by Jan Wieck :
> :Do a
> :
> :    GET DIAGNOSTICS SELECT PROCESSED INTO ;  
> :
> :directly  after  an  INSERT,  UPDATE  or DELETE statement and you'll know
> :how many rows have been hit.
> :
> :Also you can get the OID of an inserted row with
> :
> :    GET DIAGNOSTICS SELECT RESULT INTO ;
> 
> HTH,
> Ray
> -- 
> "The software `wizard' is the single greatest obstacle to computer literacy
> since the Mac."
> 	http://www.osopinion.com/Opinions/MichaelKellen/MichaelKellen1.html
> ------- End of forwarded message -------
> 
> --
> Dan Langille
> The FreeBSD Diary - http://freebsddiary.org/
>        FreshPorts - http://freshports.org/
>      NZ Broadband - http://unixathome.org/broadband/
> 


-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
FAQ