THE CODE IN QUESTION
ret2 = dw_truck.retrieve(trucknum)
haul_num = trim(dw_truck.getitemstring(1, "haulnum"))
ret3 = dw_haul.retrieve(haul_num)
IF ret3 = -1 THEN
MessageBox("SQL error", SQLCA.SQLDBCODE)
END IF
dw_instance.setitem(1,"hst_haulname", dw_haul.getitemstring(1, "haulname"))
(1) ret2 returns '0', so the "dw_truck.retrieve(trucknum)" portion worked
fine
(2) haul_num returns the correct value for the trucknum I am entering =
'000301'
(3) ret3 is coming up as "-1" . When the debugger gets to the ret3 line,
the
following errors appear:
(a) "An Error Occurred Saving this RecordSelect error: SQLSTATE=01004
[Sybase][ODBC Driver]Data truncated"
(b) My messagebox value is "0"
(c) "Powerbuilder Application Execution Error(R0006)
Application Terminated
Error. Invalid DataWindow row/column specified at line 26 in
ue_chngtrk event of object w_tickets."
According to the ASA error codes:
(a)"You may have tried to insert, update, or select a value in the database
that is too large to fit in the destination. You may have fetched data
into a host variable or SQLDA variable not large enough to receive the
value."
(b)"This code indicates that there was no error or warning."
(c) The third error appears because the
"dw_instance.setitem(1,"hst_haulname", dw_haul.getitemstring(1,
"haulname"))"
call is looking for the "dw_haul.getitemstring(1, "haulname")" value which
does
not exist because the "dw_haul.retrieve(haul_num)" failed.
THE DW_HAUL SQL:
SELECT "hauler"."haulnum",
"hauler"."hauladdr",
"hauler"."haulname",
"hauler"."haulcity",
"hauler"."haulstate",
"hauler"."haulzip",
"hauler"."haulphone",
"hauler"."haulcontact1",
"hauler"."haulcontact2",
"hauler"."haulstartdate",
"hauler"."haulinsexpire",
"hauler"."haulinsco",
"hauler"."haulwcexpire",
"hauler"."haulremarks",
"hauler"."haultonsyr",
"hauler"."haulfednum"
FROM "hauler"
WHERE "hauler"."haulnum" = :arg_haulnum
The query runs fine in the datawindow preview and runs fine if run in the
ASA iSQL window.
--
Terry Dykstra (TeamSybase)
Canadian Forest Oil Ltd.
Check out Sybase Developer's Network: http://www.sybase.com/sdn
Jennifer DeVore <jde...@luckstone.com> wrote in message
news:GnmwJMwf$GA....@forums.sybase.com...
Terry Dykstra <dontreply...@cfol.ab.ca> wrote in message
news:2QgUYZ7f$GA....@forums.sybase.com...