Skip to Main Content

SQL Developer

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to create a temp table in package.procedure?

Dee102Mar 11 2021

It has error in both places (1) before BEGIN and (2) after BEGIN. What is the correct syntax? Can I select * from CityTemp? Thanks.
PROCEDURE TempTable AS
create global TEMPORARY table CityTemp
(
city varchar2(20),
state varchar2(2),
county varchar(20)
);
BEGIN
insert into CityTemp
select * from citystate;
select * from CityTemp;
END;

This post has been answered by L. Fernigrini on Mar 11 2021
Jump to Answer
Comments
Post Details
Added on Mar 11 2021
5 comments
10,348 views