----- Original Message -----
From: Alan McDonald
To: IBObjects@yahoogroups.com
Sent: Saturday, February 28, 2004 11:41 AM
Subject: RE: [IBO] TIB_DataPump
> CREATE TABLE SOCI (
> MYCODE D_GUID /* VARCHAR(36) NOT NULL */,
> COGNOME COGNOME /* VARCHAR(30) */,
> NOME NOME /* VARCHAR(20) */,
snip
> DA_RICHIAMARE BOOL /* CHAR(1) 1 NOT NULL */ NOT NULL
> );
>
>
>
> ALTER TABLE SOCI ADD CONSTRAINT PK_SOCI PRIMARY KEY (MYCODE);
>
>
> CREATE INDEX XCOGNOMESOCI ON SOCI (COGNOME, NOME);
>
> /* Trigger: SOCI_BIU0 */
> CREATE TRIGGER SOCI_BIU0 FOR SOCI
> ACTIVE BEFORE INSERT OR UPDATE POSITION 0
> AS
> begin
> new.eta = coalesce( ( current_date - new.data_nascita ) / 365, 0 );
> end
> ^
>
>
> SET TERM ; ^
>
> That's all.
OK - now where is your trigger for the PK? If you try during a pump to
insert a null value for MYCODE the first time will work but not the second.
I know, this aspect is rigth.
The trigger is working.
The error rises when I try to insert a record with the same PK of one in the destination table.
In this case should start the update( Like UpdateSQL of TIB_Query ).
But with TIB_DataPump there is no such.
Is the source db definition identical?
Yes. They are identical.
BTW are you using reverse GUIDs? There's a UDF around which makes for GUID
indexes to be much faster since the significant end of the GUID is reversed.
If you are generating the GUIDs at the client then they may not be optimised
for Firebird indexes.
Alan
Alan, I am generating GUID from client( Delphi 7.0 ).
The UDF seem not work for Me.
I know the existence of UUID to solve the problem of optimization with Firebird.
But I cannot do UUID at Delphi side.
After solve this issue I start to look at UUID with UDF.
Another question: Someone is able to generate UUID??
Thanks.
Ciao
Arnaldo
Arnaldo
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________ http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !