Hi
I have the following code to find the columns that make up a primary key for a table.
Results will differ for other tables
select cols.column_name colname
from all_constraints cons, all_cons_columns cols
where cols.table_name = trim (upper ('MY_TABLE'))
and cons.constraint_type = 'P'
and cons.constraint_name = cols.constraint_name
and cons.owner = cols.owner
order by cols.table_name, cols.position
which returns
COLUMN_NAME
MY_COL_1
MY_COL_2
MY_COL_3
I need to write to a log table the
ID
FIELD_NAME
FIELD_VALUE
FIELD_NAME would be the concatinated primary key column names
and
FIELD_VALUE would be the concatinated primary key values
Not sure where to start
Any help appreciated
Regards
Gus