Search Postgresql Archives

Re: syntax error on: GET DIAGNOSTICS xcount = ROW_COUNT;

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

 



<cyw@xxxxxxx> writes:
> 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;

You need to have declared xcount as an integer variable.

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

Hmm, not the most friendly error, I agree ...

			regards, tom lane


[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