Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    12

    Unanswered: Primary key in a table derived from a structured type

    Hey,

    I have the following:

    CREATE TYPE MovieType AS ( title Char(30) , year Integer, inColor Char(1) ) MODE DB2SQL

    I want to do something like this:

    CREATE TABLE movie OF MovieType ( REF IS movieID USER GENERATED, PRIMARY KEY (title , year))

    This don't work, because title and year can be null. but how can I define title and year not to be null?

  2. #2
    Join Date
    Jul 2003
    Location
    Austin, TX, USA
    Posts
    278

    Base Definition

    Hi,

    The only way is to change the base definition of your table and define the wsame as not null . for eg title char(30) not null, year integer not null. This is the solution as a primary keys can't have null values.

    HTH

    Nitin.
    HTH

    Nitin

    Ask the experienced rather than the learned

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •