Posts

Showing posts with the label plsql

Soft Delete

 Many applications are using soft delete approach, So many applications implement a "soft delete" instead. This adds an "is deleted" flag to your tables. For example: alter table toys add is_deleted varchar2( 1 ) default 'N' ; When adding new rows, ensure this value is N (No): delete toys; insert into toys values ( 'Baby Turtle' , 0.01 , 'N' ); insert into toys values ( 'Miss Snuggles' , 0.51 , 'N' ); insert into toys values ( 'Cuteasaurus' , 10.01 , 'N' ); insert into toys values ( 'Sir Stripypants' , 14.03 , 'N' ); insert into toys values ( 'Purple Ninja' , 14.22 , 'N' ); select * from toys; commit ; Now, to "delete" rows, you run an update. This sets the deleted flag to Yes: update toys set is_deleted = 'Y' where toy_name = 'Cuteasaurus' ; select * from toys; But now you need to filter out the "deleted...

PL SQL Tutorial

What a beautiful language it is !!!! I have around of 9 years of experience in IT industry and i just love Oracle. Very easy to learn and to work in Pl SQL So I am sharing a tip to hold on PL SQL ,it is 'Practice','Practice' and 'practice' this is the only one thing that need to  understand that practice make a professional perfect. Second, Break your longer query into small chunks. Third, Uses of sub-queries .trust me it increase the performance. Fourth,never underestimate the power of indexing. Fifth,uses of hints but it works only if tables are analysed and updated stats. Sixth,uses of with clause. Seventh,proper use of indexing. Eight, when to use dynamic query, when not!!!!