RE: Checking for lock records in SOP100 and SOP10200
It was new to me that it doesn't honour locks, so thanks for teaching me that.
I guess I would check the tempdb..DEX_LOCK table and raise a custom econnect error code with
@O_iErrorState int output,
@oErrString varchar(255) output
if a lock row is present, using the pre-econnect procedure to do the checking. You only lock order header then the order is yours.
Untested output from brain goes soemething like..
IF EXISTS
(
SELECT 1 FROM tempdb..dex_lock
WHERE table_path_name = db_name( )+'.dbo.SOP10100'
AND row_id =
(SELECT MSTRNUMB=DEX_ROW_ID FROM SOP10100 WHERE SOPNUMBE = @SOPNUMBE AND SOPTYPE = @SOPTYPE)
)
BEGIN
SELECT 1; --Do whatever to raise exception here setting output variables for errorstate etc
END