Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...What a great service! This is the best site I've ever seen!!! It totally restores my faith in humanity when people take time out to help other people..."

Geography

Where in the world do Tek-Tips members come from?

Need to to create a Global Temp table while using a Cursor

Frenchfry (Programmer)
26 Dec 11 22:14
Hello,

I am using a Procedure, using a Cursor within and now I need to create a Global Temp table.

Can someone provide a example of the use of all three.

Thanks in Advance
SantaMufasa (TechnicalUser)
27 Dec 11 13:15

CODE

create global temporary table FF (x number)
       on commit preserve rows;

Table created.

create or replace procedure FrenchFry is
begin
    for x in (select salary from s_emp) loop
        insert into FF values (x.salary);
    end loop;
    commit;
end;
/

Procedure created.

execute FrenchFry

PL/SQL procedure successfully completed.

select * from ff;

         X
----------
      3000
      1450
      2000
      1450
      1550
      1200
      1250
      1100
      1300
      1307
      1400
      1490
      1515
      1525
      1450
      1400
       940
      1200
       795
       750
       850
       800
       795
       860
      1100

25 rows selected.
Let us know if this is what you wanted.

santaMufasa
(aka Dave of Sandy, Utah, USA)
"People may forget what you say, but they will never forget how you made them feel."

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close