C++ (Qt)...QSqlQuery query(db);...if query.exec("INSERT INTO `table` (`name`) VALUES('No name')"){ qDebug()<<"last inserted id:"<<query.lastInsertId().toString();};
SELECT seq FROM sqlite_sequence WHERE name = 'actions'
insert into table values a, b, c, d returning *
insert into ACTIVITY(NAME)values ('0111')returning ROW_ID
create table( id bigserial; name text;);
create sequence table_id_seq int64 start 0 end 99..99 increment 1;create table( id int64 default next_val(table_id_seq); name text;);
if :NEW.id = null then select max(id) + 1 into :new.id from table;end if;
SET TERM ^ ;CREATE TRIGGER ACTIVITY_BI FOR ACTIVITY ACTIVEBEFORE INSERT POSITION 0asbegin if (new.row_id is null) then new.row_id = gen_id(gen_activity_id,1);end^SET TERM ; ^