Re: [gnome-db] Minor API change and MySQL [update/delete]_row



> >   insertable:  have all non-null columns that have no default values
> >   updatable:   have at least one non-null unique key
> > 
> could you tell me a case where a recordset on database can be upated but
> no more rows can be inserted?

CREATE TABLE tbl (
        a       INT PRIMARY KEY AUTO INCREMENT,
        b       VARCHAR(20) NOT NULL,
        foo	VARCHAR(20)
);

"SELECT a, foo FROM tbl" is updatable, but not insertable since sql
server wouldn't know what to set b of the new row to.

"SELECT b, foo FROM tbl" is not updatable (no unique non-null key),
but is insertable.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]