I am setting up database from a remote database using the dblink
here are my scripts to create table and constraints..
begin
dbms_utility.exec_ddl_statement@mydblink('CREATE TABLE MYTABLE1
(ID NUMBER(5,0) GENERATED ALWAYS AS IDENTITY MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE NOKEEP NOSCALE ,
CODE NVARCHAR2(15),
DESCRIPTION NVARCHAR2(125),
IS_ACTIVE NUMBER(1,0) DEFAULT 1
)') ;
dbms_utility.exec_ddl_statement@mydblink('CREATE UNIQUE INDEX MYTABLE1_PK ON MYTABLE1 (ID)
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)');
end;
i would like to check if table exist before creating them and drop the table if it exist. How can we achieve this.mydblink is the dblink used to connect to a database from a remote database
How to check if a tables/constraint exist and drop them all.