I have an ASP application that calls stored procedure on a sequel server 2005 box. From there I connect to the AS400 using a linked server. Now, from time to time my ASP application return 'no record found for selection'. At this point the connection to the sequel box is closed. Looking at the activity log on the sequel box it tells me that sp is still running? Digging deeper and looking at the AS/400 (workactjob) I can see following:
Job 947519/QUSER/QZDASOINIT started on 03/26/09 at 13:05:30 in subsystem
QUSRWRK in QSYS. Job entered system on 03/26/09 at 13:05:30.
User VGWPRJA from client 10.90.4.17 connected to server.
All access paths were considered for file F0911LI.
Additional access path reason codes were used.
Access path built from keyed file F0911L1.
Access path suggestion for file F0911LI.
Query exceeds specified time limit or storage limit.
SQL query exceeds specified time limit or storage limit.
SQL query exceeds specified time limit or storage limit.
How do I prevent this from happening?
Here is the code snippet that I run from the sequel box:
CREATE TABLE #JDE_LaborTable
( jde_cost_code nvarchar(15) unique,
jde_sum_hrs decimal(8,2),
jde_uom char(2)
)
insert into #JDE_LaborTable
Exec ('Call QGPL.get_labqty(?)', @JobNumber1) AT AS400SRV_MSDASQL
Here is the sp on the AS/400:
create procedure get_labqty
(in @jobnumber char(12))
result set 1
language sql
reads sql data
set option datfmt = *iso
begin
declare c1 scroll cursor with return for
select glsub, sum(decimal(glu * .01, 31, 2)), glum
from vgiprddta/f0911li
where glmcu = @jobnumber and
globj in ('70100 ', '70105 ', '70110 ', '70130', '60100',
'60115 ', '60120 ', '60125 ', '60130 ') and
gllt in ('AA', 'AU') and
glum in ('HR', 'MH')
group by glsub, glum;
open c1;
end;
Job 947519/QUSER/QZDASOINIT started on 03/26/09 at 13:05:30 in subsystem
QUSRWRK in QSYS. Job entered system on 03/26/09 at 13:05:30.
User VGWPRJA from client 10.90.4.17 connected to server.
All access paths were considered for file F0911LI.
Additional access path reason codes were used.
Access path built from keyed file F0911L1.
Access path suggestion for file F0911LI.
Query exceeds specified time limit or storage limit.
SQL query exceeds specified time limit or storage limit.
SQL query exceeds specified time limit or storage limit.
How do I prevent this from happening?
Here is the code snippet that I run from the sequel box:
CREATE TABLE #JDE_LaborTable
( jde_cost_code nvarchar(15) unique,
jde_sum_hrs decimal(8,2),
jde_uom char(2)
)
insert into #JDE_LaborTable
Exec ('Call QGPL.get_labqty(?)', @JobNumber1) AT AS400SRV_MSDASQL
Here is the sp on the AS/400:
create procedure get_labqty
(in @jobnumber char(12))
result set 1
language sql
reads sql data
set option datfmt = *iso
begin
declare c1 scroll cursor with return for
select glsub, sum(decimal(glu * .01, 31, 2)), glum
from vgiprddta/f0911li
where glmcu = @jobnumber and
globj in ('70100 ', '70105 ', '70110 ', '70130', '60100',
'60115 ', '60120 ', '60125 ', '60130 ') and
gllt in ('AA', 'AU') and
glum in ('HR', 'MH')
group by glsub, glum;
open c1;
end;