Tuesday, 13 March 2018

Delete AIF exception logs

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)


No comments:

Azure Hosted pipeline - Update Artifacts (NuGet) for version update

 Step-by-Step Guide to Updating or Creating Artifacts for a Hosted Pipeline In this blog, we’ll walk you through the process of updating or ...