syntax error on: GET DIAGNOSTICS xcount = ROW_COUNT; - Mailing list pgsql-general

From
Subject syntax error on: GET DIAGNOSTICS xcount = ROW_COUNT;
Date
Msg-id 0215E59904354ED0BEE829358F2F87B0@nc05072019
Whole thread Raw
In response to Automated Backup On Windows  (justin <justin@emproshunts.com>)
Responses Re: syntax error on: GET DIAGNOSTICS xcount = ROW_COUNT;  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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_



pgsql-general by date:

Previous
From: "Darren Weber"
Date:
Subject: OSX build of PostgreSQL 8.3.3 with macports
Next
From: Tom Lane
Date:
Subject: Re: syntax error on: GET DIAGNOSTICS xcount = ROW_COUNT;