GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Tech FAQs  >  PL/SQL
Go To First  |  Previous Question  |  Next Question 
 PL/SQL  |  Question 81 of 157    Print  
How to display the contents of a current record fetched in a reference cursor?

  
Total Answers and Comments: 2 Last Update: February 17, 2007     Asked by: madhuk17 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
February 13, 2007 13:26:34   #1  
geetha24 Member Since: March 2006   Contribution: 27    

RE: How to display the contents of a current record fe...
To display the cursorOPEN v_cursor FOR SELECT ename, empno, deptno FROM emp WHERE deptno = p_deptno ORDER BY ename;LOOP FETCH v_cursor INTO v_ename, v_empno, v_deptno; EXIT WHEN v_cursor%NOTFOUND; DBMS_OUTPUT.PUT_LINE(v_ename || ' | ' || v_empno || ' | ' || v_deptno); END LOOP; CLOSE v_cursor;
 
Is this answer useful? Yes | No
February 17, 2007 05:43:49   #2  
Vishakha        

RE: How to display the contents of a current record fe...

 

declare

cursor v_cursor is

      select empno, empnm, empdept from emp where empdept = 10;

begin

      open v_cursor;

      loop

      fetch v_cursor into c_empno, c_empnm, c_empdept;

      exit when v_cursor%notfound;

      dbms_output.put_line(c_empno || ' | ' || c_empnm || ' | ' || c_empdept );

      end loop;

      close v_cursor;

end;


 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : Cursor is a private Sql area which is used to execute sql statements and store Processing information, Where as Refcursor is a data structure which points to an object which inturn points to memmory LocationThe advantage Refcursor over Normal Cursor is1.We ...

Latest Answer : By using cursor parameters we can pass the value dynamically. So that cursor can fetch data as per parameter ...
Read Answers (4) | Asked by : Kishorebabukm

What is cursor? Explain the types of cursor and write one implicit cursor program to check how many records deleted from table?
Read Answers (5) | Asked by : indranil

In PL/SQL I need to get like this scenario. if I am doing manipulation on a table, I need to display a record as Non-Updateable. It need to show a message to the user. How it is possible.Thanks in Advance.
Read Answers (7) | Asked by : murthy

Hi, in Cursors this is the Scenario.if i am manipulating the data of a table which has 10 records,i need to go to the 5th record.how is it possible?What is the Exact usage of Ref Cursor?
Read Answers (1) | Asked by : murthy

Latest Answer : Ref cursor is like a pointer to the cursor variable which is opened at the servecr side and pass the data as a whole and not one by one . ...

Latest Answer : Yes you can pass the whole select statement of the cursor dynamicaly, see ref_cursors.There is also a system package sys.dbms_sql which allows everything to make dynamically. ...
Read Answers (5) | Asked by : sweety

I have written a procedure in which the cursor is fetching 2 lakh records. I would like to pass on these 2 lakh records as an in paramter to the other procedure. How can we achieve this logic?
Read Answers (4) | Asked by : Srinivas

Latest Answer : Hi Friend!         If you deal with better performance You have to refer REF CURSOR and its more advantage and effecient of Exeqution.Thanks&RegdsRamki ...
Read Answers (1) | Asked by : chandu

What would be the o/p for this ....declarecursor c1 is select * from employees;emp_rec c1%rowtype;beginopen c1;delete from employees;loopfetch c1 into emp_rec;exit when c1%notfound;end loop;close c1;end;tell me what is active set ?why you need cursors?and what is going to happen when you use for update clause in cursor declarationwhy use nowait clause what is its use


 Sponsored Links

 
Related Articles

jQuery Reference

jQuery Reference Guide by Jonathan Chaffer and Karl Swedberg A Comprehensive Exploration of the Popular JavaScript Library jQuery Reference Guide packtpub com jquery reference guide Open Source book Anatomy of a jQuery Script He s got a brand new start Now he s a happy guy Categ
 

jQuery - Marking the Current Page

Learning jQuery Marking the Current Page Our pager can be made more user friendly by highlighting the current page number We just need to update the classes on the buttons every time one is clicked mosgoogle geshibot lang php" var pager ; for var page 0; page numPages; page pag
 

What is difference between call by value and call by reference in function?

The arguments passed to function can be of two types 1. Values passed 2. Address passed The first type refers to call by value and the second type refers to call by reference. For instance consider program1 main() { int x=50, y=70; interchange(x,y); printf(“x=%d y=%d”,x,
 

The Current State of Enterprise Resource Planning

The Current State of Enterprise Resource Planning To analyze the future trends of Enterprise Resource Planning it is first important to look at the current state of this industry While this tool was originally used for manufacturing and human resources it is now being used in areas such as customer
 

How To Manage Current and Historical Information Within Your Data Warehouse

How To Manage Current and Historical Information Within Your Data Warehouse In order for a company to use a data warehouse successfully it must be designed so that users are able to analyze historical and current information There are a number of things that will result from this technique and they
 

Call by Value and Call by Reference

Call by Value and Call by Reference In this tutorial you will learn about C Programming What is difference between call by value and call by reference in function mosgoogle The arguments passed to function can be of two types namely 1 Values passed 2 Address passed The first type refers to call by
 

Tips To Improve Your Current Resume

Tips To Improve Your Current Resume If you are thinking about looking for a new job you might want to take a look at your old resume While your resume is a work in progress it’ s not always a good idea to simply input new information into the old format and assume it’ s good enou
 

CSS Tutorials : Lesson 12 Elements Display

CSS Tutorials Lesson 12 Elements Display In this tutorial you will learn about Cascading Style Sheets CSS Elements Display Float Position Visibility Cursor Vertical align and z index mosgoogle The display properties enable you to set the way to display elements and the position of the element rela
 

SCJP 5 : Chapter 3. API Contents (Part-5)

SCJP 5 Chapter 3 API Contents Part 5 Write code that uses standard J2SE APIs in the java util and java util regex packages to format or parse strings or streams For strings write code that uses the Pattern and Matcher classes and the String split method Recognize and use regular expression patterns
 

SCJP 5 : Chapter 3. API Contents (Part-4)

SCJP 5 Chapter 3 API Contents Part 4 Use standard J2SE APIs in the java text package to correctly format or parse dates numbers and currency values for a specific locale; and given a scenario determine the appropriate methods to use if you want to use the default locale or a specific locale Describ
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape