Copy Temp-table in One-go

ajaysheth

Member
Hello All:

I need to copy all records from a Temp-table say "tt_source" to a temp-table "tt_target". I dont want to use the usual buffer-copy which loops through each record at one-time.

Is there a way to take a snap-shot of the temp-table and copy it as it is as another temp-table with a different name?

Worst case, i will have to use buffer-copy, but my customer insist to dump in one-go.

Any ideas/thought process is most welcome.

Cheers,
AJ.
 

parul

Member
Which version of progress?
You can have a look at FILL method if on OpenEdge.

Not sure if it is upto your needs.

-Parul.
 

Casper

ProgressTalk.com Moderator
Staff member
Is there a way to take a snap-shot of the temp-table and copy it as it is as another temp-table with a different name?

Worst case, i will have to use buffer-copy, but my customer insist to dump in one-go.

Is there a specific reason to copy this temp-table?
Is there a specific reason not to use buffer copy?

In OE 10.something you could use:
Code:
[I]targ-tt-handle:[/I]COPY-TEMP-TABLE( [I]src-tt-handle [/I][, [I]append-mode[/I] 
[, [I]replace-mode[/I] [, [I]loose-copy-mode[/I] ] ] ] )

or in earlier versions (this is a bit lame) you can pass the temp-table as an input table to another procedure with the other temp-table defined as input parameter table :) (This would be a copy of the entire table as well, but you don't have to program it...)

Casper.
 
you can pass the temp-table as an input table to another procedure with the other temp-table defined as input parameter table :) (This would be a copy of the entire table as well, but you don't have to program it...)

This one seems to be a good idea, but based on ur usage u can jus select anyone as per Mr.Casper's idea...

As well as i don find the need for having a copy of the same temp table!!
Is it really necessary... Check it out once and then use it...
 

ajaysheth

Member
All,

Thanks for all your replies.

I am using Progress OE 10.1b.

I dont wish to have any additional callling programs to achieve this. I am not using buffer-copy copy since buffer-copy iterates record-by-record. I am expecting the source temp-table to have a million record.

Rgds,
AJ.
 

Casper

ProgressTalk.com Moderator
Staff member
I am expecting the source temp-table to have a million record.

You really make me curious.

Do you know that once you have a temp-table you can pass it by-reference to any procedure within the same sessions you would like to have it available in?

Could you perhaps tell us what you are trying to achieve with copying the temp-table? (or with creating such a big temp-table in the first place?)
Maybe there are other, better solutions to do this.

Casper.
 

WillieG

New Member
I may be wrong, but can't you just define a second buffer for the temp-table, then you can use the same temp-table but just with a different name?
As Casper pointed out, it all depends on what you would like to do with the "copy" of the temp-table.

Willie
 
Top