Problem with last_insert_row_id in sqlite3

Discussion in 'Ruby' started by Kenneth McDonald, Oct 20, 2008.

  1. When I try to use the last_insert_row_id function in sqlite3, I'm
    getting a sqlite syntax error. Since all I'm doing is:

    db = SQLite3::Database.new(...)
    id = db.last_insert_rowid

    I can't see what could possibly be wrong with something so simple as
    this. Clearly, however, I'm also simple when it comes to this :), so
    any help would be appreciated.

    Thanks,
    Ken
     
    Kenneth McDonald, Oct 20, 2008
    #1
    1. Advertising

  2. Problem solved. The error was in incorrect docs on the web. the proper
    function is last_insert_row_id.

    Ken
    On Oct 20, 2008, at 1:03 PM, Kenneth McDonald wrote:

    > When I try to use the last_insert_row_id function in sqlite3, I'm
    > getting a sqlite syntax error. Since all I'm doing is:
    >
    > db = SQLite3::Database.new(...)
    > id = db.last_insert_rowid
    >
    > I can't see what could possibly be wrong with something so simple as
    > this. Clearly, however, I'm also simple when it comes to this :),
    > so any help would be appreciated.
    >
    > Thanks,
    > Ken
    >
     
    Kenneth McDonald, Oct 20, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sébastien Ramage

    Pyro and sqlite3 problem

    Sébastien Ramage, Dec 1, 2007, in forum: Python
    Replies:
    4
    Views:
    547
    Dennis Lee Bieber
    Dec 2, 2007
  2. Charles V.
    Replies:
    0
    Views:
    250
    Charles V.
    Nov 11, 2008
  3. Hans Müller
    Replies:
    1
    Views:
    1,781
    Dennis Lee Bieber
    Dec 4, 2009
  4. Jeffrey 'jf' Lim
    Replies:
    5
    Views:
    538
    Jeffrey 'jf' Lim
    Apr 9, 2007
  5. SunSw0rd
    Replies:
    4
    Views:
    288
    SunSw0rd
    Jul 2, 2009
Loading...

Share This Page