I am using Data collector 5.8.1 . I am selected JDBC in my pipeline start event

I am using this query in my start event:
DECLARE @XYZWorkFlowID INT = (SELECT TOP 1 WorkFlowID FROM dbo.RefWorkFlow WHERE WorkFlowName = 'XYZ')
INSERT INTO JobTracker(JobName,WorkFlowID,Campaign,LastExecutedTime,JobStatus)
VALUES ('XYZ_ABC_Export',@XYZWorkFlowID ,'Dialer',GETDATE(),'InProgress')
I need to get the identity value generated by JobTracker table and assign it to a ‘JobTrackerId’ pipeline parameter. I need to use the same parameter in the stop event jdbc to update JobTracker the table.
I tried adding:
${JobTrackerId} = SELECT @@Identity
I'm pretty sure this is the wrong approach. Can anyone guide me through the right one?