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

Android ndk-build iostream: No such file or directory
Android OpenGL some Texture not loading/reloading
Android Emulator sdcard not updating properly
Image is not displaying proper using OpenGL in android ndk
Android Development Lifecycle Setup
Second activity re-appearing after using statrtactivityfor result and closed
Open URL in Android App?
listview with checkboxes and without
how to apply Discrete wavelet transform on image
Problems with SQLite in Android
Is there a way to add a seekbar to my actual preference screen?
Get RawContactId of specific Contact based off PhoneLookup
Bitmaps on canvases a bad idea for any game with moving objects
Which Android platform SDK do I need?
How to implement a changelog in android?
How to get the speaking sound that comes from the phone user and convert to byte array ?

Categories

HOME
android
google-app-engine
localization
facebook-oauth
awk
cheerio
ggplot2
pascal
saml-2.0
spring-data-redis
nested-if
polling
vsm
bing-maps
performancepoint
okhttp
fhir
resultset
why3
line
jsonpath
flatpak
do-while
fileserver
google-data-studio
replication
breadth-first-search
ember-cli
hta
scriptella
interpreter
stackexchange
handler
ceylon
comparable
bioinformatics
google-cast
dst
database-comparison
kodi
card.io
android-maps-extensions
wurfl
timing
release
odroid
diacritics
linq-to-objects
dcmtk
show-hide
servermanager
openresty
jquery-ui-draggable
cnc
insight
headless
offline.js
android-instrumentation
javafx-css
cronexpression
custom-lists
reporting-services-2012
async.js
macaulay2
mta
mapinfo
scaffolding
jclouds
lua-telegram-bot
createprocess
ascii-art
java-money
xvim
wso2greg
sql-server-data-tools
graphics2d
phpldapadmin
nodelist
viewer
sip-server
cbind
unix-socket
winginx
dsym
spring-3
bin
mbunit
mongohq
route-provider
fb.ui
qi4j
paginator
appjs
database-create
azman
floating-point-exceptions
xcelsius
massive
diagrams
undefined-index
instantiationexception
binomial-heap
zen
qtabbar
alsb
escrow
information-management

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