jmac13
Member
Hi all,
I'm using 10.2b
I've got a program that does a query between 2 dates on a table. When I run the .w the first time its fine and the browse gets populated but if I run the query again (same session of the program) I get "Disconnected by the server, code 48" error and the program closes down cause its lost connection to the database. I think I've narrowed it down to a procedure within a persistent but I cant see why it causes that error:
CreateRecord:
The persistent is using a shared temp-table to pass back to calling program not sure if thats anything to do with it anyone got any ideas?
thanks
I'm using 10.2b
I've got a program that does a query between 2 dates on a table. When I run the .w the first time its fine and the browse gets populated but if I run the query again (same session of the program) I get "Disconnected by the server, code 48" error and the program closes down cause its lost connection to the database. I think I've narrowed it down to a procedure within a persistent but I cant see why it causes that error:
Code:
for each loadlstd where
loadlstd.compno = bLoadlstd.compno and
loadlstd.plantno = bLoadlstd.plantno and
loadlstd.lnStat = string(bLoadlstd.lh-number) + ",":u +
string(bLoadlstd.times-picked) + ",":u +
string(bLoadlstd.lineno)
use-index findIwt
no-lock:
find loadlsth of loadlstd
no-lock no-error.
run createRecord.
end.
CreateRecord:
Code:
define variable dteDelDate as date no-undo.
define variable intDelTime as integer no-undo.
define buffer bNewLoadlstd for loadlstd.
if loadlstd.ltrdat <> ? then
assign dteDelDate = loadlstd.ltrdat
intDelTime = loadlstd.spare-dec2.
else
assign dteDelDate = loadlsth.lh-deldate
intDelTime = loadlsth.ltrno.
create ttIwts.
assign ttIwts.rowLoadlstd = rowid(loadlstd)
ttIwts.intIwtNo = loadlstd.lh-number
ttIwts.ltrDat = dteDelDate
ttIwts.chrTimeConfirmed = if ttIwts.ltrdat <> ? then string(intDelTime,"HH:MM:SS":u) else "":u
ttIwts.chrStatus = if loadlsth.lh-areaDsc = "C":u then "Delivered":u else "Intransit":u
ttIwts.dteSysConfDate = loadlsth.lh-deldate
ttIwts.chrSysConfTime = string(loadlsth.ltrno,"HH:MM:SS":u) when loadlsth.lh-deldate <> ?.
if loadlstd.lnStat <> "":u then
do:
assign ttIwts.intAvlNo = int(entry(1,loadlstd.lnstat))
ttIwts.intAvlDrop = int(entry(2,loadlstd.lnstat))
ttIwts.intAvlLn = int(entry(3,loadlstd.lnstat)).
find bNewLoadlstd where
bNewLoadlstd.compno = loadlstd.compno and
bNewLoadlstd.plantno = loadlstd.plantno and
bNewLoadlstd.lh-number = ttIwts.intAvlNo and
bNewLoadlstd.times-picked = ttIwts.intAvlDrop and
bNewLoadlstd.lineno = ttIwts.intAvlLn
no-lock no-error.
if available bNewLoadlstd then
rowAvlLine = rowid(bNewLoadlstd).
end.
The persistent is using a shared temp-table to pass back to calling program not sure if thats anything to do with it anyone got any ideas?
thanks