Hi

So whats the solution here. I am giving 4 statements because i need insert
to be transactional. Some other process could be inserting in the same db
and so we need insert and row id values to be in one transaction.  Is there
any other way i can achieve it.

-Suraj

On Fri, Jul 3, 2015 at 5:13 PM, Stephan Beal <sgbeal at googlemail.com> wrote:

> On Fri, Jul 3, 2015 at 1:39 PM, Kumar Suraj <surajnitk at gmail.com> wrote:
>
> > #define INSERT_DN "BEGIN TRANSACTION; INSERT INTO TBL (dn) VALUES (?);
> > SELECT last_insert_rowid(); COMMIT;"
> >
> >
> prepare() expects a _single_ statement. You're giving it 4 statements and
> then trying to bind to part of that, which won't work.
>
>
> >         snprintf(command, 512, INSERT_DN);
> >
>
> --
> ----- stephan beal
> http://wanderinghorse.net/home/stephan/
> http://gplus.to/sgbeal
> "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
> those who insist on a perfect world, freedom will have to do." -- Bigby
> Wolf
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>

Reply via email to