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. |
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 ...
|
|||||||
|
|||
|
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. |
| Sponsored Links |
|
|||
|
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. |
|
|||
|
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.
|
|
|||
|
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
|
|
|||
|
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." |
|
|||
|
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. |
|
|||
|
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
|
|
|||
|
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.
|
|
|||
|
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. 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 |
|
|||
|
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. |
|
|||
|
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.
|
|
|||
|
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.
|
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
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 |