Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8871321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:57:46+00:00 2026-06-14T17:57:46+00:00

I am using following query to insert data into a SQLite database for Android.

  • 0

I am using following query to insert data into a SQLite database for Android.

INSERT INTO ServerData 
VALUES('404', '192.168.145.101', '1', '1', '1'),
      ('404', '192.168.145.101', '2', '1', '1')

But I am getting an error, the LogCat details are below:

11-22 15:14:56.588: E/Database(1609): Failure 1 (near “,”: syntax error) on 0x2e3e30 when preparing ‘INSERT INTO ServerData VALUES(‘404′,’192.168.145.101′,’1′,’1′,’1’),(‘404′,’192.168.145.101′,’2′,’1′,’1′)’.
11-22 15:14:56.618: W/dalvikvm(1609): threadid=10: thread exiting with uncaught exception (group=0x40015560)
11-22 15:14:56.648: E/AndroidRuntime(1609): FATAL EXCEPTION: AsyncTask #1
11-22 15:14:56.648: E/AndroidRuntime(1609): java.lang.RuntimeException: An error occured while executing doInBackground()
11-22 15:14:56.648: E/AndroidRuntime(1609): at android.os.AsyncTask$3.done(AsyncTask.java:200)
11-22 15:14:56.648: E/AndroidRuntime(1609): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)
11-22 15:14:56.648: E/AndroidRuntime(1609): at java.util.concurrent.FutureTask.setException(FutureTask.java:125)
11-22 15:14:56.648: E/AndroidRuntime(1609): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308)
11-22 15:14:56.648: E/AndroidRuntime(1609): at java.util.concurrent.FutureTask.run(FutureTask.java:138)
11-22 15:14:56.648: E/AndroidRuntime(1609): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
11-22 15:14:56.648: E/AndroidRuntime(1609): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
11-22 15:14:56.648: E/AndroidRuntime(1609): at java.lang.Thread.run(Thread.java:1019)
11-22 15:14:56.648: E/AndroidRuntime(1609): Caused by: android.database.sqlite.SQLiteException: near “,”: syntax error: INSERT INTO ServerData VALUES(‘404′,’192.168.145.101′,’1′,’1′,’1’),(‘404′,’192.168.145.101′,’2′,’1′,’1’)
11-22 15:14:56.648: E/AndroidRuntime(1609): at android.database.sqlite.SQLiteDatabase.native_execSQL(Native Method)
11-22 15:14:56.648: E/AndroidRuntime(1609): at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1763)
11-22 15:14:56.648: E/AndroidRuntime(1609): at com.pcloud.fileshare.database.DBMethods.InsertToServerTable(DBMethods.java:228)
11-22 15:14:56.648: E/AndroidRuntime(1609): at com.pcloud.fileshare.dataAccess.commonMethod.updateServerTable(commonMethod.java:472)
11-22 15:14:56.648: E/AndroidRuntime(1609): at com.pcloud.fileshare.mainPages.userLogin$backgroundTask.doInBackground(userLogin.java:238)
11-22 15:14:56.648: E/AndroidRuntime(1609): at com.pcloud.fileshare.mainPages.userLogin$backgroundTask.doInBackground(userLogin.java:1)
11-22 15:14:56.648: E/AndroidRuntime(1609): at android.os.AsyncTask$2.call(AsyncTask.java:185)
11-22 15:14:56.648: E/AndroidRuntime(1609): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
11-22 15:14:56.648: E/AndroidRuntime(1609): … 4 more
11-22 15:15:00.059: E/WindowManager(1609): Activity com.pcloud.fileshare.mainPages.userLogin has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@40529668 that was originally added here
11-22 15:15:00.059: E/WindowManager(1609): android.view.WindowLeaked: Activity com.pcloud.fileshare.mainPages.userLogin has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@40529668 that was originally added here
11-22 15:15:00.059: E/WindowManager(1609): at android.view.ViewRoot.(ViewRoot.java:258)
11-22 15:15:00.059: E/WindowManager(1609): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
11-22 15:15:00.059: E/WindowManager(1609): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
11-22 15:15:00.059: E/WindowManager(1609): at android.view.Window$LocalWindowManager.addView(Window.java:424)
11-22 15:15:00.059: E/WindowManager(1609): at android.app.Dialog.show(Dialog.java:241)
11-22 15:15:00.059: E/WindowManager(1609): at com.pcloud.fileshare.mainPages.userLogin$backgroundTask.onPreExecute(userLogin.java:251)
11-22 15:15:00.059: E/WindowManager(1609): at android.os.AsyncTask.execute(AsyncTask.java:391)
11-22 15:15:00.059: E/WindowManager(1609): at com.pcloud.fileshare.mainPages.userLogin$1.onItemClick(userLogin.java:221)
11-22 15:15:00.059: E/WindowManager(1609): at android.widget.AdapterView.performItemClick(AdapterView.java:284)
11-22 15:15:00.059: E/WindowManager(1609): at android.widget.ListView.performItemClick(ListView.java:3513)
11-22 15:15:00.059: E/WindowManager(1609): at android.widget.AbsListView$PerformClick.run(AbsListView.java:1812)
11-22 15:15:00.059: E/WindowManager(1609): at android.os.Handler.handleCallback(Handler.java:587)
11-22 15:15:00.059: E/WindowManager(1609): at android.os.Handler.dispatchMessage(Handler.java:92)
11-22 15:15:00.059: E/WindowManager(1609): at android.os.Looper.loop(Looper.java:123)
11-22 15:15:00.059: E/WindowManager(1609): at android.app.ActivityThread.main(ActivityThread.java:3683)
11-22 15:15:00.059: E/WindowManager(1609): at java.lang.reflect.Method.invokeNative(Native Method)
11-22 15:15:00.059: E/WindowManager(1609): at java.lang.reflect.Method.invoke(Method.java:507)
11-22 15:15:00.059: E/WindowManager(1609): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
11-22 15:15:00.059: E/WindowManager(1609): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
11-22 15:15:00.059: E/WindowManager(1609): at dalvik.system.NativeStart.main(Native Method)

The same query works fine in SQLite Expert but not in code

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T17:57:47+00:00Added an answer on June 14, 2026 at 5:57 pm

    In SQLite, you cannot use the comma separator for multiple row insertion in the table. So, for your case you can try this :

    INSERT INTO ServerData
          SELECT '404','192.168.145.101','1','1','1'
    UNION SELECT '404','192.168.145.101','2','1','1';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using PDO to generate the following query: INSERT INTO MyTable (ID, Data) VALUES
I'm using the following query: INSERT INTO role (name, created) VALUES ('Content Coordinator', GETDATE()),
I am using QSqlQuery to insert data into a MySQL database. Currently all I
I am using following query to insert some large text data : internal static
In PHP, I want to insert into a database using data contained in a
How to insert data into table in sqlite iPhone? I am trying following, but
I want to insert data into a table using the following code public User
i m using the following javascript to send the data into database var x=document.getElementById(sortable).innerHTML;
I am trying to store data into database. if i am using the following
I am using the following script to import data into my mysql database from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.