Generate Unique Sequential values Sequence has 2 pseudocolumns 1. CURRVAL 2. NEXTVAL CURRVAL : gives the most recently generated value NEXTVAL : gives the next available value in the sequence to generate sequence will start generating value from its MINVALUE Default MINVALUE is 1 default incremental value of sequence is +1 Same sequence can be used in multiple tables but not suggestable. One sequence for one table.
1. When we have to same task everyday then instead of writing queries we can save the query in procedure and then just run it when required. 2. Named PLSQL program 3. Permanently saved in DB Features : 1. Procedures executed explicitly. Execute Command Exec Procedurename (arg1, arg2...); 2. Procedures can also executed implicitly. Using procedured calling statement Procedurename(arg1, arge2...); 3. Saved in a DB as pre compiled obbject. Complied once only when there is changes in logic of SP then again it will complied. Can call procedure from other proc, func, programs. 4. Procedure can be static or dynamic mean proc may or maynot take arguments. 5. By default proc should not return any value. Types of Proc: 1. Static : Not having arg 2. Dynamic : With arg Syntax : Create or replace procedure procedure_name( arguments ..) is/as ----------any keyword use declaration ----...
Comments
Post a Comment