Home » SQL & PL/SQL » SQL & PL/SQL » pl/sql ?
pl/sql ? [message #1232] Fri, 12 April 2002 12:29 Go to next message
Jack Brown
Messages: 4
Registered: April 2002
Junior Member
I am aware that in pl/sql only a subquery can be written with a select statement. Is there any way to get'select * from table;" output from a pl/sql code.
Re: pl/sql ? [message #1234 is a reply to message #1232] Fri, 12 April 2002 13:16 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
u can get any columns in output.
-----------------------
SQL> get h
1 set serveroutput on;
2 declare
3 cursor c1 is select * from emp;
4 begin
5 for mag in c1 loop
6 dbms_output.put_line(mag.ename||','||mag.empno||', '||mag.sal);
7 end loop;
8* end;
SQL> @h
SMITH,7369, 800
ALLEN,7499, 1600
WARD,7521, 1250
JONES,7566, 2975
MARTIN,7654, 1250
BLAKE,7698, 2850
CLARK,7782, 2450
SCOTT,7788, 3000
KING,7839, 5000
TURNER,7844, 1500
ADAMS,7876, 1100
JAMES,7900, 950
FORD,7902, 3000
MILLER,7934, 1300

PL/SQL procedure successfully completed.

SQL>
Re: pl/sql ? [message #1299 is a reply to message #1232] Thu, 18 April 2002 09:45 Go to previous message
Jack Brown
Messages: 4
Registered: April 2002
Junior Member
Where did u get mag from
"for mag in c1 loop"
Previous Topic: pl/sql
Next Topic: Order by clause in Views
Goto Forum:
  


Current Time: Thu Apr 18 02:14:51 CDT 2024