Subject | Re: [firebird-support] Migrating from Access to Firebird (Where are the autoincrement fields?) |
---|---|
Author | Catalin PLACINTA |
Post date | 2003-10-02T17:32:49Z |
You can do it by triggers, stored procs and generators. Simply import the
data, then create the generator (in my case, CLASE_ID_GEN) and add these (in
my example, the table name is CLASE)
CREATE TRIGGER AI_CLASE_ID FOR CLASE ACTIVE
BEFORE INSERT POSITION 0
AS
BEGIN
IF (NEW.ID IS NULL) THEN
NEW.ID = GEN_ID(CLASE_ID_GEN, 1);
END
CREATE PROCEDURE "CLASE_ID_AutoInc"
RETURNS (
NEW_VALUE INTEGER)
AS
BEGIN
NEW_VALUE = GEN_ID(CLASE_ID_GEN, 1);
END
data, then create the generator (in my case, CLASE_ID_GEN) and add these (in
my example, the table name is CLASE)
CREATE TRIGGER AI_CLASE_ID FOR CLASE ACTIVE
BEFORE INSERT POSITION 0
AS
BEGIN
IF (NEW.ID IS NULL) THEN
NEW.ID = GEN_ID(CLASE_ID_GEN, 1);
END
CREATE PROCEDURE "CLASE_ID_AutoInc"
RETURNS (
NEW_VALUE INTEGER)
AS
BEGIN
NEW_VALUE = GEN_ID(CLASE_ID_GEN, 1);
END
----- Original Message -----
From: "Henrique Lobo Weissmann" <kicolobo@...>
To: <firebird-support@yahoogroups.com>
Sent: Thursday, October 02, 2003 6:20 PM
Subject: [firebird-support] Migrating from Access to Firebird (Where are the
autoincrement fields?)
> Hi again,
>
> I´m thinking about migrate my old database (in the MS Access format)
to the Firebird format. But, reading here and there, trying to make this
migration a small doubt come to my mind: where are the autoincrement fields
in Firebird? Does Firebird have anything like these autoincremental fields
that exists in databases such as Access and Paradox? If does, how can I
declare a field to be of this type and, most important, when migrating my
old database (MS Access) to firebird, will I loose these fields or they will
be translated using the type Integer or something like it?
>
>
> [Non-text portions of this message have been removed]
>
>
>
> To unsubscribe from this group, send an email to:
> firebird-support-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>