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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:29:07+00:00 2026-06-07T22:29:07+00:00

In my application i have an database in that i have 2 tables.I have

  • 0

In my application i have an database in that i have 2 tables.I have 2 following queries:

1.Is it possible to create database with some default value??
2.I have 1 screen in that i have 5 edit boxes,1 save button.When user press the save button the 5 edit boxes value should be updated (replace the old) in the database?

Please help me.

This is for creating database:

private static final String DATABASE_SPIN=
"create table spinner(_id integer primary key autoincrement,"+" spin text not null);";

This is exesql:

public void onCreate(SQLiteDatabase db)
{
db.execSQL(DATABASE_SPIN);
}

My populate code is:

Cursor c=db.getAllTitlesSpin();
           startManagingCursor(c);
           int spinColumnIndex = c.getColumnIndexOrThrow("spin"); 

//          String group[]=getResources().getStringArray(R.array.group_array);

            ArrayAdapter<String> adapter1 = new ArrayAdapter<String>(
                    this, android.R.layout.simple_spinner_item);
            adapter1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
            s2.setAdapter(adapter1);    

            if (c.moveToFirst()) { 
                do { 
                    adapter1.add(c.getString(spinColumnIndex)); 
                } 
                while (c.moveToNext()); 
                if (db != null) { 
                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-07T22:29:09+00:00Added an answer on June 7, 2026 at 10:29 pm
    • you can create tables with default values in columns

    Each time a row is inserted into the table by an INSERT statement that
    does not provide explicit values for all table columns the values
    stored in the new row are determined by their default values, as
    follows:

    If the default value of the column is a constant NULL, text, blob or
    signed-number value, then that value is used directly in the new row.

    If the default value of a column is an expression in parentheses,
    then the expression is evaluated once for each row inserted and the
    results used in the new row.

    If the default value of a column is CURRENT_TIME, CURRENT_DATE or
    CURRENT_TIMESTAMP, then the value used in the new row is a text
    representation of the current UTC date and/or time. For CURRENT_TIME,
    the format of the value is “HH:MM:SS”. For CURRENT_DATE, “YYYY-MM-DD”.
    The format for CURRENT_TIMESTAMP is “YYYY-MM-DD HH:MM:SS”.

    • you can create and populate a table with output of a Select query (CREATE TABLE … AS SELECT Statements )
    • You can copy the contents of one table and use it to populate another table as long the structure of the tables are same. INSERT INTO Destination SELECT * FROM Source;
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Android application that uses the Android database to create tables and
I have an application in mind which dicates database tables be append-only; that is,
I am writing an application that will display database queries. There are different tables
In the database, I have a definition table that is read from the application
I have an application that has a status table see Database best practices -
I have a completely empty RavenHQ database that's linked to my Appharbor application. The
I have an application in XCode using the sqlite/coredata database and that has already
I have a database in my local machine. I have a C# application that
I have a database on SQL Server 2008. I have an ASP.NET application that
We have an application that has a database full of polygons (currently stored as

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.