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

  • Home
  • SEARCH
  • 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 9041349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T10:13:13+00:00 2026-06-16T10:13:13+00:00

I am using Sqlite database and storing empty values for rows.I am using this

  • 0

I am using Sqlite database and storing empty values for rows.I am using this code for storing empty values in the database:

            ContentValues values = new ContentValues();
            values.put(KEY_NAME,"");
            values.put(KEY_PH_NO,"");           
            values.put(KEY_FOLDER_NAME, contact.getFolderName());
            values.put(KEY_FolderAddress, contact.getParentFolderAddress());
            values.put(KEY_TIME, contact.getTime());    
            values.put(KEY_DATE, contact.getDate());

And i am using following query to retrieve the database entry having empty values:

String selectQuery = "SELECT  * FROM " + TABLE_CONTACTS + " WHERE "+KEY_FolderAddress+" ='"
                     +FileAddress+"'"+" AND "+KEY_FOLDER_NAME+" ='"+FileName+"'"+" AND "+KEY_DATE+" ='"+"0"+"'"
                     +" AND "+KEY_PH_NO+" ='"+""+"'"+" AND "+KEY_NAME+" ='"+""+"'";

But i am getting this exception while retrieving empty values:

12-25 11:52:40.531: E/Exception:(1990): android.database.sqlite.SQLiteException: unknown error: , while compiling: SELECT  * FROM rules WHERE folderaddress ='/sdcard/Velosys/a' AND folder_name ='a' AND date ='0' AND phone_number ='' AND name ='' Exception occured in getTimeOfTheFolderFromContact() of DatabaseHandlerRule.java

I have searched a lot but did not get the solution.Please help me in finding the right way to retrieve empty values from sqlite database.Thanks in advance

Edit:

I am storing 2 entries with empty values i.e KEY_NAME and KEY_PH_NO

This is the table format:

String CREATE_CONTACTS_TABLE = "CREATE TABLE " + TABLE_CONTACTS + "("
            + KEY_ID + " INTEGER PRIMARY KEY, " +KEY_NAME+" TEXT, "+ KEY_PH_NO + " TEXT, "
            +KEY_FOLDER_NAME+" TEXT, "+ KEY_FolderAddress + " TEXT, "+KEY_TIME + " TEXT, "+KEY_DATE+" TEXT "+")";
            db.execSQL(CREATE_CONTACTS_TABLE);
  • 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-16T10:13:14+00:00Added an answer on June 16, 2026 at 10:13 am

    You must use some common value to store in database:

    ContentValues values = new ContentValues();
                values.put(KEY_NAME,"null");
                values.put(KEY_PH_NO,"null");  
    

    Please use this code to retrieve null values:
    Yes you are right because the “null” value will be stored as a string value in database.

    int i = resultSet.getInt(resultSet.getColumnIndex(columnName));
            String str = resultSet.getString(resultSet.getColumnIndex(columnName));
            boolean bool = resultSet.isNull(resultSet.getColumnIndex(columnName));
            if( str == null )
            {
                return -1;
            }
            return i; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I will be storing datetime values in an SQLite database (using Delphi and the
I guess many people already read this article: Using your own SQLite database in
I am creating a database in android using this code: public class PackageDBHelper extends
I am trying to populate a listview from sqlite database. My code is using
I am using sqlite database for iphone app. but its crash on while loop
I was newbie in using sqlite database android. and now I have a problem
I am using SQLite Database and in one my table has field purchased_date (TEXT
I'm using SQLite database. The problem is that data isn't written to base. NSLog
I have a SQLite DB designed using SQLite Database Browser 2.0 b1 I have
Hi In my application I am using SQLITE database, I want to add multiple

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.