Subject RE: [firebird-support] Re: Firebird, Access and views, ODBC tracing
Author Alan McDonald
> Hi Alan,
> I must be particularly thick skulled, although I am close to getting
> it. In this case, because my view only draws on one table, I can do
> insert into this view using isql or Marathon equivalent, but I cannot do
> it via ODBC

when you say insert into this view in marathon - do you mean in the grid of
data you use the insert key? in which case marathon is issuing an insert
into the underlying table. try creating a view of multiple tables (join) and
see if marathon can do that too?
using isql you can't INSERT INTO VIEWNAME(FIELD1, etc) VALUES (val1, etc)
can you?
you also (must) need to issue an INSERT INTO TABLENAME(FIELD1, etc etc.. No?
and ODBC is the same.

>
> So using ODBC I cannot insert into a view as though it were any other
> table,

correct

> but as long as I arrange for the SQL to go directly to Firebird
> (ExecSQLDirectW),

? as long as it's INSERT INTO UNDERLYINGTABLENAME(FIELD1, etc etc...

> then I can insert into my view as I please (provided
> the view accepts insert into). Is this correct?
>
> Thanks again, and sorry to be taking a while to get it.
>
> Cheers,
>
> Eric

When you use IBO components for connecting to and using a FB database, the
components allow you to query a view and you can choose to construct an
INSERT and a separate UPDATE SQL statements to go along with the query. When
you want to add (insert) a new record into the view, the designed SQL
statement is issued for you by IBO but it is not in the form INSERT INTO
VIEWNAME... in must be INSERT INTO TABLENAME and UPDATE TABLENAME SET
FIELD1=value1 etc..