Re: Executing dynamic queries (EXECUTE)

From: Tomasz Myrta <jasiek(at)klaster(dot)net>
To: Carla Mello <carla(dot)mello(at)widesoft(dot)com(dot)br>
Cc: Lista dyskusyjna pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Executing dynamic queries (EXECUTE)
Date: 2004-02-01 19:43:34
Message-ID: 401D56E6.7080700@klaster.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Dnia 2004-01-27 16:25, Użytkownik Carla Mello napisał:
>
> Hello!
>
> I need to execute a dynamic query and capture your result in a
> integer variable.
>
> I´m using the statement "EXECUTE string", but I don´t obtain to
> capture the result of dynamic query.
> v_count:= EXECUTE v_query;

Documentation:
19.5.4. Executing dynamic queries

"The results from SELECT queries are discarded by EXECUTE, and SELECT
INTO is not currently supported within EXECUTE. So, the only way to
extract a result from a dynamically-created SELECT is to use the
FOR-IN-EXECUTE form described later."

Regards,
Tomasz Myrta

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Paul Hart 2004-02-02 02:33:03 Re: Help! Error with postgresql!
Previous Message Michael Fuhr 2004-02-01 19:11:12 Re: An order by question