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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:47:27+00:00 2026-05-23T16:47:27+00:00

Database – Failure 1 (near text : syntax error) on 0x25c768 when preparing… This

  • 0

Database – Failure 1 (near “text” : syntax error) on 0x25c768 when preparing…

This is the error that shows up in LogCat when I try to run my app. I have the following code setting up the database:

private static final String DATABASE_NAME = "recipesDB";
private static final String DATABASE_TABLE = "recipes";
private static int DATABASE_VERSION = 1;

public static final String KEY_NAME = "name";
public static final String KEY_TYPE = "type";
public static final String KEY_INGREDIENTS = "ingredients";
public static final String KEY_NOTES = "notes";
public static final String KEY_BOIL = "boil";
public static final String KEY_PRIMARY = "primary";
public static final String KEY_SECONDARY = "secondary";
public static final String KEY_ROWID = "_id";
private DatabaseHelper mDbHelper; // DatabaseHelper is an inner class extending SQLiteOpenHelper

private SQLiteDatabase mDb;

private static final String DATABASE_CREATE = 
    "create table " + DATABASE_TABLE + " ("
    + KEY_ROWID + " integer primary key autoincrement, "
    + KEY_INGREDIENTS + " text not null, "
    + KEY_NOTES + " text not null, "
    + KEY_BOIL + " text not null, "
    + KEY_PRIMARY + " text not null, "
    + KEY_SECONDARY + " text not null); ";

private final Context cntx;

public recipesDB(Context cnt){
    this.cntx = cnt;
}

I’m pretty lost as to why I am getting this error since the code and syntax seem to be fine. I get a run-time error when I run the app on my phone and click on the button which opens up the activityList. There is more code not shown that opens up and catches a SQLExpection on open(), etc.

Any suggestions?

  • 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-23T16:47:27+00:00Added an answer on May 23, 2026 at 4:47 pm

    Try renaming the column “primary” — it’s a reserved word (as in primary key autoincrement…) and may be causing SQLite to choke.

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

Sidebar

Related Questions

My database has a products table. This contains a column called layers . That
Database has tables Photos and PhotoAlbums. I need a query that will select all
A database application that I'm currently working on, stores all sorts of settings in
The Database Tuning Advisor is recommending that I create a bunch of statistics in
Database has table X and tables An, Bn, Cn, Dn that inherits from X.
My DataBase Table Structure is like this : ID(Primary Key ) , Title (Nvarchar)
Our database server work properly and all the sites that work on from it,
Database resources, that can be accessed from webpage that I'm currently working on, have
The database my application uses has field names containing spaces. I believe this to
Database? Page variables? Enum? I'm looking for opinions here.

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.