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 to load data files into tables with 'mysqlimport'? : Sql dba
What is the largest value that can be stored in a byte data field?
How does left join work in sql?
Explain how exception handling is done in advance pl/sql?
What is the difference between sum and count in sql?
How do you concatenate in sql?
How do I run pl sql in sql developer?
i want to display 1 to 10 numbers using one select statement.
18 Answers HCL, Nyros, Oracle,
What is numeric function sql?
In testing where do we use sql language and how it helps in testing?
What is serial sql?
who introduced sql?
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)