Search Postgresql Archives

plpgsql; execute query inside exists

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi there,

I would like to use EXISTS in a small plpgsql function but I always
get a "syntax error". How can I execute a query inside the
EXISTS function?



IF NOT EXISTS(EXECUTE 'SELECT * FROM '|| tmp_tbl)
   THEN
      CREATE TABLE tt();




ERROR:  syntax error at or near "EXECUTE"
LINE 1: SELECT  NOT EXISTS(EXECUTE 'SELECT * FROM '||  $1 )



Sorry for my lame question but I'm new in postgres.

Thanks!

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux