Skip to content

RowId FAQ

Frequently Asked Questions about RowId

Q: What do I need to do to make my existing DataFlex application run under DataFlex 11?

A: Nothing - it should just work.

Q: What exactly is the RowId style of programming?

A: Every table in DataFlex must have a unique identifier. This is used to:

  1. Quickly refind records.
  2. Check if a record exists.
  3. Check if two records are the same.
  4. Assign/clear a Record identity variable.

If your table has a way of uniquely identifying a row, that identifier may be used. This record identifier is referred to as RowId. In DataFlex, a new RowId data type has been created for this purpose. We had to create a new type because the ID can be of any type or combination of types. Therefore, we made it a special data type. We created functions to work with this type.

Those functions are:

GetRowid(iTableNumber)
FindByRowid(iTableNumber, riRowId)
NullRowID()
IsNullRowId(riId)
IsSameRowId(riId1, riId2)

With these functions, you can do all of the things that you used to do with Recnum.

Q: My tables all have Recnum. Can I use the RowId style of programming?

A: Yes, that's the whole point of RowId. It uses the same syntax with all types of tables.

Q: Do I have to use the RowId style of programming with my Recnum tables?

A: No, your current Recnum syntax will work fine.

Q: My existing application is running on an SQL server (e.g., MSSQL, Oracle) and it has Recnum fields. Should I remove those fields and assign a RowId such as the primary key?

A: You could do this, but I probably wouldn't bother. If you control the table definition, a Recnum field works just fine.

Q: When I create new tables with my SQL database, should I continue to define a Recnum field?

A: It's up to you. There is nothing wrong with using Recnum. If you have a large Recnum-based system, there may be little advantage to creating a few tables that don't have Recnum.

Q: Should I convert all of my existing code that uses Recnum style programming to RowId programming style?

A: At some point, you could do this, but I would not make it a big priority. As long as your tables have a Recnum, your current code is fine.

Q: As I write new code, should I use the new RowId syntax or the Recnum syntax?

A: You can use either, but I'd probably suggest you start using the new syntax. It's cleaner.

Q: I use the embedded database. Since the embedded database always uses Recnum, is there any reason to start using the new RowId programming style?

A: Yes. The RowId programming style works with Recnum and non-Recnum tables. Its syntax is more straightforward and encourages you to not use Recnum in the wrong places (e.g., in relationships). Also, if you use RowId style programming, you always have the option of integrating your data with other data sources that do not have Recnums.

Q: I build 3rd party classes. What should I do?

A: I'd convert these to use all RowId style syntax. Depending on your class, you may not need to make any changes at all. If you do, it should not be that hard. We plan on putting out a guide showing you what to look for and how to change it. We've done this with all of our classes, so we've got a pretty good sense of what's involved.

Q: I'm starting a new project using an SQL server. What should I do?

A: In this case, I would not create Recnum fields in your table and I would use all RowId programming style.

Q: My data is shared with older DF and DataFlex applications. Is this ok?

A: As long as your table has a Recnum field (required for your old applications), everything will work fine. Your DataFlex 11 application can use RowId or Recnum syntax. Your older applications will use Recnum syntax. If you are sharing source code between revisions, then you must share at the oldest version level.

Q: My data is accessed using older drivers that were built before non-Recnum support. Will this work?

A: Yes, DataFlex 11 works fine with older drivers - of course, your tables will still need a Recnum field, just like they do now.

Q: I am migrating my application, still using Recnum and I am having problems. What should I do?

A: Let us know about this right away! The new RowId changes should be completely backwards compatible. If there are problems, let us know and we will help to resolve them.