Subject Re: [firebird-support] Re: Firebird, Access and views, ODBC tracing
Author Eric E
Hi Alan,
Thanks for going over my queries and table definitions.
I'm guessing that the problem with Access inserts is due to SQL
incompatibilities between Access' Jet SQL and Firebird's dialect 3, or
an incompatibility/bug in the ODBC driver relating to inserting into views.

Do you or anyone else know any good ways of tracing what SQL Access/ODBC
actually passes to Firebird?

Thanks,

Eric

Alan McDonald wrote:

>>Hi Alan,
>> I certainly agree that the records reside in the table, but my
>>understanding is that Firebird allows records to be inserted through a
>>view.
>>
>>
>
>Your metadata is fine.
>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
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
>
>
>
>
>
>Yahoo! Groups Links
>
>
>
>
>
>
>
>