1

I have issue when i use scop_identity in sqlite it showing the error like near "select": syntax error...i write query like this

   string txtSQLQuery = "insert into  SerpTrak_Site (SiteName) values ('" + txturl.Text +   "')select scope_identity();";

any wrong in this query please help me...

Victor
  • 555
  • 6
  • 15
  • 39

2 Answers2

0

Missing a semicolon between the two queries.

string txtSQLQuery = "insert into  SerpTrak_Site (SiteName) 
 values ('" + txturl.Text +   "'); select scope_identity();";
Jeff Swensen
  • 3,513
  • 28
  • 52
0

SQLite does not have a function by the name scope_identity

You are probably looking for 'SELECT last_insert_rowid()'

See also this question: Does SQLite support SCOPE_IDENTITY?

Community
  • 1
  • 1
Jeff
  • 736
  • 5
  • 14