Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Geeks - Tip of the Day

This is a discussion on Geeks - Tip of the Day within the Geeks Lounge forums, part of the Geeks Community category; Cursors retrieve the values one at a time from the database, and process them sequentially. Collections retrieve all values in one go and You can carry out operations on the ...

Go Back   Geeks Talk > Geeks Community > Geeks Lounge
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read

Geeks Lounge General and off topic threads containing intellectual discussion

Reply

 

LinkBack Thread Tools Display Modes
  #81 (permalink)  
Old 05-26-2008
Expert Member
 
Join Date: Sep 2007
Posts: 738
Thanks: 22
Thanked 67 Times in 65 Posts
krishnaindia2007 is on a distinguished road
Re: Geeks - Tip of the Day

Cursors retrieve the values one at a time from the database, and process them sequentially.
Collections retrieve all values in one go and You can carry out operations on the group of values as a whole.
Reply With Quote
Sponsored Links
  #82 (permalink)  
Old 05-27-2008
Expert Member
 
Join Date: Sep 2007
Posts: 738
Thanks: 22
Thanked 67 Times in 65 Posts
krishnaindia2007 is on a distinguished road
Re: Geeks - Tip of the Day

What is an autonomous transaction?
-An autonomous transactions is available from Oracle 8i.
-An autonomous transaction is an independent transaction that is initiated by another transaction.
-It must contain at least one Structured Query Language (SQL) statement
-Autonomous transactions allow a single transaction to be subdivided into multiple commit/rollback transactions.
-When an autonomous transaction is called, the original transaction (calling transaction) is temporarily suspended.
-The autonomous transaction must commit or roll back before it returns control to the calling transaction.
-Autonomous transactions can be nested. In theory, there is no limit to the possible number of nesting levels.
-An autonomous transaction is defined in the declaration of a pl/sql block. This can be an anonymous block, function, procedure, object method or trigger.
-This is done by adding the statement 'PRAGMA AUTONOMOUS_TRANSACTION;' anywhere in the declaration block.
Reply With Quote
  #83 (permalink)  
Old 05-28-2008
Junior Member
 
Join Date: May 2008
Location: hong kong
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
scuot is on a distinguished road
Re: Geeks - Tip of the Day

Why do you want to join our team?
Reply With Quote
  #84 (permalink)  
Old 05-28-2008
Expert Member
 
Join Date: Sep 2007
Posts: 738
Thanks: 22
Thanked 67 Times in 65 Posts
krishnaindia2007 is on a distinguished road
Re: Geeks - Tip of the Day

Trigger may have same name as that of other schema objects, such as tables, views, and procedures. However, to avoid confusion, this is not recommended.
Reply With Quote
  #85 (permalink)  
Old 05-29-2008
Expert Member
 
Join Date: Sep 2007
Posts: 738
Thanks: 22
Thanked 67 Times in 65 Posts
krishnaindia2007 is on a distinguished road
Re: Geeks - Tip of the Day

The BEFORE and AFTER options cannot be used for triggers created over views.
Reply With Quote
  #86 (permalink)  
Old 05-31-2008
Expert Member
 
Join Date: Sep 2007
Posts: 738
Thanks: 22
Thanked 67 Times in 65 Posts
krishnaindia2007 is on a distinguished road
Re: Geeks - Tip of the Day

Difference between Object Type and Record Type

Record type works only in Pl/Sql.

Object type gets stored in database.
We can use it both in sql and pl/sql.
Reply With Quote
  #87 (permalink)  
Old 05-31-2008
Expert Member
 
Join Date: Sep 2007
Posts: 738
Thanks: 22
Thanked 67 Times in 65 Posts
krishnaindia2007 is on a distinguished road
Re: Geeks - Tip of the Day

When an exception is raised inside a cursor for loop, the cursor is closed implicitly before the handler is invoked. So the value of explicit cursor are not available in the handler.
Reply With Quote
  #88 (permalink)  
Old 06-02-2008
Expert Member
 
Join Date: Sep 2007
Posts: 738
Thanks: 22
Thanked 67 Times in 65 Posts
krishnaindia2007 is on a distinguished road
Re: Geeks - Tip of the Day

If you want to execute the same sequence of statements for more than one exception then list the exception names separated by the keyword OR. We should not use the others exception in the list separated by OR. It must appear by itself
Reply With Quote
  #89 (permalink)  
Old 06-02-2008
Expert Member
 
Join Date: Sep 2007
Posts: 738
Thanks: 22
Thanked 67 Times in 65 Posts
krishnaindia2007 is on a distinguished road
Re: Geeks - Tip of the Day

A goto statement can’t be branch to an exception handler nor can it branch from an exception handler to the current block
Reply With Quote
  #90 (permalink)  
Old 06-04-2008
Expert Member
 
Join Date: Sep 2007
Posts: 738
Thanks: 22
Thanked 67 Times in 65 Posts
krishnaindia2007 is on a distinguished road
Re: Geeks - Tip of the Day

Compiler hint nocopy

By default in subprograms
IN parameter is passed by reference.
OUT and IN OUT parameters are passed by value.

When the parameters hold large data structures such as collections, records, and instances of object types, all this copying slows down execution and uses up memory. To prevent that, you can specify the NOCOPY hint, which allows the PL/SQL compiler to pass OUT and IN OUT parameters by reference.


NOCOPY is a hint and Oracle does not guarantee a parameter will be passed by reference when explicitly mentioned

By default, if a subprogram exits with an unhanded exception, the values assigned to its OUT and IN OUT formal parameters are not copied into the corresponding actual parameters, and changes appear to roll back. However, when you specify NOCOPY, assignments to the formal parameters immediately affect the actual parameters as well. So, if the subprogram exits with an unhandled exception, the (possibly unfinished) changes are not "rolled back."
Reply With Quote
  #91 (permalink)  
Old 06-05-2008
Expert Member
 
Join Date: Sep 2007
Posts: 738
Thanks: 22
Thanked 67 Times in 65 Posts
krishnaindia2007 is on a distinguished road
Re: Geeks - Tip of the Day

Cast Function

cast function converts one datatype to another.

It is available from Oracle 9i version.

Syntax:- cast ( { expr | ( subquery ) | MULTISET ( subquery ) } AS type_name )

Ex:- SELECT CAST(SUBSTR('ABZ123',-3,3) AS NUMBER) FROM DUAL

In the above example cast converts last three digits of string to number data type.
Reply With Quote
  #92 (permalink)  
Old 06-06-2008
Expert Member
 
Join Date: Sep 2007
Posts: 738
Thanks: 22
Thanked 67 Times in 65 Posts
krishnaindia2007 is on a distinguished road
Re: Geeks - Tip of the Day

How to find number of ‘e’s in a word ?

SELECT length('geekinterview.com') - length (replace ('geekinterview.com', 'e'))
FROM DUAL;
Reply With Quote
  #93 (permalink)  
Old 06-06-2008
Expert Member
 
Join Date: Sep 2007
Posts: 738
Thanks: 22
Thanked 67 Times in 65 Posts
krishnaindia2007 is on a distinguished road
Re: Geeks - Tip of the Day

A subprogram can have only one other exception in a program.
Reply With Quote
  #94 (permalink)  
Old 06-11-2008
Expert Member
 
Join Date: Sep 2007
Posts: 738
Thanks: 22
Thanked 67 Times in 65 Posts
krishnaindia2007 is on a distinguished road
Re: Geeks - Tip of the Day

Exceptions cannot be propagated across remote procedure calls
Reply With Quote
  #95 (permalink)  
Old 06-12-2008
Expert Member
 
Join Date: Sep 2007
Posts: 738
Thanks: 22
Thanked 67 Times in 65 Posts
krishnaindia2007 is on a distinguished road
Re: Geeks - Tip of the Day

ADD_MONTHS returns the date plus integer months.
If date is the last day of the month or if the resulting month has fewer days than the day component of date, then the result is the last day of the resulting month.Otherwise, the result has the same day component as date.

Code:
SQL> SELECT add_months('31-JAN-2008',1) 
  2  FROM dual;

ADD_MONTH
---------
29-FEB-08

SQL> SELECT add_months('31-JAN-2008',2)
  2  FROM   dual;

ADD_MONTH
---------
31-MAR-08
Reply With Quote
  #96 (permalink)  
Old 06-12-2008
Expert Member
 
Join Date: Sep 2007
Posts: 738
Thanks: 22
Thanked 67 Times in 65 Posts
krishnaindia2007 is on a distinguished road
Re: Geeks - Tip of the Day

If you call a SQL function with a null argument, then the SQL function automatically returns null. The only SQL functions that do not necessarily follow this behavior are CONCAT, NVL, and REPLACE.
Reply With Quote
  #97 (permalink)  
Old 06-13-2008
Expert Member
 
Join Date: Sep 2007
Posts: 738
Thanks: 22
Thanked 67 Times in 65 Posts
krishnaindia2007 is on a distinguished road
Re: Geeks - Tip of the Day

If a transaction obtains a row lock for a row, the transaction also acquires a table lock for the corresponding table. The table lock prevents conflicting DDL operations that would override data changes in a current transaction.

From Session1

Code:
SQL> UPDATE    emp
  2  SET       sal  = 5000
  3  WHERE     empno = 7369;

1 row updated.
From Sesion2

SQL> ALTER TABLE emp ADD (Dateofjoin DATE);
ALTER TABLE emp ADD (Dateofjoin DATE)
*
ERROR at line 1:
ORA-00054: resource busy and acquire with NOWAIT specified
Reply With Quote
  #98 (permalink)  
Old 06-15-2008
Expert Member
 
Join Date: Sep 2007
Posts: 738
Thanks: 22
Thanked 67 Times in 65 Posts
krishnaindia2007 is on a distinguished road
Re: Geeks - Tip of the Day

Aggregate functions can appear in
- select lists
- ORDER BY
- HAVING clauses

Single Row functions can appear in
- select lists
- WHERE clauses
- START WITH
- CONNECT BY clauses
- HAVING clauses.
Reply With Quote
  #99 (permalink)  
Old 06-15-2008
Expert Member
 
Join Date: Sep 2007
Posts: 738
Thanks: 22
Thanked 67 Times in 65 Posts
krishnaindia2007 is on a distinguished road
Re: Geeks - Tip of the Day

The first two function of the parse phase Syntax Check and Semantic Analysis happen for each and every SQL statement within the database irrespective of whether it is hard parsing or soft parsing.
Reply With Quote
  #100 (permalink)  
Old 06-16-2008
Expert Member
 
Join Date: Sep 2007
Posts: 738
Thanks: 22
Thanked 67 Times in 65 Posts
krishnaindia2007 is on a distinguished road
Re: Geeks - Tip of the Day

A transaction acquires an exclusive DML lock for each individual row modified by one of the following statements: INSERT, UPDATE, DELETE, and SELECT with the FOR UPDATE clause.
Reply With Quote
Reply

  Geeks Talk > Geeks Community > Geeks Lounge

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Hi Geeks! Another Freak here to join you :) itcoolgirl Get Together 1 12-12-2007 03:17 AM
Hey Geeks!!! maverick_dude Get Together 1 12-12-2007 03:12 AM
Geeks talk has 5000+ threads. debasisdas Site News & Announcements 0 07-31-2007 10:37 AM
GeekInterview Pager - communicate better with Geeks community admin Site News & Announcements 1 03-01-2007 06:32 AM
Welcome to Geeks Talk admin Site News & Announcements 0 05-13-2006 02:10 PM


All times are GMT -4. The time now is 08:32 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved