Kirix Support Forums

How to add a row and make it numeric ID

Please post any help questions, requests or other feedback here.

How to add a row and make it numeric ID

Postby evansalliance on Fri Mar 18, 2011 2:16 pm

Sorry for the newbie question but I am not a data guy.. Just saddled with a job way over my head.

I have a large 50mm record DB. There is no ID or numeric identified in the table.

I can add a column but don't know how to get it to add a numeric ID.

Ultimately I want to break this file down to 300mb +/- chunks so I can import it into another application.

Any help appreciated.
Registered User
Posts: 1
Joined: Fri Mar 18, 2011 2:07 pm

Re: How to add a row and make it numeric ID

Postby Aaron on Fri Mar 18, 2011 2:36 pm

First, to add a numeric ID to the table:

1. Open the table.
2. Right-click on one of the column headers and select "Insert Calculated Field".
3. In the formula builder, enter in the following formula: recno()
4. In the formula builder, change the field name to "row_id" or something similar, the width to 12 and the number of decimal places to 0, then press "OK".
5. Right-click on the newly-created calculated column header and select "Convert To Fixed Field"; this converts the field from a calculated field to a field with fixed values, so that when you split up the tables, the row IDs will remain the same.

Now, to split up the table, there's two approaches:

1. In the first approach, copy out the records manually using ranges of IDs. To do this, select Data->Copy Records from the toolbar, then in the formula builder, enter in the following formula: row_id > 0 and row_id <= 1000000
2. Then press OK to copy out the first million rows; of course, select a range that's appropriate. Repeat for each subsequent range.
3. In the second approach, you can split the file into any number of partitions using Tools->Divide Tables.
4. Once you've opened the tool, select the table you want to split, select the option from the combo to divide by the table size, then enter 300.

Aaron Williams
Kirix Support Team
User avatar
Kirix Support Team
Posts: 120
Joined: Fri Dec 16, 2005 3:01 pm

Return to Strata Help & Feedback