Re: I must be blind...
От | Nigel J. Andrews |
---|---|
Тема | Re: I must be blind... |
Дата | |
Msg-id | Pine.LNX.4.21.0206142315460.4131-100000@ponder.fairway2k.co.uk обсуждение исходный текст |
Ответ на | Re: I must be blind... (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: I must be blind...
|
Список | pgsql-general |
On Fri, 14 Jun 2002, Tom Lane wrote: > Joe Conway <mail@joeconway.com> writes: > > I don't think you can use PERFORM like that. Try: > > Actually I believe he can; after looking at the manual I realized that > the problem is that PERFORM is syntactically a substitute for SELECT. > In other words he needed to write > > PERFORM 1 FROM orders ... > not > PERFORM SELECT 1 FROM orders ... Yes, indeed if one reads what is there rather than reading things that aren't it does say that PERFORM substitutes for SELECT syntactically. However, because PERFORM discards the results of a query it is only useful for side effects of the query. My usage of it was wrong since I wasn't using it for side effects merely for determining the existance of a result without having to store that result since it wasn't required. Therefore, with the correct syntax of PERFORM <query> my function doesn't generate an 'unprogrammed' error but the test of FOUND always fails, i.e. result is NOT FOUND. Therefore SELECT INTO dummy ... is still the correct thing for me to be doing. I just thought I'd clear that up in case anyone was wondering, and yes, I have tested it. -- Nigel J. Andrews Director --- Logictree Systems Limited Computer Consultants
В списке pgsql-general по дате отправления: