Search Postgresql Archives

how to check SQLSTATE

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

 



Hi,

is it possible to check for sqlstate inside a function , something like:
   ....
   loop
      fetch bla.....
      if sqlstate = '02000' then
            exit;
      end if;
      ....
   end loop;
 if I try to save the above I get a :  sqlstate not defined error

Then I tried this with no success:

   ....
   loop
      Begin
           fetch bla.....
           Exception
                     when no_data then
                                  exit;
     end;
      ....
   end loop; 
when I tried to save the trigger I got this:  unrecognized exception condition "no_data"
but according to the help docs, no_data is a valid symbol.

could anybody give me some hints


thanks

Hugo

[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