Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy data of table tps

Status
Not open for further replies.

FOlivera

Programmer
Jan 9, 2002
5
MX
How can I copy data of several tables tps at other table tps

thanks for your help
Francisco Olivera
 
Well, Francisco Olivera (Do I know ya???), there are several solutions, depending on your target file:

1. If The "Others" have the same Declaration as the target file, I mean, if you have Several Instances of the same file; an Alias and a Simple process like this will do:

Code:
!Target, PRE(TAR)
!AliasTarget,PRE(ALIASTAR)
Target{PROP:NAME}='C:\Target.tps'
Access:Target.Open
Access:Target.UseFile

AliasTarget{PROP:NAME}='C:\Source.tps'
Access:Target.Open
Access:Target.UseFile

LOOP UNTIL ACCESS:AliasTarget.next()
  TAR:RECORD = ALIASTAR:RECORD  !COPY ALL FIELDS
  !TAR:RECORD :=: ALIASTAR:RECORD  !copy fields w/same label
  Access:Target.PrimeRecord()   !prime any autoinc. field
  Access:Target.Insert()        !Insert Any Field.
END
Access:Target.Close
Access:AliasTarget.Close

Well, the code above is very simplist, you must to ensure any key that has relation to child files to correctly RI that files.

Any ways, hope this help ya!.

bye. -----
carabez@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top