Using EXECUTE in plpgsql

From: Jonathon Batson <jonathon(at)octahedron(dot)com(dot)au>
To: Postgres Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Using EXECUTE in plpgsql
Date: 2003-03-26 00:42:48
Message-ID: 3E80F788.8050408@octahedron.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi
I have just experimenting with plpgsql and cannot find out how to return
a single field from a query
that I know will only every return one field. I currently use the
example below:

qrystr1 := ''SELECT count(*) from my_table";
FOR next_table IN EXECUTE qrystr1 LOOP
next_table_count := next_table.count;
END LOOP;

which seems like a very inadequate way to retrieve one value....?

Tips are very much aprieciated, thanks
Jonathon

Browse pgsql-novice by date

  From Date Subject
Next Message Bruno Wolff III 2003-03-26 04:47:51 Re: Majordomo results: archive-get
Previous Message Frank Bax 2003-03-26 00:14:07 Re: Getting data out of MS Access with only Linux?