Hi All,
I have a new trigger in SQL which inserts a new record in another table, but I am getting a blowup
Error description: Error BASE/1132 Bound error: array access
Args:
[ 1] = A { ... }
[ 2] = N 1
Stack Calls
===========
Called from: ..\source\sqlrdd2.prg => SR_WORKAREA:WRITEBUFFER(2500)
Called from: ..\source\sqlrdd2.prg => SR_WORKAREA:SQLGOCOLD(3313)
Called from: ..\source\sqlrdd2.prg => SR_WORKAREA:SQLFLUSH(4651)
Called from: => DBCOMMIT(0)
Called from: \6.00\Source\Common\VEHICLE.PRG => VEHC_SAVE(649)
The Trigger is based on the following
CREATE TRIGGER [dbo].[Vehicles_Insert] ON [dbo].[VEHICLES]
AFTER INSERT
NOT FOR REPLICATION
AS
DECLARE @SITE Numeric(2, 0)
DECLARE @VEHC Char(10)
DECLARE @TYPE Char(10)
DECLARE @VTAG Char(10)
DECLARE @UMXW Char(1)
DECLARE @MAXW Numeric(5, 0)
DECLARE @AVLB Char(1)
DECLARE @SDEL Char(1)
SET @SITE = (SELECT SITE_ID FROM INSERTED)
SET @VEHC = (SELECT VEHCL_NBR FROM INSERTED)
SET @TYPE = (SELECT VEHCL_TYPE FROM INSERTED)
SET @VTAG = (SELECT RF_TAG FROM INSERTED)
SET @UMXW = (SELECT USE_MAXWT FROM INSERTED)
SET @MAXW = (SELECT MAX_WEIGHT FROM INSERTED)
SET @AVLB = (SELECT AVAILABLE FROM INSERTED)
SET @SDEL = (SELECT SR_DELETED FROM INSERTED)
--This is the condition for rows to be inserted - this should match the where condition in IWSSYS.INI - if you need to reference any more columns, declare them as above
IF @SITE = 1
--Replace database & table name below
INSERT IWSDATAEXCH.dbo.tblVehicle(SITE_ID, VEHCL_NBR, VEHCL_TYPE, RFTAG_ID, USE_MAXWT, MAX_WEIGHT, AVAILABLE, SR_DELETED) VALUES
(@SITE, @VEHC, @TYPE, @VTAG, @UMXW, @MAXW, @AVLB, @SDEL)
any help would be appreciated.
Thanks
Paul Rogers