how to check SQLSTATE

Поиск
Список
Период
Сортировка
Искать
От
Hugo
Тема
how to check SQLSTATE
Дата
Msg-id
f3d9ba990610051345t61b6c780nf79d3ea2507d3b42@mail.gmail.com
Список
Дерево обсуждения
how to check SQLSTATE Hugo <htakada@gmail.com>
Re: how to check SQLSTATE "A. Kretschmer" <andreas.kretschmer@schollglas.com>
Re: how to check SQLSTATE Hugo <htakada@gmail.com>
Re: how to check SQLSTATE Hugo <htakada@gmail.com>
Re: how to check SQLSTATE Tom Lane <tgl@sss.pgh.pa.us>
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
В списке pgsql-general по дате отправления
От: Brian J. Erickson
Дата:
От: Ron Johnson
Дата:
FAQ