Primary Keys Definition

SSuhaib

Member
Hi Experts,

Is it possible to create primary key for a field during database design in Progress using data dictionary. Or, is it possible to create it by using dataservers or ODBC/JDBC.

Using VSTs can I query which table(s) contain primary key or foreign key or unique constrainst created using either Progress Data dictionary or through dataservers or ODBC/JDBC.

Thanks
 
You can not mix and match modifying the database scheme via ABL and SQL. You can't modify the database schema which was created with ABL ( data dictionary tool ) with SQL. Furthermore any database schema that you create with SQL is not known to ABL.

There might be a misunderstanding as to the fact the _File, _Field etc. are not VST - they are real tables, meta schema tables. But you can query them.

The Progress/OpenEdge database does not support constraints.

Heavy Regards, RealHeavyDude.
 
Heavy thanks RHD!

It might also be not possible to run any DML / DDL statements using procedure editor for table created in data dictionary or SQL.
Also, what info do _SYS* table contain.

Regards.
 
Progress does not support "constraints" in the sense that a SQL database does.

But you can have unique indexes. And you are allowed to designate an index as "primary". The only thing special about a primary index is that is is the default dump order and it is a tie breaker in the 4GL index selection process.

To see the indexes for a table:
Code:
find _file no-lock where _file-name = "customer".

for each _index no-lock where _index._file-recid = recid( _file ):

  display
    _index-name
    "Primary" when ( _file._prime-index = recid( _index ))
    "Unique"  when ( _index._unique = yes )"*" format "x" when ( _file._prime-index = recid( _index ))
    "Word"    when ( _index._wordidx <> ? )
  .

  for each _index-field no-lock where _index-recid = recid( _index ):
    find _field no-lock where recid( _field ) = _index-field._field-recid.
    display
      _field-name
      _data-type
    .
  end.

end.
 
You must understand that the procedure editor only supports ABL. Everything that you execute from it gets compiled on-the-fly with the ABL compiler and is therefore NOT SQL. Although it understands some rudimentary SQL89 - it is still executed against the ABL database engine. I would strongly recommend you not to use it. IMHO it is a leftover from the times where Progress did not have a SQL engine for their database to provide "something" - think of it a deprecated. IMHO it should have been kicked out of the product long time ago.

Heavy Regards, RealHeavyDude.
 
Back
Top