get diagnostics not supported by ecpg?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Slava Gorski

    get diagnostics not supported by ecpg?

    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 "diagnostic s"

    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_CO UNT;

    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_TE XT,
    :msg_len=MESSAG E_LENGTH;

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

    Thanks in advance,
    Slava
Working...