Hi
I am new to Oracle having a SQL Server background. I like the richness of Oracle, but I am stumped on how to create a stored procedure that selects the columns from a table.
Like this:
create or replace procedure "P1"
is
begin
select * from T;
end;
/
The code to create Table T is shown:
whenever sqlerror continue
drop table T;
create table T
(
x number(2)
,y varchar2(1)
);
insert into T values(10,'a');
insert into T values(20,'b');
insert into T values(30,'c');
insert into T values(40,'d');
insert into T values(50,'e');
select * from T;
The stored procedure will be called in a report, so I wish to access the contents of table T as follows:
exec P1
Can someone please advise on how to do this. Thankyou
regards
Mark
I am new to Oracle having a SQL Server background. I like the richness of Oracle, but I am stumped on how to create a stored procedure that selects the columns from a table.
Like this:
create or replace procedure "P1"
is
begin
select * from T;
end;
/
The code to create Table T is shown:
whenever sqlerror continue
drop table T;
create table T
(
x number(2)
,y varchar2(1)
);
insert into T values(10,'a');
insert into T values(20,'b');
insert into T values(30,'c');
insert into T values(40,'d');
insert into T values(50,'e');
select * from T;
The stored procedure will be called in a report, so I wish to access the contents of table T as follows:
exec P1
Can someone please advise on how to do this. Thankyou
regards
Mark