From: | Alvaro Herrera <alvherre(at)commandprompt(dot)com> |
---|---|
To: | Victor Lopez <v(dot)lopez(dot)s(at)ono(dot)com> |
Cc: | pgsql-es-ayuda(at)postgresql(dot)org |
Subject: | Re: EXECUTE en PL/pgSQL ¿? o 'como me lio' |
Date: | 2007-04-01 17:02:38 |
Message-ID: | 20070401170238.GA4336@alvh.no-ip.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
Victor Lopez escribió:
> Buenas.
>
> test=# SELECT (count(*)::integer > 0) FROM test ;
> ?column?
> ----------
> f
> (1 fila)
> -- me funciona,
> -- luego me equivoco en no_se_que ...
> test=# CREATE OR REPLACE FUNCTION prueba(TEXT) RETURNS boolean AS
> test-# $$
> test$# EXECUTE 'SELECT (count(*)::integer > 0) FROM ' || $1;
> test$# $$
> test-# LANGUAGE sql;
> ERROR: error de sintaxis en o cerca de «'SELECT (count(*)::integer > 0)
> FROM '» at character 71
> LINEA 3: EXECUTE 'SELECT (count(*)::integer > 0) FROM ' || $1;
> ^
> -- en fuente monoespaciada, '^' marca la comilla simple de delante de SELECT
>
> Donde me equivoco?
En el lenguaje sql, no existe EXECUTE. Prueba con plpgsql.
--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
From | Date | Subject | |
---|---|---|---|
Next Message | Victor Lopez | 2007-04-01 19:21:04 | Re: EXECUTE en PL/pgSQL ¿? o 'como me lio' |
Previous Message | HERMES ZAMBRA | 2007-04-01 16:03:05 | Rv: Re: Sentencia SQL para dos registros por grupo |