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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:49:36+00:00 2026-06-04T16:49:36+00:00

I’m working on a dummy android project to get a hang of things. The

  • 0

I’m working on a dummy android project to get a hang of things. The following line of code breaks my android application without any error. I’m using Idea as an IDE.

database.execSQL("Insert Into todos(uid, name, created_on, changed_on) values('6a7047ed-c2f9-407f-a774-1c02b0fe9caf', 'todo', DATETIME('NOW'), DATETIME('NOW'))");

I’m sure the database has the given columns, and if I just use:

database.execSQL("Insert Into todos(uid, name) values('6a7047ed-c2f9-407f-a774-1c02b0fe9caf', 'todo')");

The application works the way it should.

I tried to insert dates like this (based on answered question related to this matter):

 '2012-05-25 16:52:00'

or

 date('now')

I get the same crash with no error or debug log.

What am I missing here?

Updated

As requested, the code used to create the database table.

    public static final String TABLE_TODOS = "todos";
    public static final String COLUMN_ID = "id";
    public static final String COLUMN_UID = "uid";
    public static final String COLUMN_NAME = "name";
    public static final String COLUMN_CHECKED = "checked";
    public static final String COLUMN_TO_DELETE = "must_delete";
    public static final String COLUMN_CHANGED_ON = "changed_on";

    public static final String COLUMN_CREATED = "created_on";

    private static final String DATABASE_CREATE = "create table "
            + TABLE_TODOS + "( "
            + COLUMN_ID + " integer primary key autoincrement, "
            + COLUMN_UID + " varchar(50), "
            + COLUMN_NAME + " text not null, "
            + COLUMN_CHECKED + " integer default 0, "
            + COLUMN_TO_DELETE + " integer default 0, "
            + COLUMN_CHANGED_ON + " datetime "
            + COLUMN_CREATED + " datetime "
            +");";
  • 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-04T16:49:37+00:00Added an answer on June 4, 2026 at 4:49 pm

    Your problem is you are declaring a datatype that doesn’t exist in SQlite. From the docs:

    ” 1.2 Date and Time Datatype

    SQLite does not have a storage class set aside for storing dates and/or times. Instead, the built-in Date And Time Functions of SQLite are capable of storing dates and times as TEXT, REAL, or INTEGER values:

    TEXT as ISO8601 strings (“YYYY-MM-DD HH:MM:SS.SSS”). REAL as Julian day numbers, the number of days since noon in Greenwich on November 24, 4714 B.C. according to the proleptic Gregorian calendar. INTEGER as Unix Time, the number of seconds since 1970-01-01 00:00:00 UTC.

    Applications can chose to store dates and times in any of these formats and freely convert between formats using the built-in date and time functions.”

    So change your datatype in the database, recreate it, and change your methods to insert/update/retrieve data from those columns to match the proper datatype and things should work better for you.

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

Sidebar

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

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.