Folks, Background: I'm an old Oracle PL/SQL guy. In PL/SQL I can write some like the following: fetch cursorblah into blurble; if cursorname%NOTFOUND ..... or use the more general SQL%NOTFOUND symbol that is not specific to a cursor. There are similar "easy" variables to get at the SQLSTATE code and associated error message. Question: How do I read the sqlstate for either/or the most recent SQL command or a nominated cursor from within plpgsql? I can find relevant info for C/spi stuff, but can't see it for plpgsql. Am I blind, not looking in the right spot, is it undocumented, or unimplemented? Thanks in advance -- David T. Bath dave.bath@unix.net
"Bath, David" <dave.bath@unix.net> writes: > In PL/SQL I can write some like the following: > fetch cursorblah into blurble; > if cursorname%NOTFOUND ..... See the FOUND variable: http://www.postgresql.org/docs/8.0/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-DIAGNOSTICS regards, tom lane
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера