how to check SQLSTATE

Поиск
Список
Период
Сортировка
От Hugo
Тема how to check SQLSTATE
Дата
Msg-id f3d9ba990610051345t61b6c780nf79d3ea2507d3b42@mail.gmail.com
обсуждение исходный текст
Ответы Re: how to check SQLSTATE  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Список pgsql-general
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"
Дата:
Сообщение: Re: PostgreSQL Database Transfer between machines(again)
Следующее
От: Ron Johnson
Дата:
Сообщение: Re: PostgreSQL Database Transfer between machines(again)