get diagnostics not supported by ecpg?

From: Slava Gorski <slava_gorski(at)newmail(dot)ru>
To: pgsql-novice(at)postgresql(dot)org
Cc: pgsql-sql(at)postgresql(dot)org
Subject: get diagnostics not supported by ecpg?
Date: 2003-10-09 17:29:03
Message-ID: 20031009172903.24750.qmail@flock1.newmail.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice pgsql-sql

Hi all,

It seems that get diagnostics is not supported by ecpg in postgresql
7.3, I always get the following error when trying to use it:

ERROR: parse error at or near "diagnostics"

For example, the following code does not compile:

#include <stdio.h>

int main()
{
EXEC SQL BEGIN DECLARE SECTION;
char msg[8191];
int msg_len=0;
EXEC SQL END DECLARE SECTION;

EXEC SQL connect to 'test';

EXEC SQL get diagnostics :msg_len=ROW_COUNT;

fprintf(stderr, "SQL: %d\n", msg_len);

EXEC SQL disconnect current;

return 0;
}

same if I use

EXEC SQL get diagnostics exception 1
:msg=MESSAGE_TEXT,
:msg_len=MESSAGE_LENGTH;

What am I doing wrong? Or it's just not supported by ecpg in 7.3?

Thanks in advance,
Slava
__________
www.newmail.ru -- всегда что-то новое.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Godshall Michael 2003-10-09 17:30:53 Re: Using a function to delete rows
Previous Message Derrick Betts 2003-10-09 17:25:22 Using a function to delete rows

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2003-10-09 17:57:37 Re: Selecting rows as if they were columns?
Previous Message Josh Berkus 2003-10-09 17:14:09 Re: Selecting rows as if they were columns?