View doubt

this is my query for a view
SELECT ot.p_date process_date, fnc."PARTY_NAME", fnc."CNTR_CODE",
fnc."BILL_ID", fnc."BILL_NO", fnc."BILL_AMT", fnc."BILL_OUT",
fnc."DEVTN_AMT", fnc."RECEIVED_AMT"
FROM as_on_date_out_tab ot, TABLE (as_on_date_out (ot.p_date)) fnc
where ot.p_date <=trunc(sysdate)
in this as_on_date_out_tab is a valid data....i dont understand what " TABLE (as_on_date_out (ot.p_date)) fnc " means...?
Please elaborate

as_on_date_out is likely a pipelined table function. A pipelined table function can be treated like a table in a SQL statement using the TABLE() operator. So
TABLE (as_on_date_out (ot.p_date)) calls the pipelined table function as_on_date_out passing in as a parameter ot.p_date and treats the collection returned from the function as a table.
Justin

Similar Messages

  • Sql View Doubt

    Hi all...
    I am beginner of oracle sql 10g and also trainee.. i know why v r using views but im getting confused to use views bcoz im little weak to understand in english.. i have one doubt is it possible to use views in same table? can any one tell me?
    Thankz

    Think of a view as a stored query. A view can be created by querying one table or from a complex query joining many tables. But the end-user just sees the result, which looks like a table of rows to them. Generally you aren't trying to hide implementation but either hide sensitive data or filter unimportant data. For instance, let's say you have an employee table that has all sorts of information about an employee. Some of that information is sensitive (like their salary, any medical information, etc.). Other information (e.g., what department they work in, who their manager is) is not sensitive. If all that information is in one table but you want to hide the salary information from everyone but the HR dept., then you could make a view that selects the non-sensitive columns from the employee table and only grant select on that view to non-HR personnel. If you wanted managers only to have access to certain data in the employee table for employees that they manage, you could make a view for that as well.

  • Materialized views Doubt

    Hi All,
    I have a question regarding materialized view.
    I am adding new columns to the base table of a materialized view.As part of this I do recompiling dependent objects.Do I need to take any action on materialized views? I mean Validating or recreating?
    Thanks
    Hena

    Assuming that you're not expecting the new column to appear in the materialized view, you shouldn't need to do anything.
    Justin

  • Validations in XI

    hi,
    would you recommend to do validation in xI?
    for example , check if specific field contains more/less then x charachters? date is recieved in the right format , etc ....
    if yes how would you implement it?

    Hi Udi,
    >>>>would you recommend to do validation in xI?
    That depends on your scenario and its requirements. Usually the receiving application checks the business content and if it cant handle the data an exception should be raised. In case of synchronous communictation it should be easy to inform the sender about error/success; in case of asynchronous communication acknowledgements are used for that (more difficult). Additional you can configure alert categories and rules.
    Doing validations at XI is - in my point of view - doubtful because of redundance. The tasks of XI are routing, mapping, controlling (BP) messages, not doing the applications work. In case of special requirements a validation can be recommentable - of course.
    Regards,
    Udo

  • Doubt in attribute view on joining the table .

    Hello Team
                        Can some please help me in clearing the following doubts on joining tables .
    i) Can we perform a self join in attribute view in HANA . like for ex :- joining a table to itself .
    ii)Can we create an analytic view without creating an attribute view i.e creating an analytic view directly on tables .
    iii)When aggregation happens in calculation view exactly what happens internally .
    Please suggest me with the solution of these doubts .
    Regards

    Hi Prag,
    As Rashmi has answered your question, i would like to add up to it few more important points.
    1. Do not perform self join as it will return uncertain results. It is better to avoid self join.
    You can create a copy of the same table and perform join which will be consistent.
    2. In an analytic view, you will be adding table to data foundation, select the output fields.In the logical join node by default your data foundation will be present (this will contain the fields that you selected for output), you need not add any attribute view to this logical join node, leave it to default. In the semantics node select the attributes and measures. Perform validation and then activate. Your analytic view without attribute view is ready. You can check the data preview.
    3. In a calculation view, the records gets grouped by all the attributes and then the measures are calculated based on this grouping by using the mentioned aggregation (sum/max/min).
    Eg.
    Customer ID 0Calmonth Amount (aggregation = max)
    1001               01.2014     100         
    1001               01.2014     400
    1002               01.2014     200
    Output:
    Customer ID 0Calmonth Amount (aggregation = max)
    1001               01.2014     400
    1002               01.2014     200
    Hope this clarifies your doubts.
    Thanks and Regards,
    M.N.Adinarayanan

  • Doubt about Tunning View Objects

    Hi !. I have the following doubt about tunning View Objects:
    If I have the following configuration on a VO:
    All Rows
    In Batches Of: 11
    As Needed
    Access Mode: Scrollable
    Range Size: 10
    Total Records On The Table: More than 100
    What would happen is that while the initial render, the view cache is fetch with 11 rows from the table and the ui table shows 10. In subsequent scroll events, more queries again will be done but not when the user scrolls back. My doubt is this one: Why, while the initial render If I put a breakpoint in this overrided method executeQueryForCollection, the execution reachs there but in subsequent scroll events (forward) the execution doesn't reach there ?. I understand thast this should happen as the required rows are not yet in the cache. I would like to know a way to test this access mode and what method is executed in every roundtrip to the DB. Thankx !.

    I don't think ADF needs to execute the query again - it just needs to fetch the next set of records.
    So if the cursor is already open, no need to issue another query.
    You can use the HTTP Analyzer to watch network traffic
    Monitoring ADF Pages Round-Trips with the HTTP Analyzer
    And you can use the logging features of ADF to see the queries being executed.
    Declarative View Objects (VOs) for better ADF performance

  • Doubts related to views urgent help needed

    Hi all ,
    i am new to oracle technology and have a doubt related to VIEWS
    i have a master table job_master and i have preapred a view of the master table as
    job_master_view
    The view i created as create view job_master_view as select * from job_master
    Now my doubt is if i exevute a SELECT FOR UPDATE NOWAIT query on the view job_master_view then will corresponding row of the master table also be locked
    I am trying to execute above query to avoid simultaneous access by multiple users
    I the above approach correct ? and will the row of master table get locked ?
    please let me know in case my query is not clear
    Thanking in advance
    Regards

    My question is, how long you are going to hold lock on these table? If not, you can only use select for update with requried records using where cluase. I also suggest other application which updates this table to use same kind of statement, with NOWAIT caluse, when these applicationg trying to get a lock on these records and found already locked my other, it wont block or wait, just statement fails and can be re-tried again.
    Bascially triggers are used for sort of action not for selecting data. What you can do is that develop a procedure and call it in the trigger and in the procedure you can easily use dbms_outout.put_line to display output on the sqlprompt.
    Jaffar

  • Doubt in  Fetching data from a View

    Hi all,
    I want a data from a view  v_tvko.How to use a view in program for  fetching data from that.
    Please help.
    Thanks in advance.
    Nithin.

    Hi Nitin,
    We can't directly refer a view to get data.
    We need to refer the tables using which a view has been created.
    Using those tables, we can fetch the data as per our requirement.
    For suppose, if you go to a view in SE11, then click on Tables tab, there you can get the reference tables.Then you need to check for the fileld in those tables for which you require the data.
    Post the query directly on the table instead of view.
    Hope this will help you.
    Regards,
    Anand.

  • View's In Oracle - Performance Issues -some doubts

    Hi,
    "I have some tables with names T_SRI_MMYYYY in my database.
    I created a view ,Say "Summary_View" for all the table names
    with "T_SRI_%".
    Now i want to select data from all the tables in the view
    Summary_View.
    How can i do that ? Please throw some light on the same?
    Thanks and Regards
    Srinivas Chebolu

    I've got no idea what this has to do with the subject you
    posted. But you can do this:
    spool alltabs.sql
    SELECT 'select * from '||table_name||';'
    FROM summary_views
    spool off
    and then from sql*Plus just run @alltabs
    If you want to do this in PL/SQL you'll have to do something
    fancy with EXECUTE IMMEDIATE.
    Regards, APC

  • Doubt Regarding Materialized View

    Hello,
    I am working on Oracle 10g.
    We have multiple materialized Views which we Refresh in every 15 mins. My question is that can we get data from these MV's for a particular date....??

    When i am Executing a query ..which was mentioned in the earlier post...m getting a particular error.
    My Query
    select * from db_rational_status_reaffirm_mv as of timestamp sysdate-1
    Error m Getting
    ORA-01555: snapshot too old : rollback segment number 4 with name "_SYSSMU4$" too small
    Any Solution ..?

  • Doubt on Materialized view

    Hi all,
    I want to create materialized view, which will refresh the materialized view whenever, there is COMMIT on base table. The following
    statement is correct for this requirement.
    CREATE MATERIALIZED VIEW my_MV
    BUILD IMMEDIATE
    REFRESH COMPLETE
    ON COMMIT
    AS SELECT * FROM EMP@REMOTEDB;
    and my question here is , is START WITH and NEXT values are required to fullfill my requirement.
    Thanks,
    Pal

    Hi,
    If U need view to referesh to when base table is committed, then no need of start with and next.
    START WITH CLAUSE --- > Specify a datetime expression for the first automatic refresh time
    NEXT Clause --->
    Specify a datetime expression for calculating the interval between automatic refreshes.
    Both the START WITH and NEXT values must evaluate to a time in the future. If you omit the START WITH value, then the database determines the first automatic refresh time by evaluating the NEXT expression with respect to the creation time of the materialized view. If you specify a START WITH value but omit the NEXT value, then the database refreshes the materialized view only once. If you omit both the START WITH and NEXT values, or if you omit the create_mv_refresh entirely, then the database does not automatically refresh the materialized view.
    Regards,
    Simma,,,

  • Urgent ....Doubt on Views in ORACLE

    hai,
    i am learner...
    can we pass parameters in Views just like Procedures and Functions.
    regards
    madhava

    No, here you can read more:
    http://www.oracle.com/pls/tahiti/tahiti.tabbed?section=73973

  • Doubts: Freinds Share your Views !!

    1.How do you tell what your machine name is and what is its IP address? (in Solaris)
    2.Other than making use of the statspack utility, what would you check when you are
    monitoring or running a health check on an Oracle 8i or 9i database?
    3.How would you go about verifying the network name that the local_listener is currently using?
    4.How would you edit your CRONTAB to schedule the running of /test/test.sh to run
    every other day at 2PM?
    5.Which dictionary view(s) would you first look at to understand or get a high-level idea of
    a given Advanced Replication environment?
    6.You’re getting high “busy buffer waits” - how can you find what’s causing it?
    7.Database crashes. Corruption is found scattered among the file system neither of your doing
    nor of Oracle’s. What database recovery options are available? Database is in archive log mode
    8.Illustrate how to determine the amount of physical CPUs a Unix Box possesses (LINUX and/or Solaris).
    9.How do you increase the OS limitation for open files (LINUX and/or Solaris)?
    10.How does Oracle guarantee data integrity of data changes?
    11.Why does Oracle not permit the use of PCTUSED with indexes?
    12.How would you begin to troubleshoot an ORA-3113 error?
    13.What would you use to improve performance on an insert statement
    that places millions of rows into that table?
    14.How would you configure your networking files to connect to a database
    by the name of DSS which resides in domain icallinc.com?
    15.You create a private database link <link name> and upon connection, fails with:
    ORA-2085: <Link name> connects to <fully qualified remote db name>. What is the problem?
    How would you go about resolving this error?
    16.Database is hung. Old and new user connections alike hang on impact.
    What do you do? Your SYS SQLPLUS session IS able to connect.

    1.How do you tell what your machine name is and what is its IP address? (Solaris)
    uname -n should give you the name of the machine.
    You could check the 'hosts' file in '/etc' for the IP address.
    2. Other than making use of the statspack utility, what would you check when you are
    monitoring or running a health check on an Oracle 8i or 9i database?
    Ensure that the Organization's data is safe and recoverable. Ensure that the database is open and available for normal use. Check the alert log for any errors. Check for any dumps. Check for any job failures. Check for availability of disk space. Apply patches as recommended by Oracle. There is much more.
    8. Illustrate how to determine the amount of physical CPUs a Unix Box possesses (LINUX and/or Solaris).
    uname -X should give you some information about the number of CPU's. You could use a command like df -k
    to get information about disk space.

  • Doubt in Create View Syntax

    Hi All,
    I want to know the logic behind the following create view statement. Primarily I want to know about the significance of "with" statement in the following command.
    CREATE OR REPLACE FORCE VIEW ODS_DEV.RPT_BU_GEN_REV_V_2
    (HRCHY_ID, FRE_ID, S_BU_ID, BU_ID, EFF_FROM_DT,
    EFF_TO_DT, ACTIVE_FLG, HRCHY_NM_LONG, HRCHY_LVL_NB, S_LVL1,
    LVL1, NM_LONG_1, LOB_CD_1, LVL_NB_1, LVL_NM_1,
    S_LVL2, LVL2, NM_LONG_2, LOB_CD_2, LVL_NB_2,
    LVL_NM_2, S_LVL3, LVL3, NM_LONG_3, LOB_CD_3,
    LVL_NB_3, LVL_NM_3, S_LVL4, LVL4, NM_LONG_4,
    LOB_CD_4, LVL_NB_4, LVL_NM_4, S_LVL5, LVL5,
    NM_LONG_5, LOB_CD_5, LVL_NB_5, LVL_NM_5, S_LVL6,
    LVL6, NM_LONG_6, LOB_CD_6, LVL_NB_6, LVL_NM_6,
    S_LVL7, LVL7, NM_LONG_7, LOB_CD_7, LVL_NB_7,
    LVL_NM_7, S_LVL8, LVL8, NM_LONG_8, LOB_CD_8,
    LVL_NB_8, LVL_NM_8, S_LVL9, LVL9, NM_LONG_9,
    LOB_CD_9, LVL_NB_9, LVL_NM_9, S_LVL10, LVL10,
    NM_LONG_10, LOB_CD_10, LVL_NB_10, LVL_NM_10, S_LVL11,
    LVL11, NM_LONG_11, LOB_CD_11, LVL_NB_11, LVL_NM_11,
    S_LVL12, LVL12, NM_LONG_12, LOB_CD_12, LVL_NB_12,
    LVL_NM_12, S_LVL13, LVL13, NM_LONG_13, LOB_CD_13,
    LVL_NB_13, LVL_NM_13, S_LVL14, LVL14, NM_LONG_14,
    LOB_CD_14, LVL_NB_14, LVL_NM_14, S_LVL15, LVL15,
    NM_LONG_15, LOB_CD_15, LVL_NB_15, LVL_NM_15, S_LVL16,
    LVL16, NM_LONG_16, LOB_CD_16, LVL_NB_16, LVL_NM_16,
    S_LVL17, LVL17, NM_LONG_17, LOB_CD_17, LVL_NB_17,
    LVL_NM_17, S_LVL18, LVL18, NM_LONG_18, LOB_CD_18,
    LVL_NB_18, LVL_NM_18, S_LVL19, LVL19, NM_LONG_19,
    LOB_CD_19, LVL_NB_19, LVL_NM_19, S_LVL20, LVL20,
    NM_LONG_20, LOB_CD_20, LVL_NB_20, LVL_NM_20, S_LVL21,
    LVL21, NM_LONG_21, LOB_CD_21, LVL_NB_21, LVL_NM_21,
    S_LVL22, LVL22, NM_LONG_22, LOB_CD_22, LVL_NB_22,
    LVL_NM_22, S_LVL23, LVL23, NM_LONG_23, LOB_CD_23,
    LVL_NB_23, LVL_NM_23, S_LVL24, LVL24, NM_LONG_24,
    LOB_CD_24, LVL_NB_24, LVL_NM_24, S_LVL25, LVL25,
    NM_LONG_25, LOB_CD_25, LVL_NB_25, LVL_NM_25, S_LVL26,
    LVL26, NM_LONG_26, LOB_CD_26, LVL_NB_26, LVL_NM_26,
    S_LVL27, LVL27, NM_LONG_27, LOB_CD_27, LVL_NB_27,
    LVL_NM_27, S_LVL28, LVL28, NM_LONG_28, LOB_CD_28,
    LVL_NB_28, LVL_NM_28, S_LVL29, LVL29, NM_LONG_29,
    LOB_CD_29, LVL_NB_29, LVL_NM_29, S_LVL30, LVL30,
    NM_LONG_30, LOB_CD_30, LVL_NB_30, LVL_NM_30)
    AS
    WITH parse1 AS
    (SELECT hrchy_id, fre_id, bu_node_id s_node_id, eff_from_dt, eff_to_dt, active_flg, hrchy_nm_long,
         substr(path, instr(path, '/', 1, 1) +1, instr(path, '/', 1, 2) - instr(path, '/', 1, 1) -1) gen_prnt1,
         substr(path, instr(path, '/', 1, 2) +1, instr(path, '/', 1, 3) - instr(path, '/', 1, 2) -1) gen_prnt2,
         substr(path, instr(path, '/', 1, 3) +1, instr(path, '/', 1, 4) - instr(path, '/', 1, 3) -1) gen_prnt3,
         substr(path, instr(path, '/', 1, 4) +1, instr(path, '/', 1, 5) - instr(path, '/', 1, 4) -1) gen_prnt4,
         substr(path, instr(path, '/', 1, 5) +1, instr(path, '/', 1, 6) - instr(path, '/', 1, 5) -1) gen_prnt5,
         substr(path, instr(path, '/', 1, 6) +1, instr(path, '/', 1, 7) - instr(path, '/', 1, 6) -1) gen_prnt6,
         substr(path, instr(path, '/', 1, 7) +1, instr(path, '/', 1, 8) - instr(path, '/', 1, 7) -1) gen_prnt7,
         substr(path, instr(path, '/', 1, 8) +1, instr(path, '/', 1, 9) - instr(path, '/', 1, 8) -1) gen_prnt8,
         substr(path, instr(path, '/', 1, 9) +1, instr(path, '/', 1, 10) - instr(path, '/', 1, 9) -1) gen_prnt9,
         substr(path, instr(path, '/', 1, 10) +1, instr(path, '/', 1, 11) - instr(path, '/', 1, 10) -1) gen_prnt10,
         substr(path, instr(path, '/', 1, 11) +1, instr(path, '/', 1, 12) - instr(path, '/', 1, 11) -1) gen_prnt11,
         substr(path, instr(path, '/', 1, 12) +1, instr(path, '/', 1, 13) - instr(path, '/', 1, 12) -1) gen_prnt12,
         substr(path, instr(path, '/', 1, 13) +1, instr(path, '/', 1, 14) - instr(path, '/', 1, 13) -1) gen_prnt13,
         substr(path, instr(path, '/', 1, 14) +1, instr(path, '/', 1, 15) - instr(path, '/', 1, 14) -1) gen_prnt14,
         substr(path, instr(path, '/', 1, 15) +1, instr(path, '/', 1, 16) - instr(path, '/', 1, 15) -1) gen_prnt15,
         substr(path, instr(path, '/', 1, 16) +1, instr(path, '/', 1, 17) - instr(path, '/', 1, 16) -1) gen_prnt16,
         substr(path, instr(path, '/', 1, 17) +1, instr(path, '/', 1, 18) - instr(path, '/', 1, 17) -1) gen_prnt17,
         substr(path, instr(path, '/', 1, 18) +1, instr(path, '/', 1, 19) - instr(path, '/', 1, 18) -1) gen_prnt18,
         substr(path, instr(path, '/', 1, 19) +1, instr(path, '/', 1, 20) - instr(path, '/', 1, 19) -1) gen_prnt19,
         substr(path, instr(path, '/', 1, 20) +1, instr(path, '/', 1, 21) - instr(path, '/', 1, 20) -1) gen_prnt20,
         substr(path, instr(path, '/', 1, 21) +1, instr(path, '/', 1, 22) - instr(path, '/', 1, 21) -1) gen_prnt21,
         substr(path, instr(path, '/', 1, 22) +1, instr(path, '/', 1, 23) - instr(path, '/', 1, 22) -1) gen_prnt22,
         substr(path, instr(path, '/', 1, 23) +1, instr(path, '/', 1, 24) - instr(path, '/', 1, 23) -1) gen_prnt23,
         substr(path, instr(path, '/', 1, 24) +1, instr(path, '/', 1, 25) - instr(path, '/', 1, 24) -1) gen_prnt24,
         substr(path, instr(path, '/', 1, 25) +1, instr(path, '/', 1, 26) - instr(path, '/', 1, 25) -1) gen_prnt25,
         substr(path, instr(path, '/', 1, 26) +1, instr(path, '/', 1, 27) - instr(path, '/', 1, 26) -1) gen_prnt26,
         substr(path, instr(path, '/', 1, 27) +1, instr(path, '/', 1, 28) - instr(path, '/', 1, 27) -1) gen_prnt27,
         substr(path, instr(path, '/', 1, 28) +1, instr(path, '/', 1, 29) - instr(path, '/', 1, 28) -1) gen_prnt28,
         substr(path, instr(path, '/', 1, 29) +1, instr(path, '/', 1, 30) - instr(path, '/', 1, 29) -1) gen_prnt29,
         substr(path, instr(path, '/', 1, 30) +1, instr(path, '/', 1, 31) - instr(path, '/', 1, 30) -1) gen_prnt30,
    hrchy_lvl_nb
    FROM rpt_bu_gen_rev_v),
    parse2 AS
    (SELECT a.hrchy_id, a.fre_id, a.s_node_id s_bu_id, LTRIM(a.s_node_id,'S') bu_id, a.eff_from_dt, a.eff_to_dt,
    a.active_flg, a.hrchy_nm_long,
    a.hrchy_lvl_nb, a.gen_prnt1 s_lvl1,
    LTRIM (a.gen_prnt1, 'S') lvl1, a.gen_prnt2 s_lvl2,
    LTRIM (a.gen_prnt2, 'S') lvl2, a.gen_prnt3 s_lvl3,
    LTRIM (a.gen_prnt3, 'S') lvl3, a.gen_prnt4 s_lvl4,
    LTRIM (a.gen_prnt4, 'S') lvl4, a.gen_prnt5 s_lvl5,
    LTRIM (a.gen_prnt5, 'S') lvl5, a.gen_prnt6 s_lvl6,
    LTRIM (a.gen_prnt6, 'S') lvl6, a.gen_prnt7 s_lvl7,
    LTRIM (a.gen_prnt7, 'S') lvl7, a.gen_prnt8 s_lvl8,
    LTRIM (a.gen_prnt8, 'S') lvl8, a.gen_prnt9 s_lvl9,
    LTRIM (a.gen_prnt9, 'S') lvl9, a.gen_prnt10 s_lvl0,
    LTRIM (a.gen_prnt10, 'S') lvl10, a.gen_prnt11 s_lvl11,
    LTRIM (a.gen_prnt11, 'S') lvl11, a.gen_prnt12 s_lvl12,
    LTRIM (a.gen_prnt12, 'S') lvl12, a.gen_prnt13 s_lvl13,
    LTRIM (a.gen_prnt13, 'S') lvl13, a.gen_prnt14 s_lvl14,
    LTRIM (a.gen_prnt14, 'S') lvl14, a.gen_prnt15 s_lvl15,
    LTRIM (a.gen_prnt15, 'S') lvl15, a.gen_prnt16 s_lvl16,
    LTRIM (a.gen_prnt16, 'S') lvl16, a.gen_prnt17 s_lvl17,
    LTRIM (a.gen_prnt17, 'S') lvl17, a.gen_prnt18 s_lvl18,
    LTRIM (a.gen_prnt18, 'S') lvl18, a.gen_prnt19 s_lvl19,
    LTRIM (a.gen_prnt19, 'S') lvl19, a.gen_prnt20 s_lvl20,
    LTRIM (a.gen_prnt20, 'S') lvl20, a.gen_prnt21 s_lvl21,
    LTRIM (a.gen_prnt21, 'S') lvl21, a.gen_prnt22 s_lvl22,
    LTRIM (a.gen_prnt22, 'S') lvl22, a.gen_prnt23 s_lvl23,
    LTRIM (a.gen_prnt23, 'S') lvl23, a.gen_prnt24 s_lvl24,
    LTRIM (a.gen_prnt24, 'S') lvl24, a.gen_prnt25 s_lvl25,
    LTRIM (a.gen_prnt25, 'S') lvl25, a.gen_prnt26 s_lvl26,
    LTRIM (a.gen_prnt26, 'S') lvl26, a.gen_prnt27 s_lvl27,
    LTRIM (a.gen_prnt27, 'S') lvl27, a.gen_prnt28 s_lvl28,
    LTRIM (a.gen_prnt28, 'S') lvl28, a.gen_prnt29 s_lvl29,
    LTRIM (a.gen_prnt29, 'S') lvl29, a.gen_prnt30 s_lvl30,
    LTRIM (a.gen_prnt30, 'S') lvl30
    FROM parse1 a)
    SELECT b.hrchy_id, b.fre_id, b.s_bu_id, b.bu_id, b.eff_from_dt, b.eff_to_dt, b.active_flg, b.hrchy_nm_long, b.hrchy_lvl_nb,
    CAST(b.s_lvl1 AS VARCHAR2(13)) s_lvl1,
    CAST(b.lvl1 AS VARCHAR2(13)) lvl1,
    (CASE WHEN b.lvl1 is not null then (select x.nm_long from bu x where x.fre_id=b.fre_id and x.bu_id=b.lvl1)END) nm_long_1,
    (CASE WHEN b.lvl2 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl2)END) lob_cd_1,
    '' lvl_nb_1,
    '' lvl_nm_1,
    CAST(b.s_lvl2 AS VARCHAR2(13)) s_lvl2,
    CAST(b.lvl2 AS VARCHAR2(13)) lvl2,
    (CASE WHEN b.lvl2 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl2)END) nm_long_2,
    (CASE WHEN b.lvl2 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl2)END) lob_cd_2,
    '' lvl_nb_2,
    '' lvl_nm_2,
    CAST(b.s_lvl3 AS VARCHAR2(13)) s_lvl3,
    CAST(b.lvl3 AS VARCHAR2(13)) lvl,
    (CASE WHEN b.lvl3 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl3)END) nm_long_3,
    (CASE WHEN b.lvl3 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl3)END) lob_cd_3,
    '' lvl_nb_3,
    '' lvl_nm_3,
    CAST(b.s_lvl4 AS VARCHAR2(13)) s_lvl4,
    CAST(b.lvl4 AS VARCHAR2(13)) lvl4,
    (CASE WHEN b.lvl4 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl4)END) nm_long_4,
    (CASE WHEN b.lvl4 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl4)END) lob_cd_4,
    '' lvl_nb_4,
    '' lvl_nm_4,
    CAST(b.s_lvl5 AS VARCHAR2(13)) s_lvl5,
    CAST(b.lvl5 AS VARCHAR2(13)) lvl5,
    (CASE WHEN b.lvl5 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl5)END) nm_long_5,
    (CASE WHEN b.lvl5 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl5)END) lob_cd_5,
    '' lvl_nb_5,
    '' lvl_nm_5,
    CAST(b.s_lvl6 AS VARCHAR2(13)) s_lvl6,
    CAST(b.lvl6 AS VARCHAR2(13)) lvl6,
    (CASE WHEN b.lvl6 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl6)END) nm_long_6,
    (CASE WHEN b.lvl6 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl6)END) lob_cd_6,
    '' lvl_nb_6,
    '' lvl_nm_6,
    CAST(b.s_lvl7 AS VARCHAR2(13)) s_lvl7,
    CAST(b.lvl7 AS VARCHAR2(13)) lvl7,
    (CASE WHEN b.lvl7 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl7)END) nm_long_7,
    (CASE WHEN b.lvl7 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl7)END) lob_cd_7,
    '' lvl_nb_7,
    '' lvl_nm_7,
    CAST(b.s_lvl8 AS VARCHAR2(13)) s_lvl8,
    CAST(b.lvl8 AS VARCHAR2(13)) lvl8,
    (CASE WHEN b.lvl8 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl8)END) nm_long_8,
    (CASE WHEN b.lvl8 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl8)END) lob_cd_8,
    '' lvl_nb_8,
    '' lvl_nm_8,
    CAST(b.s_lvl9 AS VARCHAR2(13)) s_lvl9,
    CAST(b.lvl9 AS VARCHAR2(13)) lvl9,
    (CASE WHEN b.lvl9 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl9)END) nm_long_9,
    (CASE WHEN b.lvl9 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl9)END) lob_cd_9,
    '' lvl_nb_9,
    '' lvl_nm_9,
    CAST(b.s_lvl0 AS VARCHAR2(13)) s_lvl10,
    CAST(b.lvl10 AS VARCHAR2(13)) lvl10,
    (CASE WHEN b.lvl10 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl10)END) nm_long_10,
    (CASE WHEN b.lvl10 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl10)END) lob_cd_10,
    '' lvl_nb_10,
    '' lvl_nm_10,
    CAST(b.s_lvl11 AS VARCHAR2(13)) s_lvl11,
    CAST(b.lvl11 AS VARCHAR2(13)) lvl11,
    (CASE WHEN b.lvl11 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl11)END) nm_long_11,
    (CASE WHEN b.lvl11 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl11)END) lob_cd_11,
    '' lvl_nb_11,
    '' lvl_nm_11,
    CAST(b.s_lvl12 AS VARCHAR2(13)) s_lvl12,
    CAST(b.lvl12 AS VARCHAR2(13)) lvl12,
    (CASE WHEN b.lvl12 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl12)END) nm_long_12,
    (CASE WHEN b.lvl12 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl12)END) lob_cd_12,
    '' lvl_nb_12,
    '' lvl_nm_12,
    CAST(b.s_lvl13 AS VARCHAR2(13)) s_lvl13,
    CAST(b.lvl13 AS VARCHAR2(13)) lvl13,
    (CASE WHEN b.lvl13 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl13)END) nm_long_13,
    (CASE WHEN b.lvl13 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl13)END) lob_cd_13,
    '' lvl_nb_13,
    '' lvl_nm_13,
    CAST(b.s_lvl14 AS VARCHAR2(13)) s_lvl14,
    CAST(b.lvl14 AS VARCHAR2(13)) lvl14,
    (CASE WHEN b.lvl14 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl14)END) nm_long_14,
    (CASE WHEN b.lvl14 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl14)END) lob_cd_14,
    '' lvl_nb_14,
    '' lvl_nm_14,
    CAST(b.s_lvl15 AS VARCHAR2(13)) s_lvl15,
    CAST(b.lvl15 AS VARCHAR2(13)) lvl15,
    (CASE WHEN b.lvl15 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl15)END) nm_long_15,
    (CASE WHEN b.lvl15 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl15)END) lob_cd_15,
    '' lvl_nb_15,
    '' lvl_nm_15,
    CAST(b.s_lvl16 AS VARCHAR2(13)) s_lvl16,
    CAST(b.lvl16 AS VARCHAR2(13)) lvl16,
    (CASE WHEN b.lvl16 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl16)END) nm_long_16,
    (CASE WHEN b.lvl16 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl16)END) lob_cd_16,
    '' lvl_nb_16,
    '' lvl_nm_16,
    CAST(b.s_lvl17 AS VARCHAR2(13)) s_lvl17,
    CAST(b.lvl17 AS VARCHAR2(13)) lvl17,
    (CASE WHEN b.lvl17 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl17)END) nm_long_17,
    (CASE WHEN b.lvl17 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl17)END) lob_cd_17,
    '' lvl_nb_17,
    '' lvl_nm_17,
    CAST(b.s_lvl18 AS VARCHAR2(13)) s_lvl18,
    CAST(b.lvl18 AS VARCHAR2(13)) lvl18,
    (CASE WHEN b.lvl18 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl8)END) nm_long_18,
    (CASE WHEN b.lvl18 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl18)END) lob_cd_18,
    '' lvl_nb_18,
    '' lvl_nm_18,
    CAST(b.s_lvl19 AS VARCHAR2(13)) s_lvl19,
    CAST(b.lvl19 AS VARCHAR2(13)) lvl19,
    (CASE WHEN b.lvl19 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl19)END) nm_long_19,
    (CASE WHEN b.lvl19 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl19)END) lob_cd_19,
    '' lvl_nb_19,
    '' lvl_nm_19,
    CAST(b.s_lvl20 AS VARCHAR2(13)) s_lvl20,
    CAST(b.lvl20 AS VARCHAR2(13)) lvl20,
    (CASE WHEN b.lvl20 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl20)END) nm_long_20,
    (CASE WHEN b.lvl20 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl20)END) lob_cd_20,
    '' lvl_nb_20,
    '' lvl_nm_20,
    CAST(b.s_lvl21 AS VARCHAR2(13)) s_lvl21,
    CAST(b.lvl21 AS VARCHAR2(13)) lvl21,
    (CASE WHEN b.lvl21 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl21)END) nm_long_21,
    (CASE WHEN b.lvl21 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl21)END) lob_cd_21,
    '' lvl_nb_21,
    '' lvl_nm_21,
    CAST(b.s_lvl22 AS VARCHAR2(13)) s_lvl22,
    CAST(b.lvl22 AS VARCHAR2(13)) lvl22,
    (CASE WHEN b.lvl22 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl22)END) nm_long_22,
    (CASE WHEN b.lvl22 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl22)END) lob_cd_22,
    '' lvl_nb_22,
    '' lvl_nm_22,
    CAST(b.s_lvl23 AS VARCHAR2(13)) s_lvl23,
    CAST(b.lvl23 AS VARCHAR2(13)) lvl23,
    (CASE WHEN b.lvl23 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl23)END) nm_long_23,
    (CASE WHEN b.lvl23 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl23)END) lob_cd_23,
    '' lvl_nb_23,
    '' lvl_nm_23,
    CAST(b.s_lvl24 AS VARCHAR2(13)) s_lvl24,
    CAST(b.lvl24 AS VARCHAR2(13)) lvl24,
    (CASE WHEN b.lvl24 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl24)END) nm_long_24,
    (CASE WHEN b.lvl24 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl24)END) lob_cd_24,
    '' lvl_nb_24,
    '' lvl_nm_24,
    CAST(b.s_lvl25 AS VARCHAR2(13)) s_lvl25,
    CAST(b.lvl25 AS VARCHAR2(13)) lvl25,
    (CASE WHEN b.lvl25 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl25)END) nm_long_25,
    (CASE WHEN b.lvl25 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl25)END) lob_cd_25,
    '' lvl_nb_25,
    '' lvl_nm_25,
    CAST(b.s_lvl26 AS VARCHAR2(13)) s_lvl26,
    CAST(b.lvl26 AS VARCHAR2(13)) lvl26,
    (CASE WHEN b.lvl26 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl26)END) nm_long_26,
    (CASE WHEN b.lvl26 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl26)END) lob_cd_26,
    '' lvl_nb_26,
    '' lvl_nm_26,
    CAST(b.s_lvl27 AS VARCHAR2(13)) s_lvl27,
    CAST(b.lvl27 AS VARCHAR2(13)) lvl27,
    (CASE WHEN b.lvl27 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl27)END) nm_long_27,
    (CASE WHEN b.lvl27 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl27)END) lob_cd_27,
    '' lvl_nb_27,
    '' lvl_nm_27,
    CAST(b.s_lvl28 AS VARCHAR2(13)) s_lvl28,
    CAST(b.lvl28 AS VARCHAR2(13)) lvl28,
    (CASE WHEN b.lvl28 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl28)END) nm_long_28,
    (CASE WHEN b.lvl28 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl28)END) lob_cd_28,
    '' lvl_nb_28,
    '' lvl_nm_28,
    CAST(b.s_lvl29 AS VARCHAR2(13)) s_lvl29,
    CAST(b.lvl29 AS VARCHAR2(13)) lvl29,
    (CASE WHEN b.lvl29 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl29)END) nm_long_29,
    (CASE WHEN b.lvl29 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl29)END) lob_cd_29,
    '' lvl_nb_29,
    '' lvl_nm_29,
    CAST(b.s_lvl30 AS VARCHAR2(13)) s_lvl30,
    CAST(b.lvl30 AS VARCHAR2(13)) lvl30,
    (CASE WHEN b.lvl30 is not null then (select x.nm_long from bu_node x where x.bu_node_id=b.lvl30)END) nm_long_30,
    (CASE WHEN b.lvl30 is not null then (select x.lob_cd from bu_node x where x.bu_node_id=b.lvl30)END) lob_cd_30,
    '' lvl_nb_30,
    '' lvl_nm_30
    FROM parse2 b;
    Thanks & Regards,
    Subbu S

    create or replace view tv as
    with t as
    (select 1 id, to_date('01/02/1994','MM/DD/YYYY') dte
    from dual
    union
    select 2 id, to_date('02/02/2000','MM/DD/YYYY') dte
    from dual
    union
    select 3 id, to_date('01/05/1988','MM/DD/YYYY') dte
    from dual
    union
    select 4 id, to_date('06/05/2006','MM/DD/YYYY') dte
    from dual)
    select * from t where dte > (select dte from t where id = 4);
    -- eliminate the necessity of writing the same query more than once.
    WITH Clause will add readability of code.
    If the scenario is such that you need to write the same query inline multiple times, you can name it using WITH clause and then use it.
    In some cases it improves the performance as well. Some times it creates global temp table for the query specified in WITH clause. It can improve performance drastically, if the query is complex.
    The life time of the temp table is only till that query executes.....

  • Doubt on Maintainence view

    Hi,
    I want to create one maintainence view where in when i go for table contents it should ask for one field name and after entering the field name it should display all related field contents.
    My requirement is that i should get one popup asking field name.Can anyone help me in this regard?
    Thnx in adv
    Regards,
    pavvi.

    Hi,
    You could create a dialog program for the above requirement.
    Thanks
    Nidhi

Maybe you are looking for

  • Firefox will onnly run as "root"

    I have an issue with firefox it will only run if I start it as root. If I use my normal user I get this error: /opt/mozilla/lib/firefox-1.5.0.3/run-mozilla.sh: line 131:  5433 Segmentation fault      "$prog" ${1+"$@"} Any ideas?

  • Tomahawk t:dataScroller in JDeveloper

    I am trying to use Tomahawk dataScroller in JDeveloper, but it looks like I have rendering problem. (Tomahawk 1.1.6, JDeveloper TP3) In the next and previous buttons image tag is not inside of the link tag. Buttons are rendered as following: <!--Star

  • Calling web-dynpro-transaction in BSP problem

    hi, in  my BSP html-coding i have the following:   o nclick="window.open('xxxxx.xxxxxxl:8011/sap/bc/gui/sap/its/webgui~transaction=Z_LSO_WF_UEB{code when i push the button in the portal i get to the transaction Z_LSO..... in sap. this is fine, BUT: s

  • No Drop-Down in One Field of ESS Time Sheet

    Hi All,           We are facing an issue with ESS, Activity type Dropdown values are coming in CAT2 but being not in ESS time sheet. Drop-down for all other values, eg network, receiving cost center etc., are displayed in ESS. Can you please suggest

  • Error trying to export video

    I have premiere pro v4.2 Everytime I try to export video to media encoder I get a error message when it is encoding saying "error compiling movie unknown error" This just started yesterday. If I try to export to Encore using adl it will go thru howev