How to find the template record for a partitioned table - Forum - OpenEdge Development - Progress Community

How to find the template record for a partitioned table

 Forum

How to find the template record for a partitioned table

This question is not answered

Our framework contains following code to find the default values for a record.

{&file} contains the name of the table.

find _file where _file-name = "{&file}" no-lock.
find {&file} where recid({&file}) = _file._template no-lock.

This finds the template record for that table. <gripe>Unfortunately instead of having the compiler automatically translate recid to rowid </gripe> Progress decided it was better to make sure that the code gives a runtime error.

RECID function not supported for this table. (552)

How can you access the template record for a partitioned table. ?

We have another option

do transaction:
    create {&file}.
    /* "template" available */
    undo. /* get rid of "template" record */
end.

but that causes error 450 for the partitioned table. The same code works fine if the table is not partioned

All Replies
  • I ran into a similar issue with multi tenant tables... I would be a little shocked if the explanation (and workaround) in this KB doesn't also apply to partitioned tables.

    knowledgebase.progress.com/.../000043883

  • The problem is not the use of RECID in this case. Even if it was using ROWID, it would still not work because the template record is not accessible directly for multi-tenant or partitioned tables. The info in the KB mentioned above applies to partitioned tables as well.

    Now the error you are getting when you tried the CREATE / UNDO code looks like a bug. That error is not expected so you should report it to technical support.