Here we are going to learn, how to delete AIF exception logs that are created before some xxx date.
static void MK_ClearAIFLogs(Args _args)
{
SysExceptionTable aiflog;
;
ttsbegin;
delete_from aiflog where
aiflog.createdDateTime < datetobeginUtcDateTime(today()-30, DateTimeUtil::getUserPreferredTimeZone());
ttscommit;
}
There are few points to be noted about the above code.
1. The AIF exceptions are stored in SysExceptionTable.
2. How to use date and time range in the select query
3. Set set based statement. (Speeding Up SQL Operations)
static void MK_ClearAIFLogs(Args _args)
{
SysExceptionTable aiflog;
;
ttsbegin;
delete_from aiflog where
aiflog.createdDateTime < datetobeginUtcDateTime(today()-30, DateTimeUtil::getUserPreferredTimeZone());
ttscommit;
}
There are few points to be noted about the above code.
1. The AIF exceptions are stored in SysExceptionTable.
2. How to use date and time range in the select query
3. Set set based statement. (Speeding Up SQL Operations)
No comments:
Post a Comment