Hello Jeff,
You writes:
Quote
>IBTable has never been able to do an insert and then an update to
the newly inserted record as the RDB$DB_KEY is unavailable on an insert
Here is the prove that IbX 6 worked fine:
Watch the output from sqlmonitor with IBExpress 6:
[Application: Project1]
IBTable1: [Execute] insert into "VERZAMELING" ("JAAR", "WEEK", "FILIAAL",
"VERZAMELD", "UITLEEN", "VERWERKT", "GEARCHIVEERD") values (:"JAAR",
:"WEEK", :"FILIAAL", :"VERZAMELD", :"UITLEEN", :"VERWERKT", :"GEARCHIVEERD")
JAAR = 2016
WEEK = 36
FILIAAL = 112
VERZAMELD = <NULL>
UITLEEN = <NULL>
VERWERKT = <NULL>
GEARCHIVEERD = <NULL>
[Application: Project1]
IBTable1: [Execute] select "VERZAMELING".*, RDB$DB_KEY as IBX_INTERNAL_DBKEY
from "VERZAMELING" where "JAAR" = :"JAAR" AND "WEEK" = :"WEEK" AND "FILIAAL"
= :"FILIAAL"
JAAR = 2016
WEEK = 36
FILIAAL = 112
[Application: Project1]
IBTable1: [Execute] update "VERZAMELING" set "JAAR" = :"JAAR", "WEEK" =
:"WEEK", "FILIAAL" = :"FILIAAL", "VERZAMELD" = :"VERZAMELD", "UITLEEN" =
:"UITLEEN", "VERWERKT" = :"VERWERKT", "GEARCHIVEERD" = :"GEARCHIVEERD" where
RDB$DB_KEY = :IBX_INTERNAL_DBKEY
JAAR = 2016
WEEK = 36
FILIAAL = 112
VERZAMELD = 8-9-2004
UITLEEN = <NULL>
VERWERKT = <NULL>
GEARCHIVEERD = <NULL>
IBX_INTERNAL_DBKEY = ?
[Application: Project1]
IBTable1: [Execute] select "VERZAMELING".*, RDB$DB_KEY as IBX_INTERNAL_DBKEY
from "VERZAMELING" where RDB$DB_KEY = :IBX_INTERNAL_DBKEY
IBX_INTERNAL_DBKEY = ?
As you can see a new select is generated after the insert , after that we
fire the update, the update has an internal dbkey!!
In 7.08 there is no extra select statements :
[Application: Project1]
IBTable1: [Execute] insert into "VERZAMELING" ("JAAR", "WEEK", "FILIAAL",
"VERZAMELD", "UITLEEN", "VERWERKT", "GEARCHIVEERD") values (:"JAAR",
:"WEEK", :"FILIAAL", :"VERZAMELD", :"UITLEEN", :"VERWERKT", :"GEARCHIVEERD")
JAAR = 2020
WEEK = 36
FILIAAL = 112
VERZAMELD = <NULL>
UITLEEN = <NULL>
VERWERKT = <NULL>
GEARCHIVEERD = <NULL>
[Application: Project1]
IBTable1: [Execute] update "VERZAMELING" set "JAAR" = :"JAAR", "WEEK" =
:"WEEK", "FILIAAL" = :"FILIAAL", "VERZAMELD" = :"VERZAMELD", "UITLEEN" =
:"UITLEEN", "VERWERKT" = :"VERWERKT", "GEARCHIVEERD" = :"GEARCHIVEERD" where
RDB$DB_KEY = :IBX_INTERNAL_DBKEY
JAAR = 2020
WEEK = 36
FILIAAL = 112
VERZAMELD = 8-9-2004
UITLEEN = <NULL>
VERWERKT = <NULL>
GEARCHIVEERD = <NULL>
IBX_INTERNAL_DBKEY =
The statements above comes from the same application, the first running D7.1
/ IBX 6 , the second D7.1 / IBX 7.08
The first application performs the insert and update fine, the second one
discards the update.
See the differences for IBX_INTERNAL_DBKEY.
This is the code we used:
IBTable1.Insert;
IBTable1.FieldByName('JAAR').asInteger := 2016;
IBTable1.FieldByName('WEEK').asInteger := 36;
IBTable1.FieldByName('FILIAAL').asInteger := 112;
IBTable1.Post;
IBTable1.Edit;
IBTable1.FieldByName('VERZAMELD').asDateTime := Date;
IBTable1.Post;
IBTable1.Transaction.CommitRetaining;
Please a reaction.
Eric
"Jeff Overcash (TeamB)" <
XXXX@XXXXX.COM>schreef in bericht
Quote
Eric ten Westenend writes:
>
>Hello Jeff,
>
>You must be kidding!
No I am not. IBTable has never been able to do an insert and then an
update to
the newly inserted record as the RDB$DB_KEY is unavailable on an insert
statement. You have to reread the TIBTable between the insert and edit
calls.
--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
A human being should be able to change a diaper, plan an invasion, butcher
a hog, conn a ship, design a building, write a sonnet, balance accounts,
build
a wall, set a bone, comfort the dying, take orders, give orders,
cooperate, act
alone, solve equations, analyze a new problem, pitch manure, program a
computer,
cook a tasty meal, fight efficiently, die gallantly. Specialization is
for
insects. (RAH)