On 2017-08-02 18:23, Sylvain Pointeau wrote:
...

CREATE SEQUENCE IF NOT EXISTS SEQ_1 START WITH 12123;

insert into MYTABLE(SPECIFIED_NUMBER, OTHERINFO) values (seq_1.nextval,
'other info')


BTW, your request is somewhat related with the brand new union-vtab SQLite extension [1] (for optimized union view of identical tables) - if we have the basic PostreSQL nextval in SQLite, the following pattern would become possible:

create sequence doc_id start with 40;
create table doc(doc_id integer primary key default nextval('doc_id'), doc);
create table inbox_doc(doc_id integer primary key default nextval('doc_id'), doc);

create virtual table temp.doc using unionvtab(
        'select doc_id, doc from doc union all select doc_id, doc from 
inbox_doc'
);
select doc from temp.doc where doc_id = 42;

So, maybe nextval is already on the roadmap ;-)

Kind Regards,
Alek

[1] https://sqlite.org/unionvtab.html
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to