Questions tagged [android-sql]
30 questions
0
votes
0 answers
Improve sqlite query Where field in to exists
Here's my simplified working query:
select fields, sum(otherFields)
from table1
where table1.field1 in (Select table2.field1
from table2
where table1.id=table2.id
order by…

Alin
- 14,809
- 40
- 129
- 218
0
votes
1 answer
Why my insert query is not working ..?
I am new to Android. I want to store data in Android SQLite in this process, I am inserting some values but they are not inserting. Where I'm doing the mistake. I'm not getting the solution please help me.
Mainacticity.xml:

chinna
- 13
- 5
0
votes
1 answer
Android database update by attaching database
I have an app and I want to update its database to the next version by adding new values to it. The new data is in their temp database.
This is my onUpgrade() method:
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
…

Majid
- 519
- 1
- 9
- 21
0
votes
0 answers
Connect to external MySQL server on Android
I've followed this tutorial: http://www.parallelcodes.com/connect-android-to-ms-sql-database-2/
So Im using jtds-1.2.7.jar on Android Studio in trying to connect my app to an external MySQL server, 000webhost to be specific.
I keep getting this…

Jay Gunawardena
- 65
- 2
- 12
0
votes
1 answer
How to update "datetime default current_timestamp" with ContentValues?
In an Android game user data (retrieved from different social networks) is stored in an SQLite table:
create table table_social (
id text primary key,
social integer not null, /* Facebook = 1, Google+ = 2, Twitter = 3, ... */
…

Alexander Farber
- 21,519
- 75
- 241
- 416
0
votes
2 answers
Getting FATAL exception: AsyncTask #1 on using Async class
I'm new in android. I have imported a project which takes picture from my mobile and is supposed to upload it on my localhost in my laptop. Both are connected to same WiFi and it runs until I take picture and click upload but as i click upload, it…

user3102917
- 19
- 1
- 7
0
votes
3 answers
How to search in database where is array
I've got this mysqlquery:
$Nusers = mysql_query("SELECT user_id FROM dotp_user_task_type WHERE user_task_types_id = '$select1'");
$row = mysql_fetch_array($result);
It takes all users id's which has task with specific id. So, now i need to take…

McLaren
- 776
- 1
- 10
- 23
-1
votes
1 answer
How to add previous data to new data from saved ListView?
I am making a budge calculator using SQL in Android Studio. Users put in date of purchase, name of item and value of item. I used SQL to save each "user input" into a new ListView.
I want my code to access the previous cursor to get the value, add…

Daniel Kwon
- 23
- 4
-1
votes
1 answer
Return specific Row first and then other Row follow
I want to print the trending row first and then New and then all other row from the table "employee".
Also i want limit the number of row and in descending order
I was trying this
SELECT * FROM (SELECT * FROM employee LIMIT 7) sub ORDER BY id…

Rohit Kumar Sehrawat
- 213
- 1
- 5
- 17
-1
votes
1 answer
Error occurred while store image path to SQLite Database using Android?
It continues to occur error... what is the problem?
every variables are String.
String insertSQL = "INSERT INTO " + DBHelper.getTableName() + " VALUES (\''"+entry.getKey()+"\'', \''"+images+"\'')";
Error message
INSERT INTO LABELING RESULT…

baeharam
- 543
- 1
- 8
- 20
-1
votes
1 answer
ArrayIndexOutOfBoundException to delete single record
I am using external database with prefilled data. The user can also perform CRUD operation in that database. But when I am deleting the record its throwing the Array out of bound exception. Here, is my snippet from code which I implemented for…

Rakshit Sorathiya
- 519
- 5
- 16
-1
votes
3 answers
i want to add two new colomns to database how can i?
i have five tables in my database i want to add two more colomns to only one table
how can i please help me thanks in advance.
this is my tables
sqLiteDatabase.execSQL(CREATE_ProductSales_TABLE);
…

sai android
- 139
- 1
- 12
-1
votes
1 answer
SQLiteException: near "occured": syntax error (code 1)
I am trying to insert a row into a table in my database but I am stuck. The insert function is returning -1 and the Logcat is showing the following error:
05-06 20:58:45.446 13631-13631/com.example.android.disasterreporter E/SQLiteLog: (1) near…

Eric Garcia
- 77
- 1
- 12
-1
votes
1 answer
How to get all the items in sql using query based on a WHERE clause
I am new to database and I am trying to get all the data from table whose category column is equal to 1. This is my first attempt. Can someone please guide me where I am doing wrong?
public Cursor getAllFamilyMovies()
{
return…

Kamil Kamili
- 1,757
- 5
- 24
- 39
-2
votes
1 answer
SQLiteException: near "=": syntax error (code 1)
I am trying to read a single object from my sqlite database but I am getting this error doing so:
android.database.sqlite.SQLiteException: near "=": syntax error (code 1): , while compiling: SELECT id FROM Property WHERE id =
…

Georgi Koemdzhiev
- 11,421
- 18
- 62
- 126