locked
how to create view that prints function data RRS feed

  • Question

  • User-644330731 posted

    Dear all,

            i have a function in oracle that  returns multiple rows and it accepts EmpCode. now i want to create view which comprises of function data and

    all details from EmpMaster how can i create such a view ?

    Saturday, July 19, 2014 7:28 AM

All replies

  • User269602965 posted

    CREATE OR REPLACE VIEW vw_MYDATA

    AS

    SELECT

      a.PRIMARY_KEY,

      a. DATA_ELEMENT1

      b.DATA_ELEMENT2

    FROM

      TABLE1 a

    INNER JOIN TABLE2 b on a.PRIMARY_KEY = b.FOREIGN_KEY

    /

    Foreign key being the one to many values related to the primary key, in this case your EMP_CODE.

    Yes, when I create data applications, I never show data from the base or raw data table, I always create views and only GRANT SELECT on the VIEW to data users to isolate my data tables from the users as one layer of security and data integrity.  VIEW also allow you to do dynamic things as well, like JOIN tables, transform data for presentation purposes, and apply dynamic filters to certain columns derived from the user interface.  One view... many uses!!

     

    Saturday, July 19, 2014 1:55 PM