Looking at the taIVCreateItemPriceListLIne procedure, error 7079 is setup as the following:
if (@I_vTOQTY <= @MAXTOQTY)
begin
select @O_iErrorState = 7079
What this error is looking at, is if the l_vTOQTY value is less than or equal to the MAXTOQTY value, it throws this error message number.
In the procedure itself, the l_vTOQTY value begins as this:
@I_vTOQTY numeric(19,5) = 999999999999.00000
Later in the procedure, we see the MAXTOQTY value specified:
@MAXTOQTY = 0,
The l_vTOQTY value then seems to get updated with this script:
if (@I_vTOQTY = 999999999999.00000)
begin
select @I_vTOQTY =
case
when @DECPLQTY = 2 then 999999999999.90000
when @DECPLQTY = 3 then 999999999999.99000
when @DECPLQTY = 4 then 999999999999.99900
when @DECPLQTY = 5 then 999999999999.99990
when @DECPLQTY = 6 then 999999999999.99999
else @I_vTOQTY
end
end
If the l_vUpdateIfExists value, that you mentioned, was set to '1', then it would run this script:
if exists(select 1 from IV00108 (nolock) where ITEMNMBR = @I_vITEMNMBR and CURNCYID = @I_vCURNCYID and PRCLEVEL = @I_vPRCLEVEL and UOFM = @I_vUOFM and TOQTY = @I_vTOQTY)
begin
delete IV00108 where ITEMNMBR = @I_vITEMNMBR and CURNCYID = @I_vCURNCYID and PRCLEVEL = @I_vPRCLEVEL and UOFM = @I_vUOFM and TOQTY = @I_vTOQTY
It then begins a series of checks against the l_vTOQTY value:
if (@I_vTOQTY <= 0)
begin
select @O_iErrorState = 7077
if (@I_vTOQTY > 999999999999.99999)
begin
select @O_iErrorState = 7078
if (@I_vTOQTY >= 999999999999.00000)
begin
select @MAXTOQTY = isnull(max(TOQTY),0) from IV00108 (nolock) where ITEMNMBR = @I_vITEMNMBR and
CURNCYID = @I_vCURNCYID and PRCLEVEL = @I_vPRCLEVEL and UOFM = @I_vUOFM
Then we hit the error message/check that you mentioned seeing:
if (@I_vTOQTY <= @MAXTOQTY)
begin
select @O_iErrorState = 7079
The procedure then does a couple more checks depending on what the @DECPLQTY value is, before it begins to insert into the IV00107 and IV00108 tables, then completes.
Other than where the @l_vTOQTY variable is assigned to be 999999999999.00000 and then changed depending on the @DECPLQTY value, I don't see anywhere else in the procedure where this value gets changed.
The @MAXTOQTY value gets updated via this script, which is right before the error 7079 check script:
if (@I_vTOQTY >= 999999999999.00000)
begin
select @MAXTOQTY = isnull(max(TOQTY),0) from IV00108 (nolock) where ITEMNMBR = @I_vITEMNMBR and
CURNCYID = @I_vCURNCYID and PRCLEVEL = @I_vPRCLEVEL and UOFM = @I_vUOFM
end
We would want to follow through your script being run with this procedure to trace the values given to both the @I_vTOQTY and @MAXTOQTY variables, to see what they're being changed to, thus causing the 7079 error you mentioned seeing from this procedure.
The following script may be a good place to begin:
select @MAXTOQTY = isnull(max(TOQTY),0) from IV00108 (nolock) where ITEMNMBR = @I_vITEMNMBR and
CURNCYID = @I_vCURNCYID and PRCLEVEL = @I_vPRCLEVEL and UOFM = @I_vUOFM
I looked through our case history and didn't find anything more that we've seen cause this error message.
Thanks