Thanks for your reply
@Rob Fitzpatrick and
@TomBascom and sorry for delay in my response.
I want to know the field name from _cdc-change-tracking table when field of any database table changes. _cdc-change-tracking table has one field _change-fieldmap (datatype is RAW) that stores field name in RAW format. I want to know field name (in Char) from this field.
Steps:-
1. I have updated Name from customer table so it has created corresponding record in _cdc-change-tracking table.
Code:
FIND FIRST customer EXCLUSIVE-LOCK.
UPDATE NAME.
2. As I mentioned, _change-fieldmap is RAW type so I cannot display that field. I exported whole record of _cdc-change-tracking that was created after I updated customer name.
Code:
OUTPUT TO "cdc-change-tracking.txt".
FOR EACH _cdc-change-tracking NO-LOCK:
EXPORT _cdc-change-tracking.
END.
OUTPUT CLOSE.
cdc-change-tracking.txt Data:
Code:
"tSoGR55SqaRuFARMCPjOvQ" 38277 2020-10-20T23:43:20.710-07:00 3361 4 "020001EA==" 2 0 0 0 ? ? ?
"020001EA==" is _change-fieldmap field and RAW conversion of field "Name" of Customer Table.
3. Now, I wanted to convert RAW type to CHAR by using GET-STRING so that "020001EA==" can be displayed as "NAME".
Code:
DEF VAR ch1 AS CHAR NO-UNDO.
DEF VAR rw1 AS RAW NO-UNDO.
FOR EACH _cdc-change-tracking NO-LOCK:
rw1 = _cdc-change-tracking._change-fieldmap.
ch1 = GET-STRING(rw1, 1 , LENGTH(rw1)).
MESSAGE ch1
VIEW-AS ALERT-BOX INFORMATION BUTTONS OK.
END.
In above code, ch1 is display as blank.
Please suggest how to display this RAW type field (_cdc-change-tracking._change-fieldmap) so that we can understand
which field is updated from _cdc-change-tracking table.
Regards.