Subject Re: [IBO] Re: PK field that auto filled with wrong generator value
Author Cipto
I already make a little example to produce that bugs,

I make it in Delphi 7, with IBO 4.9.14. 46 and Firebird 2.1.4

Here is in the attachment the Delphi source and the database, just compile
it.
There is also another bugs that I found and that's all on that attachment.

I really hope Jason also can make this attention to this bugs.

If this mailing list doesn't allow attachment that I will upload it on
IBObject yahoogroups on file section with the filename:
"IBO Bugs Cipto22May2012.rar"


TIA

----- Original Message -----
From: russellbelding
To: IBObjects@yahoogroups.com
Sent: Sunday, May 06, 2012 3:04 PM
Subject: [IBO] Re: PK field that auto filled with wrong generator value

Hello Cipto

I am still a bit puzzled and say again: Perhaps my questions will provoke a
thought to you which brings insight.

D=Detail and M=Master as abbreviations you use?
You show the sql for qrtbBeliD and join to table tbBarang.
When you insert a record to qrtbBeliD the primary key d."id" is given a
value whose source is unknown. In particular you are confident the integer
primary key does not come from generator gentbBeliD.

1. Could you simplify this problem using two similar and simpler tables.
Remove all fields except the primary keys and the linking fields. If the
problem is still present post the simpler details here. If the problem is
not presnt, add more fields till the problem appears.

2. If this were my code I'd use a generator and trigger for both tables and
remove the primary key insertion from the OnPostEvent. Your method "feels"
messy and maybe the event code runs too many times. The code looked correct.

3. I see you are using d."names" not d.names. You have a reason for this.
Then I see you use :"id" . How you you use the :"id"?
(paramByName(??).asInteger := 33)
I don't know if is is safe or legal to use double quotes around parameters.
Could you do a simple experiment? use :MyID (new name and without quotes)
instead and see if the problem goes away?

Kind regards,
Russell


[Non-text portions of this message have been removed]