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 by date:
Соглашаюсь с условиями обработки персональных данных