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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:06:56+00:00 2026-06-17T14:06:56+00:00

this is my code to create database table: public void onCreate(SQLiteDatabase db) { Log.i(TAG,

  • 0

this is my code to create database table:

public void onCreate(SQLiteDatabase db) {
        Log.i(TAG, "Inizio creazione database MessagesDB");
        String CREATE_TABLE = "CREATE TABLE " + TABLE2 + " (" + Key_key + " TEXT PRIMARY KEY, " + Key_ID + " INTEGER NOT NULL, " + Key_author + " TEXT NOT NULL, " 
+ Key_date_create + " TEXT NOT NULL, " + Key_sender + " TEXT, " 
+ Key_date_sent + " TEXT, " + Key_recipient + " TEXT, " 
+ Key_date_received + " TEXT, " + Key_message + " TEXT, " 
+ Key_message_path + " TEXT, " + Key_size + " INTEGER" + ");";  
        try {
            db.execSQL(CREATE_TABLE); 
            Log.i(TAG, "Creazione database MessagesDB avvenuta con successo");
        }
        catch (Exception e){
            Log.e(TAG, "Errore nella create table messages", e);
        }   
}

but I have an error in the logcat:

:Errore nella create table messages
:android.database.sqlite.SQLiteException: near "create": syntax error: CREATE TABLE messagesDB (_key TEXT PRIMARY KEY, _id INTEGER NOT NULL, author TEXT NOT NULL, date create TEXT NOT NULL, sender TEXT, date_sent TEXT, recipient TEXT, date_received TEXT, message TEXT, message_path TEXT, size INTEGER);

I don’t understand why this error.
Could someone help me to understand?
(sorry for my bad english).

  • 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-17T14:06:58+00:00Added an answer on June 17, 2026 at 2:06 pm

    Remove create from date create TEXT NOT NULL. You seem to have added it by mistake.

    Looks like Key_date_create has the value date create, maybe you meant date_create?

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

Sidebar

Related Questions

@Override public void onCreate(SQLiteDatabase db) { try{ db.execSQL(create table + NotificationManager.getUserStatic(context) + log (+
this is my code to create database table String sqlQueryToCreateFileTable = create table if
This code is to create a new table. import android.database.sqlite.SQLiteOpenHelper; import android.content.Context; import android.database.sqlite.SQLiteDatabase;
With this code: var db = google.gears.factory.create('beta.database'); db.open('cominar'); db.execute('CREATE TABLE IF NOT EXISTS Ajax
Im create this code to store page view in database, but i have problem
This is my code to create: private static final String TABLE_CURRENT_GAME = current; private
I am using this code to check whether a database already exists: public static
Why does this code crash? CustomDatabaseHelper.java: public class CustomDatabaseHelper { SQLiteDatabase db; private static
I have made this code to open a database(created in SQLite browser) stored in
Why, this code create 2 the same columns in grid (Color and Color). How

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.