DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: How To Use The Select Statement To Display No Null Values

Hybrid View

  1. #1
    Join Date
    Mar 2007
    Posts
    7

    How To Use The Select Statement To Display No Null Values

    HI,

    IAM A NEWBIE TO PL/SQL.i have created a table with 50 fields.in which i have inserted values in 5 fields.what i need is if iam going to select the record with some condidtion it should not display all the records only the fields with value should be displayed.
    i have pasted my script.pls check out and tell me.

    declare
    a number:=1;
    Mnemonic number;
    "@id" number;
    BEGIN
    loop
    exit when a>10;
    a :=a+1;
    "@id" :=1001+a;
    Mnemonic:=111+a;

    INSERT INTO CUSTOMER ("@id","Mnemonic","Gb Short Name","Gb Name 1","Gb Street","Sector") VALUES ("@id",Mnemonic,'ratheesh','name','anna nagar','1001');
    commit;
    END LOOP;
    END;

    pls help me out..

  2. #2
    I would think you would have to define a collection, iterate through each column of each row to determine which columns are not null, then copy the relevant values into the collection.

    The more important question though is 'why'? I tend to think that your data model needs some work if you are attempting to do this.

  3. #3
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    Also, you're going to regret those column names and the need to wrap them in double quotes everytime you reference them.
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  4. #4
    Join Date
    Mar 2006
    Posts
    74
    i agree with the others.. first, tell us why you want no nulls? nulls are very important.. its like saying "I only want to breathe oxygen, i dont have any use for the 78% nitrogen in the air that I breathe, can someone tell me how you remove it, so I dont have to breathe it?"

Posting Permissions

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


Click Here to Expand Forum to Full Width