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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:43:20+00:00 2026-06-14T11:43:20+00:00

I don’t see any mistakes with my code, I browsed questions with the same

  • 0

I don’t see any mistakes with my code, I browsed questions with the same issue but I couldn’t solve
it, I tried upgrading the sql version from 1 to 2, but still same error.

Is there anything wrong with my code?

public String place_ID = "id";
public String place_LAT = "LAT";
public String place_LNG = "LNG"; 
public String place_name = "name";
public String place_number = "number";
public String place_city = "city";
public String place_country = "country";
public String place_street = "street";
public String place_smallDesc = "smallDesc";
public String place_bigDesc = "bigDesc";
public String place_site = "site";
public String place_category = "category";
public String place_imageName ="image";
public String place_rank = "rank";

final static String PASS = "testPass";
final static String db_Name = "placesManager";
final static String DBTABLE_NAME_STRING = "places";
public DatabaseHelper(Context context) {
    super(context, db_Name,null,2);
    // TODO Auto-generated constructor stub
}
@Override
public void onCreate(SQLiteDatabase db) {
String createDBQuery = "CREATE TABLE " + DBTABLE_NAME_STRING + "("
        + place_ID + " INTEGER PRIMARY KEY," + place_LAT + " REAL,"
        + place_name + " TEXT,"  + place_number + " TEXT,"
        + place_city + " TEXT,"  + place_country + " TEXT,"
        + place_street + " TEXT" + place_smallDesc + " TEXT,"
                + place_site + " TEXT" + place_category + " TEXT,"
                + place_imageName + " TEXT"+ place_rank + " INTEGER " + ")";
    db.execSQL(createDBQuery);
}
public void AddPlaces(ArrayList<Place> placesList)
{
    SQLiteDatabase db = this.getWritableDatabase(PASS);
    ContentValues cValues = new ContentValues();
    Log.d("MyTag","inserting");
    for(int i = 0;i<placesList.size();i++)
    {
    cValues.put(place_ID, placesList.get(i).ID);
    cValues.put(place_LAT, placesList.get(i).LAT);
    cValues.put(place_LNG, placesList.get(i).LNG);
    cValues.put(place_name, placesList.get(i).name);
    cValues.put(place_number, placesList.get(i).number);
    cValues.put(place_city, placesList.get(i).city);
    cValues.put(place_ID, placesList.get(i).ID);
    cValues.put(place_street, placesList.get(i).street);
    cValues.put(place_smallDesc, placesList.get(i).smallDesc);
    cValues.put(place_site, placesList.get(i).site);
    cValues.put(place_category, placesList.get(i).category);
    cValues.put(place_imageName, placesList.get(i).imageName);
    cValues.put(place_rank, placesList.get(i).rating);

    db.insert(DBTABLE_NAME_STRING, null, cValues);
    }
    Log.d("MyTag","done inserting");
    db.close();
}
  • 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-14T11:43:22+00:00Added an answer on June 14, 2026 at 11:43 am

    Inside onCreate you have:

     + place_street + " TEXT" + place_smallDesc + " TEXT,"
    

    should be like below(missed colon), due to colon miss, both merged and table will have completely different column name than you are assuming.

     + place_street + " TEXT, " + place_smallDesc + " TEXT,"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(Don't know if this is strictly on-topic, but I don't see any better Stack
I don't know why, but this code worked for me a month ago... maybe
Don't ask why, but is there any way to suppress a failed linking error?
don't know better title for this, but here's my code. I have class user
Don't know how to frase this but I found this code wich works as
don't know if the title describes anything about what I'm trying to say but
Don't ask me how but I'm in a situation where I have DCPs published
Don't be scared of the extensive code. The problem is general. I just provided
Don't dismiss this as a newbie question! It's not, I'm not, I've tried everything,
Don't really know how to formulate the title, but it should be pretty obvious

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.