Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2004
    Posts
    38

    Unhappy Unanswered: Information Constraint

    Hello,

    I've created a table which implements Informational constraint as follows

    create table tab1(SNum integer, Name char(30), constraint c1 check (Num > 10) no enforced enable query optimization)

    (Not sure whether this implements informational constraint)

    After inserting the following records
    1, Abdul
    2, Babu
    3, Chand
    11, Ravi
    12, Ram

    I feel that select statement on tab1 would return me the last 2 records, (11 Ravi and 12 Ram) as per the informational constraint. But I'm getting all the inserted records in the output.

    Can any one help me on this?

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Informational constraints are strictly to help the optimizer to understand the type of contents and values of the column and get better optimized queries

    Otherwise, for your application/SQL resultset, informational constrains do not mean anything serious ..

    HTH

    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  3. #3
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    You can implement what you want through a view:

    create view myview as select * from tab1 where num > 10

    Then when you run you query, do it against the view:

    select * from myview

    should get you the results you want.

    HTH

    Andy

Posting Permissions

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