Hello, I am very new to the postgres sql, i am trying to execute below pl/sql block in postgres but i am getting error 'ERROR: syntax error at or near "integer" ', Could some one help me in this regard declare v_count integer; begin select count(1) into v_count from pg_index inx where inx.indexrelid in (select oid from pg_class where relname='action_pk' and relowner in (select oid from pg_authid where rolname='postgres_ref')) and inx.indrelid in (select oid from pg_class where relname='action' and relowner in (select oid from pg_authid where rolname='postgres_ref')); if v_count = 0 then execute immediate 'create unique index action_pk on action(acn_id)'; end if; end Sivannarayanareddy Nusum | System Analyst(Moneta GDO) Subex
Limited, Adarsh Tech Park, Outer Ring Road,
Devarabisannalli,
Bangalore – 560037, India. Email: sivannarayanre...@subexworld.com; URL: www.subexworld.com
Disclaimer:
This e-mail is bound by the terms and conditions
described at
http://www.subexworld.com/mail-disclaimer.html |
Title:
- [SQL] PL/SQL block error Sivannarayanreddy
- Re: [SQL] PL/SQL block error Pavel Stehule