CURSORS - Please help urgent.

From: "Sumita Biswas (sbiswas)" <sbiswas(at)cisco(dot)com>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: CURSORS - Please help urgent.
Date: 2004-02-24 11:51:16
Message-ID: 002701c3facc$83113040$2a154d0a@apac.cisco.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

The follow code gives me Error:

DECLARE CURSOR_GET_ALL_CONFERENCE_RECORDS CURSOR FOR Select
ConferenceType,CallManagerId,ClusterId,DestConversationId,AppConfId,Fina
lDestination FROM Tmp_Conference;

OPEN CURSOR_GET_ALL_CONFERENCE_RECORDS;

FETCH FROM CURSOR_GET_ALL_CONFERENCE_RECORDS INTO lv_ConfId,
li_CallManagerId, lv_ClusterId, li_DestConversationId, lv_AppConfId,
lv_FinalDestination;

-- Close and de-allocate cursor
CLOSE CURSOR_GET_ALL_CONFERENCE_RECORDS;

Error is as follows:
plpgsql: ERROR during compile of proc_conferencesummary near line 212
ERROR: syntax error at or near "OPEN"

Please comment what can be wrong.

Regards,
Sumita

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Monday, February 23, 2004 8:59 AM
To: Sumita Biswas
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Postgres DB

"Sumita Biswas" <sbiswas(at)cisco(dot)com> writes:
> But when I type the command "psql" and don't specify a DB name, it
> says
> that:
> psql: FATAL: Database "postgres" does not exist in the system
catalog.

Yes, because psql's default behavior is to try to connect to the DB with
the same name as your user name. That doesn't mean that such a DB is
guaranteed to exist, or even that anything is going to try to create it
for you. It's just a default behavior that people have found handy.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Sumita Biswas (sbiswas) 2004-02-24 15:35:07 Execute Query in Postgres Function
Previous Message Martin Langhoff 2004-02-24 10:47:48 Re: BUG #1083: Insert query reordering interacts badly with