Search Postgresql Archives

syntax error on: GET DIAGNOSTICS xcount = ROW_COUNT;

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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_



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux