pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
PERFORM / FOUND, what's up?
2+ messages / 2 participants
[nested] [flat]

* PERFORM / FOUND, what's up?
@ 2003-04-29 08:21  Martin Brommer <martin@brommer.nl>
  0 siblings, 1 reply; 2+ messages in thread

From: Martin Brommer @ 2003-04-29 08:21 UTC (permalink / raw)
  To: pgsql-sql

Hi,

I'm trying to get an answer from a dynamic query using perform. The 
problem is that it sets the FOUND variable to true even when performing 
bogus queries.

Am I missing something here? The documentation says that PERFORM only 
sets FOUND to true if it finds and discards a row but doing something like:

qry := 'SELECT notafield FROM notatable'
PERFORM qry

Also sets FOUND to true, even more using a query like 'BLABLABLA'  also 
set found to true.

What am I doing wrong here?

Thanks for any help in advance,

Martin




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: PERFORM / FOUND, what's up?
@ 2003-05-01 01:53  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Martin Brommer <martin@brommer.nl>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2003-05-01 01:53 UTC (permalink / raw)
  To: Martin Brommer <martin@brommer.nl>; +Cc: pgsql-sql

Martin Brommer <martin@brommer.nl> writes:
> qry := 'SELECT notafield FROM notatable'
> PERFORM qry
> Also sets FOUND to true, even more using a query like 'BLABLABLA'  also 
> set found to true.

I think you are looking for EXECUTE, not PERFORM.  The above only
confirms that indeed "qry" is a scalar variable --- its contents
are not examined.

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2003-05-01 01:53 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-04-29 08:21 PERFORM / FOUND, what's up? Martin Brommer <martin@brommer.nl>
2003-05-01 01:53 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox