android


SQLite syntax error - a comma


I'm trying to copy a row in a SQLite table, but I get a syntax error:
android.database.sqlite.SQLiteException: near ",": syntax error (code 1): , while compiling: INSERT INTO tokens(colour, power, ts) SELECT (colour, power, ts) FROM tokens WHERE _id = 1
My query looks like this:
db.execSQL("INSERT INTO " + TABLE_TOKENS + "(" + COLUMN_COLOUR + ", " + COLUMN_POWER + ", " + COLUMN_TS + ")" +
" SELECT (" + COLUMN_COLOUR + ", " + COLUMN_POWER + ", " + COLUMN_TS + ")" +
" FROM " + TABLE_TOKENS +
" WHERE _id = " + id);
For me it looks fine and I guess it wouldn't work without commas...
The select projection is syntactically not correct. Change SELECT (colour, power, ts) to SELECT colour, power, ts.

Related Links

Get website title without displaying it
Getting text of the last line of TextView Android development
Xamarin Form Android Access folder folder/emulated/0/download
Android - Empty items generated on scroll in RecyclerView
Dependency org.apache.httpcomponents:httpclient:4.2.6 is ignored for release as it may be conflicting with the internal version provided by Android
http post method not sending json object to web server
Setting sound configuration for Socket device
Seachview directing to another intent which runs php
Understanding 9-patch drawables
How to code for different kind of animated Materiliaze Expandable ListView
how to set vertical position of progress dialog
retrofit inside android library
Firebase onDataChange method on null object reference
How to kill Fragment?
How to change the text color on a TextView by clicking it?
New Firebase Initialize Crashes

Categories

HOME
eclipse
design-patterns
polymer
amp-html
requirements
alarm
pdfbox
cq5
limit
regular-language
modal-dialog
commonjs
java.util.logging
microsoft-dynamics-nav
easyphp
video-editing
jquery-ias
imageresizer
short-url
jquery-callback
definitelytyped
corpus
android-maps
bioinformatics
boost-asio
turfjs
odroid
demo
urlsession
levenshtein-distance
apriori
subclipse
logback-groovy
drupal-theming
strftime
linter
zenhub
aquamacs
stdmap
context-sensitive-grammar
java-6
jqchart
cup
monkey
cmp
gameplay-kit
testrail
usart
cudd
webjars
jodd
fink
nupic
httpruntime.cache
custom-errors
terracotta
file-move
rubaxa-sortable
opserver
jdk1.7
jsvc
apache-commons-daemon
canvg
snackbar
qtwebengine
apache-spark-1.3
crowd
alternate
dsym
openargs
embedded-fonts
asdf
workitem
flex++
route-provider
jquery-1.9
intersect
extreme-programming
boost-signals
floating-point-exceptions
w3c-geolocation
xui
cdonts
cloudfiles
message-passing
zen
django-piston
web-application-project
visualj#
alsb
entitykey

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App