Subject | RE: [firebird-support] Re: Firebird, Access and views, ODBC tracing |
---|---|
Author | Alan McDonald |
Post date | 2004-09-22T01:54:09Z |
> Hi Alan,Your metadata is fine.
> I certainly agree that the records reside in the table, but my
> understanding is that Firebird allows records to be inserted through a
> view.
The regular query you are trying to use should then be in the form
INSERT INTO PAYMENTS(PAYMENTID, PAYMENTDATE, etc other fields) VALUES (NULL,
somedate, etc other values)
the NULL insertion will cause a new value to be generated.
The pass thru query from access either does this or it omits the PK column
completely so that's fine too.
Alan
>
> Here's the SQL to create the table:
> create table PAYMENTS(
> PAYMENTID integer not null,
> PAYMENTDATE date,
> PAYMENTMETHOD varchar(50) not null,
> CCTYPE varchar(50),
> CCNAME varchar(200),
> CCEXPIREMONTH varchar(20),
> CCEXPIREYEAR varchar(10),
> AMOUNT float not null,
> CCNUMBER varchar(50),
> NOTES blob sub_type 0 segment size 80,
> PAYMENTFOR varchar(25) not null,
> INVITEEID integer not null,
> AUCTIONYEAR integer);
>
> alter table PAYMENTS add constraint CHECK_PAYMENTFOR check (PAYMENTFOR
> IN ("Item","Entrance Fee","Donation","Other"));
>
> alter table PAYMENTS add constraint CHECKK_AUCTIONYEAR CHECK
> (AUCTIONYEAR >= 2003);
>
> /* Primary Key */
> alter table PAYMENTS add constraint PK_PAYMENTS primary key (PAYMENTID);
>
> /* Foreign Key */
> alter table PAYMENTS add constraint FK1_PAYMENTS foreign key
> (INVITEEID) references GUESTS(INVITEEID);
>
> /* Triggers */
> create trigger PAYMENTID_INCREMENT for PAYMENTS active before insert
> position 0
> as
> begin
> IF (PAYMENTS.PAYMENTID IS NULL) THEN
> PAYMENTS.PAYMENTID = GEN_ID(PAYMENTID,1);
> end
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>