Consultor Eletrônico



Kbase P133932: How to find a unique index of a Progress OpenEdge table with a SQL query
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   08/08/2008
Status: Unverified

GOAL:

How to find a unique index of a Progress OpenEdge table with a SQL query

GOAL:

How to query metaschema tables with SQL to find unique indices of ABL / 4GL tables

GOAL:

How to find the uniqueness constraint violation when error 7518 is generated by a SQL INSERT

FACT(s) (Environment):

All Supported Operating Systems
Progress 9.1E
OpenEdge 10.x

FIX:

The following query will return a row for each field that is part of a unique index for any non-system ABL table.
SELECT "_File"."_File-Name",
"_Index"."_Index-Name",
"_Index-Field"."_Index-seq",
"_Field"."_Field-name"
FROM pub."_File", pub."_Field",
pub."_Index",
pub."_Index-Field"
WHERE "_File-Name" < '_'
AND "_Field"."_File-recid" = { fn CONVERT ( "_File".ROWID , SQL_INTEGER ) }
AND "_Index"."_File-recid" = { fn CONVERT ( "_File".ROWID , SQL_INTEGER ) }
AND "_Index"."_Unique" = 1
AND "_Index-Field"."_Index-recid" = { fn CONVERT ( "_Index".ROWID ,SQL_INTEGER ) }
AND { fn CONVERT ( "_Field".ROWID , SQL_INTEGER ) } = "_Index-Field"."_Field-recid"
ORDER BY "_File"."_File-Name",
"_Index"."_Index-Name",
"_Index-field"."_Index-seq"