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 |
What is the Query to print out the individual total number of duplicate row in sql.
What is lexical units in pl sql?
what is a composite key ? : Sql dba
What is cte sql?
What is the benefit of foreign key?
Is left join inner or outer?
What is a native sql query?
HP Interview -2016 Unix 1) grep command in unix 2) what is set command
How to revise and re-run the last sql command?
I have one table,in that table (1)i have java1.1 version books are 2 and java1.5 version books are 4. (2).Net2.0 books are 3, .Net3.5 books are 2 (3)ABC1.6 books are 4, ABC2.0 books are 3. Now i want output is like Book Count Java 6 .Net 5 ABC 7 For this i need sql query, please help me if anyone how to get this result. Thanks, Seenu
What is a stored procedure in sql with example?
What is the difference between stored procedure and view?
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)