About how to use "exception when ??? then "

Поиск
Список
Период
Сортировка
От Emi Lu
Тема About how to use "exception when ??? then "
Дата
Msg-id 4419AB1A.3070805@encs.concordia.ca
обсуждение исходный текст
Ответы Re: About how to use "exception when ??? then "  (Richard Huxton <dev@archonet.com>)
Список pgsql-sql
Hello,

I am using PostgreSQL 8.0.1.

In a function, I try to use exception to catch sql errors:

begin
....   begin      exception         WHEN  ???   THEN   end;
...
end;

The place where I have ???, what I should put there please?

e.g.,
1. WHEN sqlcode = '02000' THEN
2. WHEN no_data then
3.  other ways?
From the 8.0 docs, I am not be able to find Constant values of all 
error codes.
http://www.postgresql.org/docs/8.0/static/errcodes-appendix.html

Please enlighten me.


Thanks,
Ying


В списке pgsql-sql по дате отправления:

Предыдущее
От: Bryce Nesbitt
Дата:
Сообщение: Re: group by function, make SQL cleaner?
Следующее
От: alex-lists-pgsql@yuriev.com
Дата:
Сообщение: executing external command