![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
http://www.postgresql.org/docs/8.3/s...tatements.html I can read that the FOUND variable it is set by any plain sql statement, plus perform, fetch, move. Nothing it is said about execute. Do I deduce that execute .. into does not set FOUND? |
#3
| |||
| |||
|
|
news wrote: http://www.postgresql.org/docs/8.3/s...tatements.html I can read that the FOUND variable it is set by any plain sql statement, plus perform, fetch, move. Nothing it is said about execute. Do I deduce that execute .. into does not set FOUND? Correct. Example: test=> CREATE TABLE test_table (id integer); CREATE TABLE test=> INSERT INTO test_table VALUES (1), (2); INSERT 0 2 test=> CREATE OR REPLACE FUNCTION test_found() RETURNS boolean LANGUAGE plpgsql AS test-> $$BEGIN test$> EXECUTE 'SELECT * FROM test_table'; test$> RETURN FOUND; test$> END;$$; CREATE FUNCTION test=> SELECT test_found(); test_found ------------ f (1 row) Use GET DIAGNOSTICS integer_var = ROW_COUNT; instead, see http://www.postgresql.org/docs/current/static/plpgsql- statements.html#PLPGSQL-STATEMENTS-DIAGNOSTICS Yours, Laurenz Albe |
![]() |
| Thread Tools | |
| Display Modes | |
| |