syntax error on: GET DIAGNOSTICS xcount = ROW_COUNT;

From: <cyw(at)dls(dot)net>
To: "PostgreSQL" <pgsql-general(at)postgresql(dot)org>
Subject: syntax error on: GET DIAGNOSTICS xcount = ROW_COUNT;
Date: 2008-09-09 22:44:43
Message-ID: 0215E59904354ED0BEE829358F2F87B0@nc05072019
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi All,

I am getting an error on "GET DIAGNOSTICS " statement in a PL/SQL function
below.

CREATE OR REPLACE FUNCTION test(lid int, OUT nid int) AS $$
DECLARE
road_row road%ROWTYPE;
BEGIN
SELECT * INTO road_row FROM road WHERE link_id=lid;
GET DIAGNOSTICS xcount = ROW_COUNT;

IF xcount = 0 THEN
RAISE DEBUG 'LID=% not found', lid;
nid := -99;
RETURN
END IF
......

The exact error message is:
ERROR: syntax error at or near "xcount" at character

I am must be doing something wrong somewhere.

Thanks a lot for any help.

_C_

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Ross 2008-09-09 23:03:15 Can interval take a value from a field?
Previous Message Jignesh K. Shah 2008-09-09 22:28:54 Re: PostgreSQL TPC-H test result?