Subject | Question on UPDATE |
---|---|
Author | Robert F. Tulloch |
Post date | 2000-12-26T01:31:21Z |
Hi:
Thanks.Any suggestions appreciated. Best regards
IBTransaction explicitly started Parameters:
read_committed
rec_version
nowait
And IBDataSet SelectSQL:
SELECT DISTINCT ID, MGRID, CAST(CAST(ADRESS_TEN AS INTEGER) AS
CHAR(7)) AS ADRESS_TEN, STNAME_TEN, CITY_TEN, STATE_TEN,
SUBSTR(ZIP_TEN,1,5) AS ZIP_TEN, MAXDATE
FROM TENANTS T1
WHERE ADRESS_TEN >0 AND MAXDATE >= CURRENT_DATE - 1827 AND
MAXDATE = (SELECT MAX(T2.MAXDATE) FROM TENANTS T2
WHERE T2.ADRESS_TEN = T1.ADRESS_TEN AND
T2.STNAME_TEN = T1.STNAME_TEN AND
T2.CITY_TEN = T1.CITY_TEN AND
T2.STATE_TEN = T1.STATE_TEN)
Order By STATE_TEN Asc, CITY_TEN asc, STNAME_TEN Asc, ADRESS_TEN
Asc , MAXDATE ASC
ModifySQL:
update TENANTS
set
STNAME_TEN = :STNAME_TEN,
CITY_TEN = :CITY_TEN,
STATE_TEN = :STATE_TEN,
ZIP_TEN = :ZIP_TEN
where
ID = :OLD_ID and
MGRID = :OLD_MGRID and
ADRESS_TEN = :OLD_ADRESS_TEN and <-------??
STNAME_TEN = :OLD_STNAME_TEN and
CITY_TEN = :OLD_CITY_TEN and
STATE_TEN = :OLD_STATE_TEN and
ZIP_TEN = :OLD_ZIP_TEN
Put dataset in edit, make changes then Post() & CommitRetaining()
and changes are not saved to table.
I assume that the problem is that I have cast the address as char
in the select so it can't be matched in the update.
How does one handle this?
Is :OLD_ADRESS_TEN "ADRESS_TEN" DOUBLE PRECISION or a CHAR(7)
based on my select and do I have to (or can I) cast it back for
the update?
Thanks.Any suggestions appreciated. Best regards
IBTransaction explicitly started Parameters:
read_committed
rec_version
nowait
And IBDataSet SelectSQL:
SELECT DISTINCT ID, MGRID, CAST(CAST(ADRESS_TEN AS INTEGER) AS
CHAR(7)) AS ADRESS_TEN, STNAME_TEN, CITY_TEN, STATE_TEN,
SUBSTR(ZIP_TEN,1,5) AS ZIP_TEN, MAXDATE
FROM TENANTS T1
WHERE ADRESS_TEN >0 AND MAXDATE >= CURRENT_DATE - 1827 AND
MAXDATE = (SELECT MAX(T2.MAXDATE) FROM TENANTS T2
WHERE T2.ADRESS_TEN = T1.ADRESS_TEN AND
T2.STNAME_TEN = T1.STNAME_TEN AND
T2.CITY_TEN = T1.CITY_TEN AND
T2.STATE_TEN = T1.STATE_TEN)
Order By STATE_TEN Asc, CITY_TEN asc, STNAME_TEN Asc, ADRESS_TEN
Asc , MAXDATE ASC
ModifySQL:
update TENANTS
set
STNAME_TEN = :STNAME_TEN,
CITY_TEN = :CITY_TEN,
STATE_TEN = :STATE_TEN,
ZIP_TEN = :ZIP_TEN
where
ID = :OLD_ID and
MGRID = :OLD_MGRID and
ADRESS_TEN = :OLD_ADRESS_TEN and <-------??
STNAME_TEN = :OLD_STNAME_TEN and
CITY_TEN = :OLD_CITY_TEN and
STATE_TEN = :OLD_STATE_TEN and
ZIP_TEN = :OLD_ZIP_TEN
Put dataset in edit, make changes then Post() & CommitRetaining()
and changes are not saved to table.
I assume that the problem is that I have cast the address as char
in the select so it can't be matched in the update.
How does one handle this?
Is :OLD_ADRESS_TEN "ADRESS_TEN" DOUBLE PRECISION or a CHAR(7)
based on my select and do I have to (or can I) cast it back for
the update?