ECPG Preprocessor throws Syntax Error [Devel Repository]

From: "Ahmed Shinwari" <ahmed(dot)shibwari(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: ECPG Preprocessor throws Syntax Error [Devel Repository]
Date: 2008-12-11 17:09:40
Message-ID: e31749290812110909k652328d3n81b9149ee2bbec75@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

Yesterday I pull source from PG-Devel repository (Head) and was playing
around with ECPG. I got following two issues while parsing my script files
through ECPG preprocessor which I think are potential bugs;

1- I get this error message from preprocessor,

*ERROR: cursor "m_name_cursor" already defined *

Below is the code snippet, error message is thrown on the last line of this
snippet;

...
...
EXEC SQL DECLARE m_name_cursor CURSOR FOR SELECT name,id FROM m_table3;
EXEC SQL OPEN m_name_cursor;
EXEC SQL CLOSE m_name_cursor;

/* Declaring cursor with the same name */
EXEC SQL DECLARE m_name_cursor CURSOR FOR SELECT name,id FROM m_table4;

2- Preprocessor throws this error;

*ERROR: syntax error at or near "-"*

Below is the code snippet, the error is thrown on the last line of the
snippet;

...
...
const char *stmt1 = "SELECT abs(?)";
EXEC SQL PREPARE mystmt1 FROM :stmt1;
EXEC SQL EXECUTE mystmt1 INTO :result USING -.55566;

Regards,
Ahmed

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Karsten Silz 2008-12-11 18:13:31 BUG #4576: Postgres Windows service crashes
Previous Message Scott Carey 2008-12-11 16:39:21 Re: BUG #4575: All page cache in shared_buffers pinned (duplicated by OS, always)