Answered Questions

  • How do you set table for read only access ?

    if i am updating one record in a table at that time no other user can't able insert ,update the record in same table How is it possible

    Aditya

    • Feb 28th, 2018

    Lock table < table name > in exclusive mode;

    Smruti R Das

    • Sep 26th, 2012

    GRANT SELECT ON table_name TO user_name

  • how can i get set identity for last coloumn of the table.

    Nitesh Srivastava TechM

    • Nov 10th, 2011

    See the code below

    Code
    1. SELECT * FROM USER_TAB_COLUMNS WHERE TABLE_NAME='EMP'
    2. AND column_id = (SELECT MAX(column_id) FROM USER_TAB_COLUMNS WHERE TABLE_NAME='EMP')
    3. ORDER BY COLUMN_ID

  • Can we use commit or rollback command in the exception part of PL/SQL block?

    Star Read Best Answer

    Editorial / Best Answer

    Answered by: answertoyourquery

    • Nov 9th, 2005


    Yes, we can use the TCL commands(commit/rollback) in the exception block of a stored procedure/function. The code in this part of the program gets executed like those in the body without any restriction. You can include any business functionality whenever a condition in main block(body of a proc/func) fails and requires a follow-thru process to terminate the execution gracefully!

    Leena Roja

    • Jul 13th, 2015

    Correct Subhash..

    Susil Kumar Nagarajan

    • Jan 21st, 2012

    Yes. You can very well use COMMIT or ROLLBACK in exception block. But it is not a good idea to use, as it will commit the previous transactions in the same PLSQL block. Make use of creating SAVEPOINTS and commiting them when required.

  • What is difference between % ROWTYPE and TYPE RECORD ?

     %  ROWTYPE  is to be used whenever query returns a entire row of a table or view. TYPE  rec  RECORD is to be used whenever query returns columns of differenttable or views and variables.      E.g.  TYPE  r_emp is RECORD (eno emp.empno% type,ename emp ename %type);     e_rec emp% ROWTYPE     cursor...

    Nupur

    • Apr 30th, 2015

    This is my understanding: Declare : eno employee.emp_id%type - specifically tells you that the variable type or data that it will be holding will be same as th e employee_id type in the employee tabl...

    Nupur

    • Apr 24th, 2015

    When we declare a var as %row type, then the variable holds all the column type attributes. Developer does not need to know what the individual column types are. Type record is used when we declare a variable to be of the records of the table.