I have 170 Alter Drop Constraint statement, 120 Truncate table, 120 Insert table and 170 Alter Add Constraint. All of these should be run in one in one script as batch script and I'm using PGADMIN IV tool.
Tried executing them between Begin and End as follows like Oracle,
BEGIN
ALTER Statement1..,, ;
ALTER Statement2..,, ;
TRUNCATE Statement3..,, ;
TRUNCATE Statement4..,, ;
INSERT Statement5..,, ;
INSERT Statement6..,, ;
COMMIT;
ALTER Statement7..,, ;
ALTER Statement8..,, ;
---
-----
-------
---------
COMMIT;
END;
But its not working,
Can some one please give a suggestion on how I can do this?
;
after each statement, not a,
and you need aCOMMIT;
orROLLBACK;
at the end,end;
is only valid in PL/pgSQL, not in SQL (which is the same in Oracle – Ticondo
command – Ticon