Hi,
I am using a temp table for a 'select' statement from a perl code
(using DBI) as follows:
==========================================
$query="select date_part('month', date) as month, date_part('year',
date) as year into temp counter from weblogs;
select month || '-' || year, count(*) from counter group by
month, year;
";
$sth=$dbh->prepare($query) || die "Content-type:
text/plain\n\nCouldn't prepare select query: $query\n";
$sth->execute() || die "Content-type: text/plain\n\nCouldn't execute
statement: $query\n";
while(@data=$sth->fetchrow_array()){ push(@Datelog, [$data[0],
$data[1]]); }
======================================
When I run this code, I get the following error message:
DBD::Pg::st execute failed: ERROR: Relation 'counter' does not exist
at counter.pl line 56.
Content-type: text/plain
Couldn't execute statement:
select date_part('month', date) as month, date_part('year', date) as
year into temp counter from weblogs;
select month || '-' || year, count(*) from counter group by month,
year;
Line 56 is the 2nd select statement.
Can anybody give a hint about what can be wrong here?
Thanks and regards.
Samik