Hello,
I have a SQlite Database and I want to use this command to insert/update or delete data and get returned the affected records.
By SQL Syntax this is possible by adding the "RETURNING Columnname" command.
Example:
INSERT OR REPLACE INTO Proddetail (prodno,prodname,info) VALUES (4,'D','XYZ') RETURNING prodno,info
Testing command in DBBrowser it works perfect, using it in B4X it fails.
I tried to use it in B4A or B4J like
I know that used way in the shown code is unusal because INSERT/UPDATE a.s.o. is normally done by sql.ExceNonQuery. But this way it will not return the affected records and will also not accept RETURNING command.
Question:
What is the correct way to use the SQL Command with RETURNING ?
I have a SQlite Database and I want to use this command to insert/update or delete data and get returned the affected records.
By SQL Syntax this is possible by adding the "RETURNING Columnname" command.
Example:
INSERT OR REPLACE INTO Proddetail (prodno,prodname,info) VALUES (4,'D','XYZ') RETURNING prodno,info
Testing command in DBBrowser it works perfect, using it in B4X it fails.
I tried to use it in B4A or B4J like
B4X:
Dim cmd As String ="INSERT OR REPLACE INTO Proddetail (prodno,prodname,info) VALUES (4,'D','XYZ') RETURNING prodno,info"
'fails Error: org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (near "RETURNING": syntax error)
dim rs as resultset = SQL.ExecQuery(cmd)
I know that used way in the shown code is unusal because INSERT/UPDATE a.s.o. is normally done by sql.ExceNonQuery. But this way it will not return the affected records and will also not accept RETURNING command.
Question:
What is the correct way to use the SQL Command with RETURNING ?