Pavel Votava
10th December 2012, 07:05
Can anybody explain me parameters of function
aud.put.old.fields.value.

void aud.put.old.field.value(long pid, string variable name, long selection id. long table.id, long field.id, long element [,bool endian])

I don`t understand the parameter element and parameter variable name.

Variable name - the name of variable that will contain the extracted field value.

Element The function aud.put.old.field.value - this is the value of the field directly before the database action.

I try to read the audit file. Everything works, but the function aud.put.old.value gives me no results.

Can anybody help me?

Thanks. Pavel Votava

Example of script:


range.str = "#COMMITTIME# between :date.f and :date.t"
| note that the UTC representation actually is different, but it has been
| formatted this way to increase readability of this example
IF aud.select.transactions(nr.tables, my.tables, my.companies,range.str,selection.id) = AUD_OK
THEN
WHILE aud.get.next.transaction(selection.id, 0, 0,transaction.id, commit.time, session, user) = AUD_OK
|| process.transaction.header(transaction.id,commit.time, session, user)
WHILE aud.get.next.action(selection.id, table.id,company,table.code,meta.data.changed,action.nr,action.type) =AUD_OK
|| process.action.header(company, table.code,company,action.nr,action.type)
IF meta.data.changed THEn
IF aud.get.field.ids(selection.id,table.id,nr.fields,my.fields,field.ids) =AUD_OK
THEN
|| process.meta.data(nr.fields, my.fields, field.ids)
| This function uses aud.get.field.info()
ENDIF
ENDIF
FOR field.nr = 1 to nr.fields
pom = aud.get.field.status(selection.id, table.id,field.ids(nr.fields))
IF trim$(pom) <> "X" THEN
aud.get.field.info(selection.id,table.id,field.ids(field.nr),field.depth,field.type,field.length)
IF action.type = "D" or action.type = "U" THEN
element = field.type
aud.put.old.field.value(pid,my.fields(1,field.nr),selection.id,table.id,field.ids(field.nr),element)
|| process.old.value(my.fields(field.nr))
ENDIF
IF action.type = "I" or action.type = "U" THEN
element = field.type
aud.put.new.field.value(pid,hodnota,selection.id,table.id,field.ids(field.nr),element)
|| process.new.value(my.fields(field.nr))
ENDIF
ENDIF
ENDFOR
ENDWHILE
ENDWHILE
aud.close.selection(selection.id)
ENDIF
}