If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Corel Paradox > Renumber ID

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-16-06, 09:32
fieldsg fieldsg is offline
Registered User
 
Join Date: Sep 2006
Posts: 11
Renumber ID

Looking to run a script that will duplicate a Paradox DB. I have a "test" db that has 1382 records in it. I want to duplicate this to around 30k to run some tests on. We are rewriting our software from Paradox (before my time), and thus I need some help.

The ID Field is N, but am not sure of the proper command to do this. I need to update this field so that when it duplicates the DB it makes the record that is presently #1 and makes it #1383, and so on. So, if anyone could be of assistance on this I would be much appreciative.

Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 01-28-07, 07:46
Shores Shores is offline
Registered User
 
Join Date: Aug 2003
Location: Bologna - Italy
Posts: 209
You should write a script which opens a tcursor on the table, then reads in the number of records, and then repeats this number of times the insertion of another record using another tcursor on the same table.

You sholud then, just before saving each new record, generate another ID for the new record , for example by using CMAX function on the second tcursor;

Otherwise, you can duplicate the table with a different name, and alter it to make the ID field autoincrement, and then the procedure i described can be done without setting the new record ID, since it will be autogenerated by pdox.
__________________
The only failure is not trying to do it.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On