Useful shortcuts for vi editor

Thursday, 19 February 2015

[ADVICE] Using both of semicolon and slash characters at the same time

Please note that if you use semicolon and slash at the same time in sql queries, there will be executed as twice on the system.

e.g.
insert into mytable values (007,'Alper');
/

-- result of sql
-- 1 row inserted
-- 1 row inserted

-- do not use "/" with ";" to prevent this case.

Please note that if you use begin-end pl-sql code block, there should be ";" at the end of pl-sql block.

e.g.
begin
insert into mytable values (007,'Alper');
end;

-- result of sql
-- 1 row inserted

-- ";" should be existed in here.