AW: [PHP] Select into
| From: | Ebeling, Oliver | Date: | Fri, 17 Nov 2000 18:20:27 +0000 |
| Subject: | AW: [PHP] Select into | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-25937@lists.php.net to get a copy of this message | ||
hi,
pg_numrows returns the number of rows in the result-set, but select ... into creates a new table so
pg_numrows tells the truth.
some databases leave a message like "XX rows affected", which might be parsed.
i think best way is to select count(*) from temp_table...
most databases got this value in their statistcal data so you don't have to worry about the
load of the select.
greetings
oliver
> -----Ursprüngliche Nachricht-----
> Von: Bernie Huang [mailto:bernie.huang@ec.gc.ca]
> Gesendet am: Freitag, 17. November 2000 19:04
> An: PHP_DB; PHP_General
> Betreff: [PHP] Select into
>
> Hello,
>
> I have an SQL "select ... into temp table ...;". Normally, when we
> execute "select" using pg_exec(), we can always fetch number of rows
> using pg_numrows(). But, when I use pg_numrows() after executing
> "select into", it returns 0 rows.
>
> Is there a way to find out number of rows immediately without using
> "select * from temp_table"?
>
> Thank you.
>
> - Bernie
>
>