Re: oracle to postgres
От | Adrian Klaver |
---|---|
Тема | Re: oracle to postgres |
Дата | |
Msg-id | 54CA9FCC.2000702@aklaver.com обсуждение исходный текст |
Ответы |
Re: oracle to postgres
Re: oracle to postgres |
Список | pgsql-general |
On 01/29/2015 03:16 AM, Ramesh T wrote: > hello, > can any one help me to convert oracle to postgres script..? > following code .. > BEGIN > EXECUTE IMMEDIATE 'DROP TABLE CONTAINER'; > EXCEPTION > WHEN OTHERS THEN > IF SQLCODE != -942 THEN > RAISE; > END IF; > END; > advance thanks, For hints and tips see: http://www.postgresql.org/docs/9.3/interactive/plpgsql-porting.html In this case I believe the following is what you want: BEGIN DROP TABLE CONTAINER; EXCEPTION WHEN OTHERS THEN IF RETURNED_SQLSTATE != -942 THEN RAISE; END IF; END; Not sure about that state code. I could not find it here: http://www.postgresql.org/docs/9.3/interactive/errcodes-appendix.html For plpgsql error handling, see here: http://www.postgresql.org/docs/9.3/interactive/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING -- Adrian Klaver adrian.klaver@aklaver.com
В списке pgsql-general по дате отправления: