Board index » delphi » IBX_INTERNAL_DBKEY empty!

IBX_INTERNAL_DBKEY empty!


2004-09-06 10:22:59 PM
delphi8
Hello,
IBX 7.08:
Editing a TIBTable directly after an insert does not work ,
IBX_INTERNAL_DBKEY
is empty !
[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 = 2012
WEEK = 36
FILIAAL = 112
VERZAMELD = 6-9-2004
UITLEEN = <NULL>
VERWERKT = <NULL>
GEARCHIVEERD = <NULL>
IBX_INTERNAL_DBKEY =
Going back to ibx version 6 solves the bug.
Is this a known bug???
Eric
 
 

Re:IBX_INTERNAL_DBKEY empty!

Eric ten Westenend writes:
Quote

Hello,

IBX 7.08:

Editing a TIBTable directly after an insert does not work ,
IBX_INTERNAL_DBKEY
is empty !

Of course. InterBase does not return this value and it is impossible to get on
an insert. Don't use an IBTable if you need to do further updates after an
insert. Use an IBQuery or IBDataset where you can control the refresh, modify
and update SQL's.
Quote
[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 = 2012
WEEK = 36
FILIAAL = 112
VERZAMELD = 6-9-2004
UITLEEN = <NULL>
VERWERKT = <NULL>
GEARCHIVEERD = <NULL>
IBX_INTERNAL_DBKEY =

Going back to ibx version 6 solves the bug.
Is this a known bug???

It is not a bug.
Quote
Eric
--
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)
 

Re:IBX_INTERNAL_DBKEY empty!

Hello Jeff,
You must be kidding!
Why did version 6 of IBexpress work fine on this problem? (We moved back to
version 6)
The software we are maintaining here is old and converted from paradox to
interbase.
That why there are a lot of TIBTable's in the code.
Eric
"Jeff Overcash (TeamB)" <XXXX@XXXXX.COM>schreef in bericht
Quote


Eric ten Westenend writes:
>
>Hello,
>
>IBX 7.08:
>
>Editing a TIBTable directly after an insert does not work ,
>IBX_INTERNAL_DBKEY
>is empty !
>

Of course. InterBase does not return this value and it is impossible to
get on
an insert. Don't use an IBTable if you need to do further updates after
an
insert. Use an IBQuery or IBDataset where you can control the refresh,
modify
and update SQL's.

>[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 = 2012
>WEEK = 36
>FILIAAL = 112
>VERZAMELD = 6-9-2004
>UITLEEN = <NULL>
>VERWERKT = <NULL>
>GEARCHIVEERD = <NULL>
>IBX_INTERNAL_DBKEY =
>
>Going back to ibx version 6 solves the bug.
>Is this a known bug???
>

It is not a bug.

>Eric

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

Re:IBX_INTERNAL_DBKEY empty!

Eric ten Westenend writes:
Quote

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)
 

Re:IBX_INTERNAL_DBKEY empty!

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)
 

Re:IBX_INTERNAL_DBKEY empty!

"Eric ten Westenend" <eric[nospam]@bureaujurjendevries.nl>writes
Quote
Hello Jeff,

You writes:
>>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
news:XXXX@XXXXX.COM...
>
>
>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)