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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:30:52+00:00 2026-06-11T04:30:52+00:00

I am facing one problem. I have a table already create in DB2. CREATE

  • 0

I am facing one problem. I have a table already create in DB2.

CREATE TABLE "DDL12"
(
 "D4_1" decimal(10,0),
 "D4_2" decimal(10,0),
);

I am trying to create a PK on this table as :-

ALTER TABLE "DDL12" ADD CONSTRAINT "Key4" PRIMARY KEY ("D4_1");

But while running the command, I am getting the error saying D4_1 is NULLABLE.

Now, how can I create a PK on this table?

Thanks

  • 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-11T04:30:54+00:00Added an answer on June 11, 2026 at 4:30 am

    Yes, this is due the fact, that your database “could have” rows having NULL value in that non PK column right now.

    So first set the column to NOT NULL (+ make sure having a unique value in all rows) and then set the primary key with the command above.

    You can change a column to not NULL like this:

    ALTER TABLE "DDL12"
     MODIFY "D4_1"   decimal(10,0)     NOT NULL;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am facing one problem. I have to create asp.net 4.0 web application which
i am facing one problem.i have a class named ReportingService and it should be
I am facing problem with Inner join in Access Database. I have two table
I am facing one problem in setting the scollbar in tableviewer. I have around
i am facing one problem i have two xml files. Plugins.xml <SolutionProfile xmlns=http://schemas.microsoft.com/pag/cab-profile> <Modules>
I am facing one problem. I have a directory named as Album under my
Im facing one problem in streaming data capture for reading the broadcast data during
We are facing one problem with DownloadStringCompleted method always returning same result in windows
I'm developing android application with phonegap . Currently I'm facing one problem with inputbox
I am learning OpenCV using Learning OpenCV book. One problem I am facing while

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.