omidaghakhani1368 Well-Known Member Licensed User Longtime User Jul 5, 2015 #1 Hi. I use below code for get row count but get error sql1.ExecQuerySingleResult2("SELECT COUNT(*) FROM tbl_friends WHERE sID ='?'",Array As String(user_id)) = 0 Then error : android.database.sqlite.SQLiteBindOrColumnIndexOutOfRangeException: bind or column index out of range: handle 0x149eb8
Hi. I use below code for get row count but get error sql1.ExecQuerySingleResult2("SELECT COUNT(*) FROM tbl_friends WHERE sID ='?'",Array As String(user_id)) = 0 Then error : android.database.sqlite.SQLiteBindOrColumnIndexOutOfRangeException: bind or column index out of range: handle 0x149eb8
Pendrush Well-Known Member Licensed User Longtime User Jul 5, 2015 #2 Code: Copy sql1.ExecQuerySingleResult2("SELECT COUNT(*) FROM tbl_friends WHERE sID=?",Array As String(user_id)) = 0 Then remove ' before and after ? Upvote 0
Code: Copy sql1.ExecQuerySingleResult2("SELECT COUNT(*) FROM tbl_friends WHERE sID=?",Array As String(user_id)) = 0 Then remove ' before and after ?
omidaghakhani1368 Well-Known Member Licensed User Longtime User Jul 5, 2015 #3 Pendrush said: Code: Copy sql1.ExecQuerySingleResult2("SELECT COUNT(*) FROM tbl_friends WHERE sID=?",Array As String(user_id)) = 0 Then remove ' before and after ? Click to expand... Thank you but my string dont have a quote.are you sure? Upvote 0
Pendrush said: Code: Copy sql1.ExecQuerySingleResult2("SELECT COUNT(*) FROM tbl_friends WHERE sID=?",Array As String(user_id)) = 0 Then remove ' before and after ? Click to expand... Thank you but my string dont have a quote.are you sure?
mangojack Expert Licensed User Longtime User Jul 6, 2015 #4 maybe Code: Copy Dim rowCount As Int = sql1.ExecQuerySingleResult2("SELECT COUNT(*) FROM tbl_friends WHERE sID=?",Array As String(user_id)) If rowCount = 0 Then Upvote 0
maybe Code: Copy Dim rowCount As Int = sql1.ExecQuerySingleResult2("SELECT COUNT(*) FROM tbl_friends WHERE sID=?",Array As String(user_id)) If rowCount = 0 Then
omidaghakhani1368 Well-Known Member Licensed User Longtime User Jul 6, 2015 #5 mangojack said: maybe Code: Copy Dim rowCount As Int = sql1.ExecQuerySingleResult2("SELECT COUNT(*) FROM tbl_friends WHERE sID=?",Array As String(user_id)) If rowCount = 0 Then Click to expand... Thank you,i test it but get error.it is wonderfull Upvote 0
mangojack said: maybe Code: Copy Dim rowCount As Int = sql1.ExecQuerySingleResult2("SELECT COUNT(*) FROM tbl_friends WHERE sID=?",Array As String(user_id)) If rowCount = 0 Then Click to expand... Thank you,i test it but get error.it is wonderfull
S sorex Expert Licensed User Longtime User Jul 6, 2015 #6 omidaghakhani1368 said: Thank you but my string dont have a quote.are you sure? Click to expand... IDs are numbers most of the time then you don't need to use quotes Upvote 0
omidaghakhani1368 said: Thank you but my string dont have a quote.are you sure? Click to expand... IDs are numbers most of the time then you don't need to use quotes
omidaghakhani1368 Well-Known Member Licensed User Longtime User Jul 6, 2015 #7 sorex said: IDs are numbers most of the time then you don't need to use quotes Click to expand... I know.Number field in my table is type of TEXT and i according field type decide to use quote Upvote 0
sorex said: IDs are numbers most of the time then you don't need to use quotes Click to expand... I know.Number field in my table is type of TEXT and i according field type decide to use quote
S sorex Expert Licensed User Longtime User Jul 6, 2015 #8 I'm not 100% sure about SQLite but I believe it's always text but it detects on the content if it is a number, date, datetime or real string field. Upvote 0
I'm not 100% sure about SQLite but I believe it's always text but it detects on the content if it is a number, date, datetime or real string field.
omidaghakhani1368 Well-Known Member Licensed User Longtime User Jul 6, 2015 #9 sorex said: I'm not 100% sure about SQLite but I believe it's always text but it detects on the content if it is a number, date, datetime or real string field. Click to expand... use quote according to field's type In all databases(mssql,mysql,sqlite and ...) is same. just when use prepare parameter in b4a is problem Upvote 0
sorex said: I'm not 100% sure about SQLite but I believe it's always text but it detects on the content if it is a number, date, datetime or real string field. Click to expand... use quote according to field's type In all databases(mssql,mysql,sqlite and ...) is same. just when use prepare parameter in b4a is problem
S sorex Expert Licensed User Longtime User Jul 6, 2015 #10 omidaghakhani1368 said: use quote according to field's type In all databases(mssql,mysql,sqlite and ...) is same. Click to expand... with the exeption that SQLite only has text field types even when you select date or anything else in an sqlite editor. Upvote 0
omidaghakhani1368 said: use quote according to field's type In all databases(mssql,mysql,sqlite and ...) is same. Click to expand... with the exeption that SQLite only has text field types even when you select date or anything else in an sqlite editor.
omidaghakhani1368 Well-Known Member Licensed User Longtime User Jul 6, 2015 #11 sorex said: with the exeption that SQLite only has text field types even when you select date or anything else in an sqlite editor. Click to expand... let me to export project and attachment here Upvote 0
sorex said: with the exeption that SQLite only has text field types even when you select date or anything else in an sqlite editor. Click to expand... let me to export project and attachment here