GeekInterview.com
Answered Questions

Table dropped after creating view issue

Asked By: suresh | Asked On: Oct 9th, 2006

A view is created on a table then I dropped the base table and created the base table once again with the same name then that view will works or not?

Answered by: Sant_parkash on: Feb 5th, 2008

The view will be INVALID,so you need to re-compile it after create that base table...

Answered by: Ashok Kumar choubey on: May 23rd, 2007


It will work either after base table drop and recreate or base table alteration. 

Enjoy

Details about force view why and we can use

Asked By: shami | Asked On: May 3rd, 2006

Answered by: g_sidhu on: Feb 1st, 2008

Force View: creates the view regardless of whether or not the base tables exist or whether the user has privileges on them. The user still can’t execute the view, but he or she can create it. No...

Answered by: Lavanya Chowdary on: May 6th, 2007

Generally we are not supposed to create a view without base table. If you want to create any view without base table that is called as Force View or invalid view. Syntax: CREATE FORCE VIEW AS < SELEC...

Which function is used to trap the error code and error message of an exception

Asked By: majji sowjanya | Asked On: Mar 16th, 2006

Answered by: roniprasan on: Sep 2nd, 2007

Raise_application_error(error number,error discription)

Answered by: aseemnaithani on: May 3rd, 2006

Hi,,
it is Raise_Application_error

How to return more than one value from a function?What are the types of triggers?What are the features of Oracle 9i

Asked By: aseemnaithani | Asked On: Mar 15th, 2006

Answered by: RJ on: Oct 17th, 2011

There are five types of Triggers 1) Data Definition Language triggers: These triggers fire when you make changes to the objects in the database like create, update or delete. They can be implemented...

Answered by: Art11 on: Sep 27th, 2011

The function always return a SINGLE value, which includes arrays. Check out the table functions (pipelined), BULK_COLLECT, arrays etc... You can find plenty of examples. "plsql set...

What is the difference between ref cursor & normal cursor?

Asked By: SaratKumar | Asked On: Oct 10th, 2005

Answered by: rammohan on: Apr 8th, 2013

REF cursor is a dynamic cursor where as normal cursor is static cursor,In dynamic cursor single segment are process multiple SELECT statements dynamically at run time, where as in normal cursor we process only one select statement

Answered by: Ramesh.RV on: Feb 26th, 2013

The main reason is refcursor is a address it give the address of the location instead of item. It hold the different type of structures. Normal cursor holds a one structure of the table.

What is the result of the fallowing code?Pieceinsert into table a value(a1):create table b as select * from a;rollback;a. Table b gets created with the row inserted in the first statement.B. Table b is...

Asked By: Interview Candidate | Asked On: Aug 25th, 2005

Answered by: ravi.allam9 on: Jun 4th, 2008

C. Table B gets created,but no rows gets inserted into Table A

Answered by: Guest on: Jan 4th, 2007

hi

an empty table table (B) will be created there is a mistake un the first statement

no need to commit a Create instruction, so the rollback will have no effect

good luck

What is difference between a procedure & function ?

Asked By: Interview Candidate | Asked On: Sep 2nd, 2005

 a function is always returns a value using the return statement.        a  procedure   may  return one or more values through parameters or may not return at all.

Star Read Best Answer

Editorial / Best Answer

Answered by: krishnaindia2007

View all answers by krishnaindia2007

Member Since Sep-2007 | Answered On : May 3rd, 2008

1. Function is mainly used in the case where it must return a value. Where as a procedure may or may not return a value or may return more than one value using the OUT parameter.
 
2. Function can be called from SQL statements where as procedure can not be called from the sql statements

3. Functions are normally used for computations where as procedures are normally used for executing business logic.

4. You can have DML (insert,update, delete) statements in a function. But, you cannot call such a function in a SQL query.

5. Function returns 1 value only. Procedure can return multiple values (max 1024).

6.Stored Procedure: supports deferred name resolution. Example while writing a stored procedure that uses table named tabl1 and tabl2 etc..but actually not exists in database is allowed only in during creation but runtime throws error Function wont support deferred name resolution.

7.Stored procedure returns always integer value by default zero. where as function return type could be scalar or table or table values

8. Stored procedure is precompiled execution plan where as functions are not.
 
9.A procedure may modify an object where a function can only return a value The RETURN statement immediately completes the execution of a subprogram and returns control to the caller.

Answered by: Md Jamshaid on: Dec 26th, 2012

What is the difference between system procedure and system function?.

Answered by: Swapnil on: Oct 31st, 2012

Also Procedure can be called from triggers but Function cannot be called from trigger. As function returns value. And no value can be returned to trigger.

What is the sub-query

Asked By: Interview Candidate | Asked On: Sep 9th, 2005

Star Read Best Answer

Editorial / Best Answer

Answered by: Sailaja Pasupuleti

Answered On : Dec 3rd, 2005

    A sub-query is a part of query.  Sub-queries are useful to find unknown value(s).

   Ex:  To find details of employees who are getting maximum salary.

         In this requirement, the maximum salary not mentioned.

Solution:    

To find maximum salary, 

          select max(sal) from emp;

For that maximum salary the employee details, 

          select * from emp where  sal = (select max(sal) from emp);

So, in the above query, "select max(sal) from emp"  is also a query but it returns a value (unknown or not given) and compares with "sal" column.  This query is called sub-query.

Answered by: kshsingh1 on: Jan 22nd, 2007

A query nested within another SQL statement is called a subquery.

Answered by: thumatinagaraju on: Oct 24th, 2006

simple reply nalini ..goodnagthumati_nagaraju@yahoo.co.in

Interview Question

 Ask Interview Question?

 

Career Counselling

 Have Career Question?

 Ask Chandra

 Ask Only Career questions.

Follow us: