| От | Stuart Morse |
|---|---|
| Тема | SQL syntax error handling within SPI functions in C |
| Дата | |
| Msg-id | 0J7100HG3L3FXWD1@l-daemon обсуждение исходный текст |
| Ответы |
Re: SQL syntax error handling within SPI functions in C
|
| Список | pgsql-general |
Hi,
I’ve written a set of functions in C that will ultimately be called from an enterprise java bean. I expected that when calling SPI_exec(sql, 0) it would return an error code if “sql” contained a syntax error. At that point I would be able to return my own (more meaningful) error message based on the error thrown.
Instead an SQLException is thrown, and any error detection and processing code in the SPI function is bypassed. Is this the only error reporting model, or can I trap SQL errors within my functions? I’m using postgreSQL version 7.4.2 on Red Hat Linux version 9 and can’t upgrade at the moment.
Thanks in advance for your help,
Stuart Morse
Optimedia Solutions
1247 Knockan Drive
Victoria, BC, V8Z 7B8
(250) 658-8104 ph
(250) 658-8146 fax
stuart@optimediasolutions.ca
http://www.optimediasolutions.ca/
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера