If you are inserting data into an existing file or table, you cannot use DataTools to create a new column/field in the file or table because the schema of the target is locked and restricted to what already exists. You would need to create the new column/field in the file or table prior to connecting to it as your target in DataTools.
However, if you are creating a new target file or table, you can insert a row in the target schema grid on the Map Fields tab and populate each record with an incremental number, starting with any number you need. Here are the basic steps...
To insert a new row into the target schema in the Map Fields tab:
Place your mouse on the leftmost square of the row below where you want to insert the new row, and click once to highlight the row.
Press the INSERT key on your keyboard. This will add a blank row.
Enter a field name and set the data type and size for the new row.
To insert row numbers in their most simple format (1, 2, 3, etc.):
In the Target Field Expression cell for the new row, enter the following expression using the RIFL expression builder: Serial(0).
To insert row numbers with a specific format (Example: 0001, 0002, 0003, etc.):
In the Target Field Expression cell for the new row, enter the following expression using the RIFL expression builder: Format(Serial(0), "0000").
For additional details on the Serial Function and/or the Format Function, open Help in the DataTools product, go to the Search tab, and enter "Serial" or "Format" and open the help topic for that RIFL Function.
Please browse our site—but you must be a registered user to download files, purchase products, leave comments, or post in the forums. It's quick, easy and free to become a member of the Pervasive DataTools community.
RE: Row Number
Hi pfarnell,
If you are inserting data into an existing file or table, you cannot use DataTools to create a new column/field in the file or table because the schema of the target is locked and restricted to what already exists. You would need to create the new column/field in the file or table prior to connecting to it as your target in DataTools.
However, if you are creating a new target file or table, you can insert a row in the target schema grid on the Map Fields tab and populate each record with an incremental number, starting with any number you need. Here are the basic steps...
To insert a new row into the target schema in the Map Fields tab:
To insert row numbers in their most simple format (1, 2, 3, etc.):
To insert row numbers with a specific format (Example: 0001, 0002, 0003, etc.):
For additional details on the Serial Function and/or the Format Function, open Help in the DataTools product, go to the Search tab, and enter "Serial" or "Format" and open the help topic for that RIFL Function.
- Jo