>Here's a simplified version of how I append in my data:
>
>*- Update Source Tables with New Data
>SELECT FileListCursor
>GO TOP
>DO WHILE NOT EOF()
> SCATTER FIELDS SystemCode, Ref_num MEMVAR
> m.Filename = m.SystemCode+"filesuffix.fla"
>
> SELECT SourceDataTable
> APPEND FROM (m.FileName)TYPE DELI
> REPLACE ALL ref_num WITH m.ref_num FOR EMPTY(ref_num)
>
> SELECT FileListCursor
> SKIP
>ENDDO
>
>*- Begin Source Table Specific Data Manipulation
>
>
>(ok my fingers are crossed here gang, and I'm hoping all the gurus out there don't make me start thinking about how to rewrite my whole framework after seeing this message) =D)
No, it's just what was proposed here already. Instead of "&& This Was", you could just put this:
Replace All PK with Gimme_Pk() for empty(PK)
where gimme_pk is a function which delivers the new value of the PK. Case closed.
If you're sure you have to do this for new records only (you seem to be adding records from more *.fla files), you could fill the PKs only once, when you exit this loop, or
_rcn=recc()+1
APPEND FROM (m.FileName)TYPE DELI
if _tally>0
go _rcn
REPLACE REST ref_num WITH m.ref_num FOR EMPTY(ref_num)
go _rcn
Replace REST PK with Gimme_Pk() for empty(PK)
endif
This isn't greatly different, but might speed things up a little.