How to display the contents of a current record fetched in
a reference cursor?
Answers were Sorted based on User's Feedback
Answer / 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 |
How can check sql version from command line?
how will be date change into string
How to write a single statement that concatenates the words ?hello? And ?world? And assign it in a variable named greeting?
What are the two types of periodical indexes?
What is pl sql record in oracle?
If the application is running very slow? At what points you need to go about the database in order to improve the performance?
Is sql a backend language?
Why do we use view in sql?
Do we need commit after truncate?
What is the difference between left outer join and left join?
What is a heap in sql?
Explain architecture of sql server notification services?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)