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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:42:50+00:00 2026-05-31T05:42:50+00:00

I have a few create statements that should be run when a database is

  • 0

I have a few create statements that should be run when a database is first created in my Android application. They are formatted as such:

<string-array
        name="uaDBcreates">
        <item>
            CREATE TABLE pos_locations (
                _id INTEGER PRIMARY KEY,
                location_name TEXT,
                service_url TEXT,
                latitude REAL DEFAULT 0,
                longitude REAL DEFAULT 0
            );
        </item>
    </string-array>

    <string-array
        name="uaDBInserts">
        <item>
            INSERT INTO urbanAgendaDB.pos_locations (
                    _id,
                    location_name,
                    service_url
                    latitude,
                    longitude )
                VALUES (
                    000001,
                    OfficeTest,
                    http://myservice.com/DoStuff,
                    45.530315,
                    -73.569939);
        </item>
    </string-array>

Generally, is this the proper formatting for SQL statements that could be run in SQLite on Android (are thise likely to work)? More specifically, parts of the Android docs state SQL statements should not terminated with a semi-colon, while parts make no mention of semi-colons.

  • 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-31T05:42:56+00:00Added an answer on May 31, 2026 at 5:42 am

    I haven’t used INSERT statements with a direct SQL syntax, only by means of the SQLDatabase API; but from my experience I would say that your CREATE statement will work as written.

    As far as the API docs are concerned, it’s quite simple: use those statements with whatever method allows semicolons; strip semicolons if you need to use those same statements with methods that do not allow them at their end. (You may also work it the other way around: avoid semicolons in your statements, then add proper ending punctuation only when you use those statements with API methods requiring semicolons.)

    However, I’m a bit baffled by the fact you are including your SQL statements in XML (not to mention that they are the only item in a string-array). Typically, I’m used to see them in Java code, under the form of String concatenations.

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

Sidebar

Related Questions

I created an Android project a few months ago and now have to automate
I have a text file with a few SQL statements in it that I
As part of my integration strategy, I have a few SQL scripts that run
I have a few buttons that should make it simple to add accents to
hi i created a simple php/mysql/Ajax chat application and I have a few questions.
I have few question in this regard When you create an internet page, does
I need to create an excel file via C#. I have read a few
I have the following code to create and apply a few styles for a
I have a class which would create a bean and the bean has few
I have a few divs created dynamically in Javascript.I was wondering if it is

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.