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

  • Why do you think it is a length restriction? If you can do it in a SQL script you should be able to write a Where-Clause against the PersonWantsOrg table as well wouldn't you?

  • Thanks for the answer Markus.

    Usually I have a process on Dialog database that call and HandleObjectComponent - FireGetEvent not an sql script.

    with this parameters:

    EventName

    ObjectType

    WhereClause.

    My where clause is very very long e.s. CCC_MyCustomColumnRef in (.......) with a lot of ref in the parenthesis

    If I call the event with the long where clause nothing happen, if I call the event with just a bunh of ref it works.

  • 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