Hello 4gl gurus! We have a 4ge (code below) that runs all day, executing a stored procedure from time to time and is meant to end itself at 11pm. Does not really do a whole lot, but at 11pm every single night when it finishes up (with a FREE statement) this thing dumps like you would not believe, slowing down the box for almost 20 minutes at a time and creating huge SHMEM files in my dump directory. Programmer who authored it is taking the "high ground" and insisting its an IDS bug...can someone please take a look at the code and let me know why it may not be working? Not really looking for other ways of doing this, I would rather no why its not working as designed.
-thanks
DATABASE MYDB
MAIN
define sqlCmd varchar(255);
define hourNow datetime hour to hour;
define hourTarget datetime hour to hour;
-- Bail out at 11pm
let hourTarget = Datetime(23) Hour to Hour;
let sqlCmd = "execute procedure sp_mysp()"
prepare sqlStmt from sqlCmd
select current
into hourNow
from systables
where tabid = 1;
--Display hourNow;
WHILE (hourNow < hourTarget) -- Bail out at 9 pm
execute sqlStmt;
sleep 300; -- Run Every 5 minutes
select current
into hourNow
from systables
where tabid = 1;
--Display hourNow;
END WHILE
free sqlStmt;
END MAIN
-thanks
DATABASE MYDB
MAIN
define sqlCmd varchar(255);
define hourNow datetime hour to hour;
define hourTarget datetime hour to hour;
-- Bail out at 11pm
let hourTarget = Datetime(23) Hour to Hour;
let sqlCmd = "execute procedure sp_mysp()"
prepare sqlStmt from sqlCmd
select current
into hourNow
from systables
where tabid = 1;
--Display hourNow;
WHILE (hourNow < hourTarget) -- Bail out at 9 pm
execute sqlStmt;
sleep 300; -- Run Every 5 minutes
select current
into hourNow
from systables
where tabid = 1;
--Display hourNow;
END WHILE
free sqlStmt;
END MAIN