Launch custom event on a table from sql

Hi all,

I have a custom event on the table PersonWantsOrg, I want to launch this event in bulk for 800 rows,

I could I do it from an sql script? There is a way to do this inside One Identity?

I have a custom process on DialogDatabse that run an HandleObjectComponent - FireGenEvent step taking table event and where string but it doesn't work due (I think) to the length of the where condition for the 800 rows...

Thanks

Mik

Parents
  • There is an option to work with object model over SQL. Solution for you is using procedure QBM_PJobCreate_HOFireEvent_L example below

    DECLARE @GenProcID VARCHAR(38) = newid();
    DECLARE @XObjectKeys dbo.QBM_YParameterList;
    DECLARE @EventName NVARCHAR(256) = '';
    DECLARE @objecttype VARCHAR(1024) = 'Person';
    DECLARE @AdditionalObjectKeysAffected dbo.QBM_YParameterList;
    INSERT INTO
            @XObjectKeys (Parameter1)
    SELECT
            XObjectKey
    FROM
            Person
    WHERE
            IsInActive = 1 
            
    DECLARE @StartTime DateTime = NULL;
    EXEC dbo.QBM_PJobCreate_HOFireEvent_L @objecttype = @objecttype,
            @xobjectkeys = @XObjectKeys,
            @EventName = @EventName,
            @GenProcID = @GenProcID,
            @AdditionalObjectKeysAffected = @AdditionalObjectKeysAffected,
            @isToFreezeOnError = 1,
            @Retries = 0,
            @priority = 5,
            @StartAt = @StartTime

Reply
  • There is an option to work with object model over SQL. Solution for you is using procedure QBM_PJobCreate_HOFireEvent_L example below

    DECLARE @GenProcID VARCHAR(38) = newid();
    DECLARE @XObjectKeys dbo.QBM_YParameterList;
    DECLARE @EventName NVARCHAR(256) = '';
    DECLARE @objecttype VARCHAR(1024) = 'Person';
    DECLARE @AdditionalObjectKeysAffected dbo.QBM_YParameterList;
    INSERT INTO
            @XObjectKeys (Parameter1)
    SELECT
            XObjectKey
    FROM
            Person
    WHERE
            IsInActive = 1 
            
    DECLARE @StartTime DateTime = NULL;
    EXEC dbo.QBM_PJobCreate_HOFireEvent_L @objecttype = @objecttype,
            @xobjectkeys = @XObjectKeys,
            @EventName = @EventName,
            @GenProcID = @GenProcID,
            @AdditionalObjectKeysAffected = @AdditionalObjectKeysAffected,
            @isToFreezeOnError = 1,
            @Retries = 0,
            @priority = 5,
            @StartAt = @StartTime

Children
No Data