Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 24 JAN 2001 08:10:38PM John Wood wrote:

I am trying to integrate records from two similiar tables. The two tables' dictionaries are identical. So, I would like all data copied from the source table rows to the destination table but need new sequential numbered keys assigned to avoid overwriting like keyed rows in the destination table. I am copying 400-500 records at a time so manually specifying target keys is not an option. I have that feeling there's an incredibly obvious solution and would be very greatful to anyone who would offer it up. email:[email protected]


At 24 JAN 2001 11:55PM Jonathan Bird wrote:

Seems like a small RBasic programme would be in order.

how about this (not tested, of course!) and would do better with a few messages to the status line to let you know what is happening, too.

COUNTER=0

DONE =0

OPEN 'SOURCETABLE1' TO INFILE1 THEN

OPEN 'SOURCETABLE2 TO INFILE2 THEN
  OPEN 'DESTINATIONTABLE' TO OUTFILE THEN
    SELECT INFILE1
    LOOP
      READNEXT ID ELSE
        DONE=1
      END
      READO REC FROM INFILE1,ID THEN
        COUNTER += 1
        WRITE REC ON OUTFILE,COUNTER ELSE
           FSMSG()
        END
      END
    UNTIL DONE
    REPEAT
    done=0
    SELECT INFILE2
    LOOP
      READNEXT ID ELSE
        DONE=1
      END
      READO REC FROM INFILE2,ID THEN
        COUNTER += 1
        WRITE REC ON OUTFILE,COUNTER ELSE
           FSMSG()
        END
      END
    UNTIL DONE
    REPEAT
  END
END

END


At 24 JAN 2001 11:56PM Jonathan Bird wrote:

Uuurgh! what happened to my INDENTATIONS after posting???


At 25 JAN 2001 09:01AM Don Miller - C3 Inc. wrote:

You can mostly do what Johnathan said. It's probably wise to get the current value of %SK% from the "Master" table and increment that value by 1. At end of job, update %SK% with the final value. You might also test to make sure that you're not overwriting an existing record. If you get a hit on the read, bump the counter by 1 and keep trying until you don't get a hit.

Don Miller

C3 Inc.


At 25 JAN 2001 09:51AM [url=http://www.sprezzatura.com" onMouseOver=window.status=Click here to visit our web site?';return(true)]The Sprezzatura Group[/url] wrote:

or if you'd prefer not to cut code , export them to an ascii file then reimport them having the system assign the key!

The Sprezzatura Group

World Leaders in all things RevSoft


At 25 JAN 2001 04:12PM Don Miller - C3 Inc. wrote:

Indentations vanish .. like other things on the web. There's a great bit-bucket in the sky .. reminds me of write only memory.

Cheers…

Don Miller

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/5ac3095e0d742a5a852569df000677ae.txt
  • Last modified: 2023/12/28 07:40
  • by 127.0.0.1