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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:17:08+00:00 2026-06-03T03:17:08+00:00

I am creating a table that has a total of five columns. DUring the

  • 0

I am creating a table that has a total of five columns. DUring the main “create” process, I only have enough data to populate four of the columns. Later in the execution of the program, I have the data for the fifth column. I start performing an “INSERT OR REPLACE”. But! I only use the key column and the fifth column in the statement.

When I browse the database, columns two through four are NULL. So, the question is: Is there a way to only update a specific column (including the key) while keeping the existing data in tact?

  • 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-03T03:17:09+00:00Added an answer on June 3, 2026 at 3:17 am

    INSERT OR REPLACE is the wrong statement, as you’ve discovered. Unless you can provide correct values for all the columns, an UPDATE statement is a better choice. Just update the column.

    update your_table_name 
    set your_column_name = 'New Value'
    where your_key_column = 'Something';
    

    In many applications, more caution is called for.

    update your_table_name 
    set your_column_name = 'New Value'
    where your_key_column = 'Something' 
      and your_column_name is null;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a table transactions that has columns acct_id trans_date and trans_type and
I have a table that has following columns id store_id store_name id and store_id
I'm creating a custom table that has a button which allows a user to
I have a table that has a column which holds the id of a
I'm programatically creating a custom section header for a table that has a width
I'm creating a table that has a basisId field as the primary key. There's
I would like to create a table that has both a column for created
I have a DetailsView control that I want to populate with a data table.
I have a table that has a smalldatetime NOT NULL field with a default
I have a temporary table I'm creating in a sproc that houses my user

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.