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 743073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:49:15+00:00 2026-05-14T08:49:15+00:00

The Android SDK has some convenience methods for manipulating data with SQLite. However both

  • 0

The Android SDK has some convenience methods for manipulating data with SQLite. However both the insert and replace methods use some nullColumnHack parameter which usage I don’t understand.

The documentation explains it with the following, but what if a table has multiple columns that allow NULL? I really don’t get it :/

SQL doesn’t allow inserting a completely empty row, so if initialValues is empty, this column [/row for replace] will explicitly be assigned a NULL value.

  • 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-05-14T08:49:16+00:00Added an answer on May 14, 2026 at 8:49 am

    Let’s suppose you have a table named foo where all columns either allow NULL values or have defaults.

    In some SQL implementations, this would be valid SQL:

    INSERT INTO foo;
    

    That’s not valid in SQLite. You have to have at least one column specified:

    INSERT INTO foo (somecol) VALUES (NULL);
    

    Hence, in the case where you pass an empty ContentValues to insert(), Android and SQLite need some column that is safe to assign NULL to. If you have several such columns to choose from, pick one via the selection mechanism of your choice: roll of the dice, Magic 8-Ball(TM), coin flip, cubicle mate flip, etc.

    Personally, I’d’ve just made it illegal to pass an empty ContentValues to insert(), but they didn’t ask me… 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The Android SDK offers the standard menu icons via android.R.drawable.X . However, some standard
The new Android 2.1 SDK (version 7) has a new class called SignalStrength: http://developer.android.com/reference/android/telephony/SignalStrength.html
Im looking for a mobile SDK that has the following for iOS and Android
The android.jar found in android-sdk is simply a stub. All methods will throw a
I use android-sdk-r12m-r17m-linux.zip and android-ndk-r8-linux-x86.tar.bz2 to compile my android apk. My compiling steps are:
For some reason my eclipse/android development environment has stopped creating the r.java files and
I just wonder if Android SDK has special tool for achievements implementing. I want
I've been trying to learn to to use Android SDK and have encountered my
The Android sdk has an example Notepad app that holds notes in a database.
I am developing some app for android which worked well untill this evening. However

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.