Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2013
    Posts
    25

    Unanswered: Lookup/Attribute

    Hi All I am very new to oracle.
    I have a view having a where condition where brand in ('HP')
    Now my report will run for HP Brand
    But tomorrow if i want to run the report for different brand without modified the view or report
    So i think i need a create something like Lookup/Attribute table
    Please suggest the process how to create and how to pass the value to my view

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    VIEW is static SQL.
    You do not pass value to any VIEW.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool

    Quote Originally Posted by divyavani View Post
    Hi All I am very new to oracle.
    I have a view having a where condition where brand in ('HP')
    Now my report will run for HP Brand
    But tomorrow if i want to run the report for different brand without modified the view or report
    So i think i need a create something like Lookup/Attribute table
    Please suggest the process how to create and how to pass the value to my view
    Remove the "where" condition from the view and supply it when you select:
    For example,
    Old view:
    Code:
    CREATE OR REPLACE VIEW MyProducts_vw IS
    SELECT * FROM MyProducts
     WHERE brand IN ('HP')
    /
    New view:
    Code:
    CREATE OR REPLACE VIEW MyProducts_vw IS
    SELECT * FROM MyProducts
    /
    -- And then provide the where in the select
    SELECT * FROM MyProducts_vw
     WHERE brand IN ('HP','APPLE','SUN')
    /
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

Posting Permissions

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