Answered Questions

  • What is the difference between procedure and function and package, which is the fastest

    Varun Tiwari

    • Jul 4th, 2013

    Function Procedure 1. Can be used as column Cant used in select statement in select statement 2. Can be used in where Cant used in where condition c...

  • Differentiate between TRUNCATE and DELETE

    TRUNCATE deletes much faster than DELETETRUNCATEDELETEIt is a DDL statementIt is a DML statementIt is a one way trip,cannot ROLLBACKOne can RollbackDoesn't have selective features (where clause)HasDoesn't fire database triggersDoesIt requires disabling of referential constraints.Does not require

    amarparash

    • Sep 27th, 2008

    DELETE is a DML command so it works on row level, where TRUNCATE is a DDL command, so it works on object level, TRUNCATE actually deletes the table and recreates it, so whatever people say that it works faster or frees occupied space or high water mark or oil mark.The actual internal work was that.

    Shaveta Chawla

    • Sep 7th, 2007

    One main freature is when we have used auto increment clause the would return to next value after delete statement. e.g: if id =1000then after delete statement when we insert any record the value will be 1001 but if we use truncate statement then auto increment value will come to 0 positon

  • Difference between procedure and function.

    Functions are named PL/SQL blocks that return a value and can be called with arguments procedure a named block that can be called with parameter. A procedure all is a PL/SQL statement by itself, while a Function call is called as part of an expression.

    usha`

    • Aug 19th, 2011

    Functions can be used in a select statement where as procedures cannot.

    functions cannot return values where as procedures can.

    functions can be used as user defines data types in create table but procedures cannot.

  • Which is more faster - IN or EXISTS?

    EXISTS is more faster than IN because EXISTS returns a Boolean value whereas IN returns a value.

    rohitosu

    • Mar 9th, 2012

    As a rule of thumb IN should be used when the sub query will return small result set. It should be kept in mind that the sub query should not return null values. EXISTS should be used when the result set returns large result set. Other factors that might affect query performance is the indexes