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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:24:03+00:00 2026-05-27T06:24:03+00:00

Iam coding in c and using sqlite3 as database .I want to ask that

  • 0

Iam coding in c and using sqlite3 as database .I want to ask that how can we check whether no. of columns in a table got changed or not. Situation is like this that i am going to run the application with new executable according to which new columns will be added in the table.So when the DB will be created again application should check whether the table schema is same or not and according to the new schema it should create table.Iam developing application for a embedded enviroment(specifically for a device).

When iam changing the number of columns of table in db and running new executable in the device new tables are not getting created because of the presence of old tables but when iam deleting the old db and creating fresh tables then changes are coming.So how to handle this situation ?

Platform : Linux , gcc compiler
Thanks in advance

Pls guide me like this : (assuming Old DB is already present )

That firstly we have to check for the schema of Old DB and if there is any change in some of the tables(like some new columns added or deleted ) then create the new DB according to that .

  • 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-27T06:24:04+00:00Added an answer on May 27, 2026 at 6:24 am

    Use Versioning and Explicit Column References

    You can make use of database versioning to help assist with this sort of problem.

    1. Create a separate table with only one column and one record to store the database version.

    2. Whenever you upgrade your database, set the version number in the separate table.

    3. Design your insert queries to specify the columns.

    4. Define default values for new columns so that old programs insert default values.

    Examples

    UPDATE databaseVersion SET version=2;
    

    Version 1 Query

    INSERT INTO MyTable (id, var1, var2) VALUES (2, '5', '6');
    

    Version 2 Query

    INSERT INTO MyTable (id, var1, var2, var3) VALUES (3, '5', '6', '7');
    

    This way your queries should still be compatible on the new DB when using the old program.

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

Sidebar

Related Questions

I am coding in C for a device that is using ARM architecture. I
Iam coding a solution for web automation, I have been using the default web
I have a problem. I am coding using VS2008. I am calling webservices from
Greetings, I have a problem using jqgrid and jquery tab (I am coding in
I am using visual basic for coding. In my form I have a delete
I am using visual studio 2008 coding asp.net.vb I have 20 images on my
I am using Windows7 and I do lot of Java coding in Eclipse. But
I am working with VS 2005 and using visual basic for coding. How do
This is specifically related to ARM Neon SIMD coding. I am using ARM Neon
I am coding a feature in a program where users can edit documents stored

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.