Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SQLSTATE 01004 Error in PB7.0

139 views
Skip to first unread message

Jennifer DeVore

unread,
Feb 24, 2000, 3:00:00 AM2/24/00
to
I am running this application in the PB7 development tool on Windows 95 and
connecting to Adaptive Server Anywhere database 6.0. This application was
originally written in PB 4.0 with Watcom 4.0 and I have migrated it to PB
7.0 with ASA 6.0. The datawindow in question was originally written in PB
4.0 but I recreated it in PB 7.0 just to check and it still gave me the same
error.

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

unread,
Feb 25, 2000, 3:00:00 AM2/25/00
to
ret2 = dw.retrieve() returns the number of rows retrieved. If ret2 = 0,
then you retrieved zero rows.

--
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...

Jennifer DeVore

unread,
Feb 28, 2000, 3:00:00 AM2/28/00
to
Sorry, ret2 in (ret2 = dw_truck.retrieve(trucknum))actually was equal to 1.
So it retreived successfully. But it is still getting the SQLSTATE 01004
error.
Any thoughts?

Terry Dykstra <dontreply...@cfol.ab.ca> wrote in message
news:2QgUYZ7f$GA....@forums.sybase.com...

Matthew Chestnut

unread,
Feb 28, 2000, 3:00:00 AM2/28/00
to
In the datawindow painter, compare the "Rows / Column Specifications"
to the actual size of the columns in the database schema.
0 new messages