Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to display the contents of a current record fetched in
a reference cursor?

Answer Posted / karthik

U define a variable in the SQL Prompt as ref cursor Before
that u have to write a procedure with a sys ref cursor as a
inout parameter.Then execute the procedure by passing the
variable defined in the SQL prompt and print the variable It
will display the records.

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 Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a delimiter in sas?

981


Explain scalar functions in sql?

1018


what is sql? : Sql dba

973


How to select unique records from a table?

1002


What is pl sql variable?

938


what is data manipulation language? : Sql dba

949


Show the two pl/sql cursor exceptions.

1110


What can sql server reporting services do?

1057


What are the different types of tables in sql?

931


what is sql in mysql? : Sql dba

1123


What is pl sql quora?

1072


What is dml and ddl?

901


what is union? : Sql dba

967


what is the difference between nested subquery and correlated subquery?

987


Why having clause is used in sql?

931