Error while creating Power View Report via BISM connection.

I am able to create a PowerView Report using Microsoft BI Semantic Model connection without any problem. Everything works from home. But when I try to create Power View report using a BISM connection, I am running into errors. I've verified all permissions
are all set correctly and SQL Browser service is running as well. Please see below error message. Greatly appreciate any pointers.
Detailed error message
Throwing Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: , Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Cannot create a connection to data source 'TemporaryDataSource'. ---> Microsoft.AnalysisServices.AdomdClient.AdomdConnectionException:
A connection cannot be made to redirector. Ensure that 'SQL Browser' service is running. ---> System.Net.Sockets.SocketException: The requested name is valid, but no data of the requested type was found     at System.Net.Sockets.TcpClient..ctor(String
hostname, Int32 port)     at Microsoft.AnalysisServices.AdomdClient.XmlaClient.GetTcpClient(ConnectionInfo connectionInfo)     --- End of inner exception stack trace ---     at Microsoft.AnalysisServices.AdomdClient.XmlaClient.GetTcpClient(ConnectionInfo
connectionInfo)     at Microsoft.AnalysisServices.AdomdClient.XmlaClient.OpenTcpConnection(ConnectionInfo connectionInfo)     at Microsoft.AnalysisServices.AdomdClient.XmlaClient.OpenConnection(ConnectionInfo connectionInfo, Boolean&
isSessionTokenNeeded)     at Microsoft.AnalysisServices.AdomdClient.XmlaClient.Connect(ConnectionInfo connectionInfo, Boolean beginSession)     at Microsoft.AnalysisServices.AdomdClient.XmlaClient.GetInstancePort(ConnectionInfo connectionInfo)
    at Microsoft.AnalysisServices.AdomdClient.XmlaClient.GetTcpClient(ConnectionInfo connectionInfo)     at Microsoft.AnalysisServices.AdomdClient.XmlaClient.OpenTcpConnection(ConnectionInfo connectionInfo)     at Microsoft.AnalysisServices.AdomdClient.XmlaClient.OpenConnection(ConnectionInfo
connectionInfo, Boolean& isSessionTokenNeeded)     at Microsoft.AnalysisServices.AdomdClient.XmlaClient.Connect(ConnectionInfo connectionInfo, Boolean beginSession)     at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.XmlaClientProvider.Connect(Boolean
toIXMLA)     at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.ConnectToXMLA(Boolean createSession, Boolean isHTTP)     at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.Open()     at Microsoft.ReportingServices.DataExtensions.AdoMdConnectionBase.InternalOpen()
    at Microsoft.ReportingServices.Diagnostics.DataExtensionConnectionBase.OpenConnection(IProcessingDataSource dataSourceObj, DataSourceInfo dataSourceInfo, IDbConnection conn)     --- End of inner exception stack trace ---;

So , have you actually came to a conclusion about the problem. I have a similar one in my environment.
<detail><ErrorCode xmlns="http://www.microsoft.com/sql/reportingservices">rsCannotRetrieveModel</ErrorCode><HttpStatus
xmlns="http://www.microsoft.com/sql/reportingservices">400</HttpStatus><Message xmlns="http://www.microsoft.com/sql/reportingservices">Erro
ao carregar o modelo para o item ou a fonte de dados 'http://gasmignethml/BICenter/Galeria%20PowerPivot/BIGASMIG.bism'. Verifique se as informações de conexão estão corretas e se você tem permissões para acessar a fonte de dados.</Message><HelpLink
xmlns="http://www.microsoft.com/sql/reportingservices">http://go.microsoft.com/fwlink/?LinkId=20476&amp;EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&amp;EvtID=rsCannotRetrieveModel&amp;ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&amp;ProdVer=11.0.5058.0</HelpLink><ProductName
xmlns="http://www.microsoft.com/sql/reportingservices">Microsoft SQL Server Reporting Services</ProductName><ProductVersion xmlns="http://www.microsoft.com/sql/reportingservices">11.0.5058.0</ProductVersion><ProductLocaleId
xmlns="http://www.microsoft.com/sql/reportingservices">127</ProductLocaleId><OperatingSystem xmlns="http://www.microsoft.com/sql/reportingservices">OsIndependent</OperatingSystem><CountryLocaleId
xmlns="http://www.microsoft.com/sql/reportingservices">1033</CountryLocaleId><MoreInformation xmlns="http://www.microsoft.com/sql/reportingservices"><Source>ReportingServicesLibrary</Source><Message
msrs:ErrorCode="rsCannotRetrieveModel" msrs:HelpLink="http://go.microsoft.com/fwlink/?LinkId=20476&amp;EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&amp;EvtID=rsCannotRetrieveModel&amp;ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&amp;ProdVer=11.0.5058.0"
xmlns:msrs="http://www.microsoft.com/sql/reportingservices">Erro ao carregar o modelo para o item ou a fonte de dados 'http://gasmignethml/BICenter/Galeria%20PowerPivot/BIGASMIG.bism'.
Verifique se as informações de conexão estão corretas e se você tem permissões para acessar a fonte de dados.</Message><MoreInformation><Source>Microsoft.ReportingServices.ProcessingCore</Source><Message msrs:ErrorCode="rsErrorOpeningConnection"
msrs:HelpLink="http://go.microsoft.com/fwlink/?LinkId=20476&amp;EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&amp;EvtID=rsErrorOpeningConnection&amp;ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&amp;ProdVer=11.0.5058.0"
xmlns:msrs="http://www.microsoft.com/sql/reportingservices">Não é possível criar uma conexão com a fonte de dados 'TemporaryDataSource'.</Message><MoreInformation><Source>Microsoft.AnalysisServices.AdomdClient</Source><Message>A
connection cannot be made to redirector. Ensure that 'SQL Browser' service is running.</Message><MoreInformation><Source>System</Source><Message>The
requested name is valid, but no data of the requested type was found</Message></MoreInformation></MoreInformation></MoreInformation></MoreInformation><Warnings xmlns="http://www.microsoft.com/sql/reportingservices"
/></detail>
Any help will be very welcome.
Thanks in advance
abcoura | osmanos.org

Similar Messages

  • Cannot create Power View reports with HelloWorldPicnicPowerViewRTM.xlsx

    I have uploaded HelloWorldPicnicPowerViewRTM.xlsx to Power Pivot Gallery on SharePoint 2013 and SQL Server 2012.
    I have clicked Create Power View Reports, but there is error with connection.
    I'm trying to follow instructions on
    http://technet.microsoft.com/en-us/library/hh759325.aspx
    <detail><ErrorCode xmlns="rsCannotRetrieveModel</ErrorCode><HttpStatus">http://www.microsoft.com/sql/reportingservices">rsCannotRetrieveModel</ErrorCode><HttpStatus
    xmlns="400</HttpStatus><Message">http://www.microsoft.com/sql/reportingservices">400</HttpStatus><Message xmlns="An">http://www.microsoft.com/sql/reportingservices">An
    error occurred while loading the model for the item or data source 'http://servername/sites/bi/powerview/PowerPivotGallery/HelloWorldPicnicPowerViewRTM.xlsx'. Verify that the connection information is correct and that you have permissions to access the data
    source.</Message><HelpLink xmlns="http://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&EvtID=rsCannotRetrieveModel&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=11.0.3128.0</HelpLink><ProductName">http://www.microsoft.com/sql/reportingservices">http://go.microsoft.com/fwlink/?LinkId=20476&amp;EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&amp;EvtID=rsCannotRetrieveModel&amp;ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&amp;ProdVer=11.0.3128.0</HelpLink><ProductName
    xmlns="Microsoft">http://www.microsoft.com/sql/reportingservices">Microsoft SQL Server Reporting Services</ProductName><ProductVersion xmlns="11.0.3128.0</ProductVersion><ProductLocaleId">http://www.microsoft.com/sql/reportingservices">11.0.3128.0</ProductVersion><ProductLocaleId
    xmlns="127</ProductLocaleId><OperatingSystem">http://www.microsoft.com/sql/reportingservices">127</ProductLocaleId><OperatingSystem xmlns="OsIndependent</OperatingSystem><CountryLocaleId">http://www.microsoft.com/sql/reportingservices">OsIndependent</OperatingSystem><CountryLocaleId
    xmlns="1033</CountryLocaleId><MoreInformation">http://www.microsoft.com/sql/reportingservices">1033</CountryLocaleId><MoreInformation xmlns="<Source>ReportingServicesLibrary</Source><Message">http://www.microsoft.com/sql/reportingservices"><Source>ReportingServicesLibrary</Source><Message
    msrs:ErrorCode="rsCannotRetrieveModel" msrs:HelpLink="http://go.microsoft.com/fwlink/?LinkId=20476&amp;EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&amp;EvtID=rsCannotRetrieveModel&amp;ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&amp;ProdVer=11.0.3128.0"
    xmlns:msrs="An">http://www.microsoft.com/sql/reportingservices">An error occurred while loading the model for the item or data source 'http://servername/sites/bi/powerview/PowerPivotGallery/HelloWorldPicnicPowerViewRTM.xlsx'.
    Verify that the connection information is correct and that you have permissions to access the data source.</Message><MoreInformation><Source>Microsoft.ReportingServices.ProcessingCore</Source><Message msrs:ErrorCode="rsErrorOpeningConnection"
    msrs:HelpLink="http://go.microsoft.com/fwlink/?LinkId=20476&amp;EvtSrc=Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings&amp;EvtID=rsErrorOpeningConnection&amp;ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&amp;ProdVer=11.0.3128.0"
    xmlns:msrs="Cannot">http://www.microsoft.com/sql/reportingservices">Cannot create a connection to data source 'TemporaryDataSource'.</Message><MoreInformation><Source>Microsoft.AnalysisServices.SPClient</Source><Message>We
    cannot locate a server to load the workbook Data Model.</Message><MoreInformation><Source></Source><Message>We cannot locate a server to load the workbook Data Model.</Message><MoreInformation><Source>Microsoft.Office.Excel.Server.WebServices</Source><Message>We
    cannot locate a server to load the workbook Data Model.</Message></MoreInformation></MoreInformation></MoreInformation></MoreInformation></MoreInformation><Warnings xmlns="http://www.microsoft.com/sql/reportingservices"
    /></detail>
    Kenny_I

    Hi Kenny_I,
    Based on the error message, the issue may be caused by the incorrect configuration of Claims to Windows Token Service (C2WTS). The C2WTS is required because the communication between the web front-end (WFE) and the Reporting Services shared service will
    always be Claims authentication.
    The domain account used by the Claims to Windows Token Service needs to be granted the following rights through the Local Security Policy:
    Act as part of the operating system
    Impersonate a client after authentication
    Log on as a service
    We can find these settings under Administrative Tools > Local Security Policy > Local Policies > User Rights Assignment. And we should add the service account to the local Administrators Groups ahead.
    For more information, please see the following links:
    http://www.codeovereasy.com/2014/01/powerview-report-fails-no-credentials-are-available-in-the-security-package/
    http://msdn.microsoft.com/en-us/library/hh231678.aspx
    Hope this helps.
    Thanks,
    Katherine xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • APEX_040100.WWV_FLOW_API Error while creating a Interactive Report Region

    I am getting the following error while creating an Interactive report region on a page. (version - 4.1.0.00.32)
    Error Unable to create Dynamic Query page.
    ORA-04065: not executed, altered or dropped ORA-04065: not executed, altered or dropped stored procedure "APEX_040100.WWV_FLOW_API" ORA-06508: PL/SQL: could not find program unit being called: "APEX_040100.WWV_FLOW_API"
    DBA complied package but the error persists.
    Does anyone know how to debug this
    Thanks,
    Priyanka

    Hello ???,
    We are experiencing this too at login in an application. The error is caused by violating the constraint WWV_FLOW_DATA_IDX1 on columns FLOW_INSTANCE, ITEM_ID in table WWV_FLOW_DATA. So for some reason the value of an item in session state is set multiple times.
    When looking at the Access view (statement below) I see that there are multiple logins per second for a user (I have seen 12 times as maximum).
    select login_name, application, access_date, count(*)
    from WWV_FLOW_USER_ACCESS_LOG_V
    group by login_name, application, access_date
    having count(*) > 1
    order by access_date descSince this count of logins varies from 1 to 12, it looks like it is not caused by the application itself, but I also don't have a clue what the root cause is.
    Is there anyone else with more information on this issue?
    We are on APEX 4.0 and Oracle 11g and the applications have all been built in this environment, so no upgrades have been performed.
    Regards, Wouter
    Edited by: Wouter Breeuwsma on 31-mei-2012 12:05

  • Error while creating parameterise view

    I m getting below error while creating parameterise view
    CREATE OR REPLACE VIEW rdr_le_info_view (v_run_number , v_isin_cob )
    AS
    SELECT l.strategic_le
    ,cun.ucn cunucn
    ,cun.date
    ,cccs.ucn ucn
    ,cccs.agr_num
    FROM strat_le l
    ,ucn_name cun
    ,customer_setup cccs
    WHERE l.gfa_until_dt = '31-dec-9999'
    AND l.glas_until_dt = '31-dec-9999'
    AND l.int_until_dt = '31-dec-9999'
    AND cccs.run_num = v_run_num
    AND cccs.ucn_lead_office = cun.ucn
    AND cun.OID = l.client_oid;
    AND cccs.run_num = v_run_num
    ERROR at line 13:
    ORA-00904: "V_RUN_NUM": invalid identifier
    Plese help me in above.

    Try
    CREATE OR REPLACE VIEW rdr_le_info_view
    AS
    SELECT l.strategic_le
    ,cun.ucn cunucn
    ,cun.date
    ,cccs.ucn ucn
    ,cccs.agr_num
    FROM strat_le l
    ,ucn_name cun
    ,customer_setup cccs
    ,cccs.run_num run_num
    WHERE l.gfa_until_dt = '31-dec-9999'
    AND l.glas_until_dt = '31-dec-9999'
    AND l.int_until_dt = '31-dec-9999'
    AND cccs.ucn_lead_office = cun.ucn
    AND cun.OID = l.client_oid;Then call it like:
    select *
    from rdr_le_info_view
    where run_num = v_run_num;

  • How to Create Power View Report using power pivot file in SharePoint 2013

    H,
    I have power pivot and Power View excel files. Now i want to create the Power View report in SharePoint 2013.
    What steps should i use?
    Can anyone help me on it.
    I need detailed step by step procedure.
    Thanks & Regards
    Poomani Sankaran

    Hi Aditya,
    Thanks for your reply.
    I am using Enterprise edition of SharePoint 2013 only. SQL Server 2012 SP1.
    I have configured Reporing Services also successfully. I got "Reporting" folder in "15" hive location "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\WebServices"
    SSRS Service application also i have created success in CA Manage Service Application.
    I have done "Reporting Services Add-in for SharePoint" also which is "rsSharePoint.msi".
    What should i do apart from this? Can you tell me. Its frustrating like anything. 
    I have added the "PowerPivot" excel in "PowerPivot Gallery" and clicked the icon "Create Power View Report"
    Thanks in Advance.
    Poomani Sankaran

  • Error while creating a view

    Hi All,
    I am getting the below errors while creating view.
    ORA-03135:connection lost contact
    ORA-03134:not connected to ORACLE
    Please suggest. Thanks
    AJR

    check this link... even this can also be a reason
    Ravi Kumar

  • Error While Creating Materialized View

    Hello,
    I am getting error ORA-22818: subquery expressions not allowed here while creating materialized view. I am using Oracle9i Enterprise Edition Release 9.2.0.1.0. Below pasted is my SQL Script.
    Any help is highly appreciable.
    Thanks
    *********SQL************
    select distinct(id),NAME,(select count(GRADE) from employees where
    nationality like '%US%'and id=a.organization_id and grade=a.grade
    group by ID,GRADE) US,(select count(GRADE) from employees where
    nationality not like '%US%' and organization_id=a.organization_id and grade=a.grade
    group by ORGANIZATION_ID,GRADE) NON_US,grade from employees a
    where grade is not null
    group by GRADE,ID,name
    order by to_number(grade) desc

    Hi,
    This is a documented restriction on MVs. You cannot have a scalar express (i.e a select statement) in the select list.
    You can get round this by joining your select count(grade).. expression in as an inline view in your FROM clause. Or you can create a normal view without the scalar expression, create your MV as a select from this view, then re-define your view to contain the query you want.
    Hope that helps,
    Rod West

  • Error while creating Materialized View step 3 of 6 using wizard

    have oracle 9i Rel 1 on Windows 2000 server. Master Site has been setup. Database links are created at Materialized view site. But while creating Materialized View Group using wizard there is following error on step 3 of 6.
    Statement:----------------
    /*OracleOEM*/ SELECT 1 FROM SYS.dba_constraints@masterdbname WHERE OWNER='username' and table_name='tabname' AND constraint_type='P'
    Stack Trace:----------------
    ORA-00942: table or view does not exist.
    ORA-02063: preceding line from masterdbname.
    All parameters for replication are correct.
    Please help me early.
    Thanks

    Hello,
    In the masterdbname, logging as sys user, you must grant select permission on sys.dba_constraints view to mvadmin_dbname user (where dbname is the replicated database name).
    Regards,

  • Error while creating Materialized View step 3 of 6

    I have oracle 9i Rel 1 on Windows 2000 server. Master Site has been setup. Database links are created at Materialized view site. But while creating Materialized View Group there is following error on step 3 of 6.
    Statement:----------------
    /*OracleOEM*/ SELECT 1 FROM SYS.dba_constraints@masterdbname WHERE OWNER='username' and table_name='tabname' AND constraint_type='P'
    Stack Trace:----------------
    ORA-00942: table or view does not exist.
    ORA-02063: preceding line from masterdbname.
    All parameters for replication are correct.
    Please help me early.
    Thanks

    Hello,
    In the masterdbname, logging as sys user, you must grant select permission on sys.dba_constraints view to mvadmin_dbname user (where dbname is the replicated database name).
    Regards,

  • Error while creating document numbering series via SDK add on

    Dear Experts,
    We receive the following error while creating the document numbering series through the SDK add on
    [Microsoft][SQL Server Native Client 10.0][SQL Server]The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Too many parameters were provided in this RPC request. The maximum is 2100.
    From the above error message I can suspect the following possibilities
    1. The limit for the document numbering must be less or equal to 2100.
    2. There is a problem in the coding in SDK where it does not allow more than 2100 lines in the database.
    We tried to create manually for the same fiscal year and period indicator disconnecting the add on, the same error occured.
    Then we created a seried for a single document with the period indicator for the next fiscal year, it allowed.
    After creating the document numbering for the next fiscal year, we were able to create the numbering for the previous year also.
    Kindly help us on how to solve the same.
    With regards,
    Yeshwanth Prakash

    Hi
    You have, as far as i can determine without seeing the template,defined no Part Appraiser Column (PAPP) in your template. But you have defined a function on the template to automaticly default the part appraisers.
    On the Appraisal document persons (appraiser / appraisee) are getting defaulted as part-appraisers although no part appraisal column excist,and therefor 00 Part Appraisers are allowed. This gives the error. Remove the Part Appraisers default functionality from the template and this problem will be solved.
    FYI: The reason why this doesn't give a business check error is that the functions to default participants are BAdI's and we have no means of determining wether or not a BAdI implentation will create an inconsistency on the appraisal document.
    Also, the reason that it occurs as a S message and not as E or W is because of programming restrictions in combination with messages. All errors on the Appraisal Document will come as 'S' messages.

  • Error while creating a new report data source in Sharepoint Document library

    I installed SSRS(sql server 2012 SP1) in my sharepoint 2013 farm(single server installation).
    I have installed SSRS addin for report also. 
    I created a document library and included the report data source content type, report builder report and report builder model content types. On click of any of these content types i get the below error. 
    "new Document requires a Microsoft SharePoint Foundation-compatible application and web browser. To add document to document library, click on the 'Upload' button."
    I am using windows 7 64-bit operation system with Google chrome and IE 8 64 bit.
    Any help would be appreciated. 

    Rakesh, is this an SSRS question?
    This doesn't look like Power View.
    Thanks!
    Ed Price, Azure & Power BI Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

  • Getting error while creating form and report on webservice: ORA-20001: Unable to create form on table. ORA-02263: need to specify the datatype for this column.

    i am using the following description to create a web service reference:
    web reference :REST
    Name :Yahoo Map
    URL :http://local.yahooapis.com/MapsService/V1/mapImage
    HTTP Method: GET
    Basic Authentication: No
    Add Parameter:
    Name       Type
    appid        String
    location    String
    Output Format: XML
    XPath to Output Parameters : /Result
    Output Parameter:
    Name       Path       Type
    Url          /text()      String
    Then i tried to create form and report on webservice:
    Web Service Reference Type: Yahoo Map
    Operation: doREST
    All the fields i keep as default
    I tick the checkbox (url)in report Parameter
    After clicking next whereever required i click create button
    I get the following error
    ORA-20001: Unable to create form on table. ORA-02263: need to specify the datatype for this column.
    Please someone help to solve this as i need to fix it urgently.

    i exported the application from apex.oracle.com and imported it to our environment
    import went fine, but when I ran the IR page I got
    ORA-20001: get_dbms_sql_cursor error ORA-00904: : invalid identifier
    evidently the problem is a lack of public execute on DBMS_LOB, which is used in the generated IR source.
    while waiting for the DBA to grant privs on DBMS_LOB, changing the dbms_lob.getlength call to length() fixes the IR.
    however, i am not getting the download link on the associated form page... changed templates, that's not the issue -- we'll see if that's a dbms_lob issue as well

  • Error: while creating a view - Help needed

    When i am trying to create the view i am getting the error msg as:
    ==>ORA-02070: database does not support operator NLS_CHARSET_DECL_LEN in this context<==
    Please advise in this regard to overcome this issue.
    the view is nothing but
    ================
    create or replace view f_test as
    WITH metadata1 as
    (SELECT DISTINCT * FROM
    (SELECT fre_id, bu_id, eff_from_dt, rec_eff_from_dt,
    rec_eff_to_dt, rec_type, eff_to_dt,
    active_flg, nm_long, nm_short,
    rplcmnt_bu_id, pc_cc_cd, tax_cd, bu_type_cd,
    ledger_cd, internal_id, create_dt,
    last_upd_dt, last_upd_id,
    DENSE_RANK () OVER (PARTITION BY fre_id, bu_id, eff_from_dt
    ORDER BY fre_id, bu_id, eff_from_dt, rec_eff_from_dt) RANK
    FROM AUD_TEST)
    aud1 AS
    (SELECT column_name,
    DECODE (column_id,
    7, TO_CHAR (eff_to_dt, 'MMDDRRRR'),
    8, active_flg,
    9, nm_long,
    10, nm_short,
    11, rplcmnt_bu_id,
    12, pc_cc_cd,
    13, tax_cd,
    14, bu_type_cd,
    15, ledger_cd) col_val_new,
    '' col_val_old, fre_id, bu_id, eff_from_dt, rec_eff_from_dt, rec_type, rank
    FROM metadata1, all_tab_columns u
    WHERE table_name = 'AUD_TEST'
    AND column_name IN
    ('EFF_TO_DT',
    'ACTIVE_FLG',
    'NM_LONG',
    'NM_SHORT',
    'RPLCMNT_BU_ID',
    'PC_CC_CD',
    'TAX_CD',
    'BU_TYPE_CD',
    'LEDGER_CD'
    AND rank = '1')      ,
    aud2 AS
    (SELECT column_name,
    DECODE (column_id,
    7, TO_CHAR (eff_to_dt, 'MMDDRRRR'),
    8, active_flg,
    9, nm_long,
    10, nm_short,
    11, rplcmnt_bu_id,
    12, pc_cc_cd,
    13, tax_cd,
    14, bu_type_cd,
    15, ledger_cd) col_val_new,
    '' col_val_old, fre_id, bu_id, eff_from_dt, rec_eff_from_dt, rec_type, rank
    FROM metadata1 m, all_tab_columns u
    WHERE table_name = 'AUD_TEST'
    AND column_name IN
    ('EFF_TO_DT',
    'ACTIVE_FLG',
    'NM_LONG',
    'NM_SHORT',
    'RPLCMNT_BU_ID',
    'PC_CC_CD',
    'TAX_CD',
    'BU_TYPE_CD',
    'LEDGER_CD')
    AND rank = '2'),
    aud3 AS
    (SELECT column_name,
    DECODE (column_id,
    7, TO_CHAR (eff_to_dt, 'MMDDRRRR'),
    8, active_flg,
    9, nm_long,
    10, nm_short,
    11, rplcmnt_bu_id,
    12, pc_cc_cd,
    13, tax_cd,
    14, bu_type_cd,
    15, ledger_cd) col_val_new,
    '' col_val_old, fre_id, bu_id, eff_from_dt, rec_eff_from_dt, rec_type, rank
    FROM metadata1 m, all_tab_columns u
    WHERE table_name = 'AUD_TEST'
    AND column_name IN
    ('EFF_TO_DT',
    'ACTIVE_FLG',
    'NM_LONG',
    'NM_SHORT',
    'RPLCMNT_BU_ID',
    'PC_CC_CD',
    'TAX_CD',
    'BU_TYPE_CD',
    'LEDGER_CD')
    AND rank = '3'),
    aud4 AS
    (SELECT column_name,
    DECODE (column_id,
    7, TO_CHAR (eff_to_dt, 'MMDDRRRR'),
    8, active_flg,
    9, nm_long,
    10, nm_short,
    11, rplcmnt_bu_id,
    12, pc_cc_cd,
    13, tax_cd,
    14, bu_type_cd,
    15, ledger_cd) col_val_new,
    '' col_val_old, fre_id, bu_id, eff_from_dt, rec_eff_from_dt, rec_type, rank
    FROM metadata1 m, all_tab_columns u
    WHERE table_name = 'AUD_TEST'
    AND column_name IN
    ('EFF_TO_DT',
    'ACTIVE_FLG',
    'NM_LONG',
    'NM_SHORT',
    'RPLCMNT_BU_ID',
    'PC_CC_CD',
    'TAX_CD',
    'BU_TYPE_CD',
    'LEDGER_CD')
    AND rank = '4'),
    aud5 AS
    (SELECT column_name,
    DECODE (column_id,
    7, TO_CHAR (eff_to_dt, 'MMDDRRRR'),
    8, active_flg,
    9, nm_long,
    10, nm_short,
    11, rplcmnt_bu_id,
    12, pc_cc_cd,
    13, tax_cd,
    14, bu_type_cd,
    15, ledger_cd) col_val_new,
    '' col_val_old, fre_id, bu_id, eff_from_dt, rec_eff_from_dt, rec_type, rank
    FROM metadata1 m, all_tab_columns u
    WHERE table_name = 'AUD_TEST'
    AND column_name IN
    ('EFF_TO_DT',
    'ACTIVE_FLG',
    'NM_LONG',
    'NM_SHORT',
    'RPLCMNT_BU_ID',
    'PC_CC_CD',
    'TAX_CD',
    'BU_TYPE_CD',
    'LEDGER_CD')
    AND rank = '5'),
    aud6 AS
    (SELECT column_name,
    DECODE (column_id,
    7, TO_CHAR (eff_to_dt, 'MMDDRRRR'),
    8, active_flg,
    9, nm_long,
    10, nm_short,
    11, rplcmnt_bu_id,
    12, pc_cc_cd,
    13, tax_cd,
    14, bu_type_cd,
    15, ledger_cd) col_val_new,
    '' col_val_old, fre_id, bu_id, eff_from_dt, rec_eff_from_dt, rec_type, rank
    FROM metadata1 m, all_tab_columns u
    WHERE table_name = 'AUD_TEST'
    AND column_name IN
    ('EFF_TO_DT',
    'ACTIVE_FLG',
    'NM_LONG',
    'NM_SHORT',
    'RPLCMNT_BU_ID',
    'PC_CC_CD',
    'TAX_CD',
    'BU_TYPE_CD',
    'LEDGER_CD')
    AND rank = '6'),
    aud7 AS
    (SELECT column_name,
    DECODE (column_id,
    7, TO_CHAR (eff_to_dt, 'MMDDRRRR'),
    8, active_flg,
    9, nm_long,
    10, nm_short,
    11, rplcmnt_bu_id,
    12, pc_cc_cd,
    13, tax_cd,
    14, bu_type_cd,
    15, ledger_cd) col_val_new,
    '' col_val_old, fre_id, bu_id, eff_from_dt, rec_eff_from_dt, rec_type, rank
    FROM metadata1 m, all_tab_columns u
    WHERE table_name = 'AUD_TEST'
    AND column_name IN
    ('EFF_TO_DT',
    'ACTIVE_FLG',
    'NM_LONG',
    'NM_SHORT',
    'RPLCMNT_BU_ID',
    'PC_CC_CD',
    'TAX_CD',
    'BU_TYPE_CD',
    'LEDGER_CD')
    AND rank = '7'),
    aud8 AS
    (SELECT column_name,
    DECODE (column_id,
    7, TO_CHAR (eff_to_dt, 'MMDDRRRR'),
    8, active_flg,
    9, nm_long,
    10, nm_short,
    11, rplcmnt_bu_id,
    12, pc_cc_cd,
    13, tax_cd,
    14, bu_type_cd,
    15, ledger_cd) col_val_new,
    '' col_val_old, fre_id, bu_id, eff_from_dt, rec_eff_from_dt, rec_type, rank
    FROM metadata1 m, all_tab_columns u
    WHERE table_name = 'AUD_TEST'
    AND column_name IN
    ('EFF_TO_DT',
    'ACTIVE_FLG',
    'NM_LONG',
    'NM_SHORT',
    'RPLCMNT_BU_ID',
    'PC_CC_CD',
    'TAX_CD',
    'BU_TYPE_CD',
    'LEDGER_CD')
    AND rank = '8'),
    aud9 AS
    (SELECT column_name,
    DECODE (column_id,
    7, TO_CHAR (eff_to_dt, 'MMDDRRRR'),
    8, active_flg,
    9, nm_long,
    10, nm_short,
    11, rplcmnt_bu_id,
    12, pc_cc_cd,
    13, tax_cd,
    14, bu_type_cd,
    15, ledger_cd) col_val_new,
    '' col_val_old, fre_id, bu_id, eff_from_dt, rec_eff_from_dt, rec_type, rank
    FROM metadata1 m, all_tab_columns u
    WHERE table_name = 'AUD_TEST'
    AND column_name IN
    ('EFF_TO_DT',
    'ACTIVE_FLG',
    'NM_LONG',
    'NM_SHORT',
    'RPLCMNT_BU_ID',
    'PC_CC_CD',
    'TAX_CD',
    'BU_TYPE_CD',
    'LEDGER_CD')
    AND rank = '9'),
    aud10 AS
    (SELECT column_name,
    DECODE (column_id,
    7, TO_CHAR (eff_to_dt, 'MMDDRRRR'),
    8, active_flg,
    9, nm_long,
    10, nm_short,
    11, rplcmnt_bu_id,
    12, pc_cc_cd,
    13, tax_cd,
    14, bu_type_cd,
    15, ledger_cd) col_val_new,
    '' col_val_old, fre_id, bu_id, eff_from_dt, rec_eff_from_dt, rec_type, rank
    FROM metadata1 m, all_tab_columns u
    WHERE table_name = 'AUD_TEST'
    AND column_name IN
    ('EFF_TO_DT',
    'ACTIVE_FLG',
    'NM_LONG',
    'NM_SHORT',
    'RPLCMNT_BU_ID',
    'PC_CC_CD',
    'TAX_CD',
    'BU_TYPE_CD',
    'LEDGER_CD')
    AND rank = '10'),
    metadata2 as
    (select aud1.column_name,
    aud1.col_val_new,
    '' col_val_old,
    aud1.fre_id,
    aud1.bu_id,
    aud1.eff_from_dt,
    aud1.rec_eff_from_dt,
    aud1.rec_type,
    aud1.rank
    from aud1
    union all
    select aud2.column_name, DECODE(aud2.rec_type,'D','',aud2.col_val_new) col_val_new, aud1.col_val_new col_val_old, aud2.fre_id, aud2.bu_id,
    aud2.eff_from_dt, aud2.rec_eff_from_dt, aud2.rec_type, aud2.rank
    from aud1, aud2
    where (aud1.fre_id = aud2.fre_id and aud1.bu_id = aud2.bu_id and aud1.eff_from_dt = aud2.eff_from_dt
    and aud1.column_name = aud2.column_name
    and ( (aud2.rec_type = 'C' and nvl(aud1.col_val_new,'^') <> nvl(aud2.col_val_new,'~') ) or
    (aud2.rec_type <> 'C' or (nvl(aud1.col_val_new,'^') <> nvl(aud2.col_val_new,'~'))))
    union all
    select aud3.column_name, DECODE(aud3.rec_type,'D','',aud3.col_val_new) col_val_new, aud2.col_val_new col_val_old, aud3.fre_id, aud3.bu_id,
    aud3.eff_from_dt, aud3.rec_eff_from_dt, aud3.rec_type, aud3.rank
    from aud2, aud3
    where (aud2.fre_id = aud3.fre_id and aud2.bu_id = aud3.bu_id and aud2.eff_from_dt = aud3.eff_from_dt
    and aud2.column_name = aud3.column_name
    and ( (aud3.rec_type = 'C' and nvl(aud2.col_val_new,'^') <> nvl(aud3.col_val_new,'~') ) or
    (aud3.rec_type <> 'C' or (nvl(aud2.col_val_new,'^') <> nvl(aud3.col_val_new,'~'))))
    union all
    select aud4.column_name, DECODE(aud4.rec_type,'D','',aud4.col_val_new) col_val_new, aud3.col_val_new col_val_old, aud4.fre_id, aud4.bu_id,
    aud4.eff_from_dt, aud4.rec_eff_from_dt, aud4.rec_type, aud4.rank
    from aud3, aud4
    where (aud3.fre_id = aud4.fre_id and aud3.bu_id = aud4.bu_id and aud3.eff_from_dt = aud4.eff_from_dt
    and aud3.column_name = aud4.column_name
    and ( (aud4.rec_type = 'C' and nvl(aud3.col_val_new,'^') <> nvl(aud4.col_val_new,'~') ) or
    (aud4.rec_type <> 'C' or (nvl(aud3.col_val_new,'^') <> nvl(aud4.col_val_new,'~'))))
    union all
    select aud5.column_name, DECODE(aud5.rec_type,'D','',aud5.col_val_new) col_val_new, aud4.col_val_new col_val_old, aud5.fre_id, aud5.bu_id,
    aud5.eff_from_dt, aud5.rec_eff_from_dt, aud5.rec_type, aud5.rank
    from aud4, aud5
    where (aud4.fre_id = aud5.fre_id and aud4.bu_id = aud5.bu_id and aud4.eff_from_dt = aud5.eff_from_dt
    and aud4.column_name = aud5.column_name
    and ( (aud5.rec_type = 'C' and nvl(aud4.col_val_new,'^') <> nvl(aud5.col_val_new,'~') ) or
    (aud5.rec_type <> 'C' or (nvl(aud4.col_val_new,'^') <> nvl(aud5.col_val_new,'~'))))
    union all
    select aud6.column_name, DECODE(aud6.rec_type,'D','',aud6.col_val_new) col_val_new, aud5.col_val_new col_val_old, aud6.fre_id, aud6.bu_id,
    aud6.eff_from_dt, aud6.rec_eff_from_dt, aud6.rec_type, aud6.rank
    from aud5, aud6
    where (aud5.fre_id = aud6.fre_id and aud5.bu_id = aud6.bu_id and aud5.eff_from_dt = aud6.eff_from_dt
    and aud5.column_name = aud6.column_name
    and ( (aud6.rec_type = 'C' and nvl(aud5.col_val_new,'^') <> nvl(aud6.col_val_new,'~') ) or
    (aud6.rec_type <> 'C' or (nvl(aud5.col_val_new,'^') <> nvl(aud6.col_val_new,'~'))))
    union all
    select aud7.column_name, DECODE(aud7.rec_type,'D','',aud7.col_val_new) col_val_new, aud6.col_val_new col_val_old, aud7.fre_id, aud7.bu_id,
    aud7.eff_from_dt, aud7.rec_eff_from_dt, aud7.rec_type, aud7.rank
    from aud6, aud7
    where (aud6.fre_id = aud7.fre_id and aud6.bu_id = aud7.bu_id and aud6.eff_from_dt = aud7.eff_from_dt
    and aud6.column_name = aud7.column_name
    and ( (aud7.rec_type = 'C' and nvl(aud6.col_val_new,'^') <> nvl(aud7.col_val_new,'~') ) or
    (aud7.rec_type <> 'C' or (nvl(aud6.col_val_new,'^') <> nvl(aud7.col_val_new,'~'))))
    union all
    select aud8.column_name, DECODE(aud8.rec_type,'D','',aud8.col_val_new) col_val_new, aud7.col_val_new col_val_old, aud8.fre_id, aud8.bu_id,
    aud8.eff_from_dt, aud8.rec_eff_from_dt, aud8.rec_type, aud8.rank
    from aud7, aud8
    where (aud7.fre_id = aud8.fre_id and aud7.bu_id = aud8.bu_id and aud7.eff_from_dt = aud8.eff_from_dt
    and aud7.column_name = aud8.column_name
    and ( (aud8.rec_type = 'C' and nvl(aud7.col_val_new,'^') <> nvl(aud8.col_val_new,'~') ) or
    (aud8.rec_type <>'C' or (nvl(aud7.col_val_new,'^') <> nvl(aud8.col_val_new,'~'))))
    union all
    select aud9.column_name, DECODE(aud9.rec_type,'D','',aud9.col_val_new) col_val_new, aud8.col_val_new col_val_old, aud9.fre_id, aud9.bu_id,
    aud9.eff_from_dt, aud9.rec_eff_from_dt, aud9.rec_type, aud9.rank
    from aud8, aud9
    where (aud8.fre_id = aud9.fre_id and aud8.bu_id = aud9.bu_id and aud8.eff_from_dt = aud9.eff_from_dt
    and aud8.column_name = aud9.column_name
    and ( (aud9.rec_type = 'C' and nvl(aud8.col_val_new,'^') <> nvl(aud9.col_val_new,'~') ) or
    (aud9.rec_type <> 'C' or (nvl(aud8.col_val_new,'^') <> nvl(aud9.col_val_new,'~'))))
    union all
    select aud10.column_name, DECODE(aud10.rec_type,'D','',aud10.col_val_new) col_val_new, aud9.col_val_new col_val_old, aud10.fre_id, aud10.bu_id,
    aud10.eff_from_dt, aud10.rec_eff_from_dt, aud10.rec_type, aud10.rank
    from aud9, aud10
    where (aud9.fre_id = aud10.fre_id and aud9.bu_id = aud10.bu_id and aud9.eff_from_dt = aud10.eff_from_dt
    and aud9.column_name = aud10.column_name
    and ((aud10.rec_type = 'C' and nvl(aud9.col_val_new,'^') <> nvl(aud10.col_val_new,'~') )
    or (aud10.rec_type <> 'C' or (nvl(aud9.col_val_new,'^') <> nvl(aud10.col_val_new,'~'))))
    select * from metadata2
    where (rec_type = 'C' and (col_val_new is not null or col_val_old is not null))
    or (rec_type <> 'C');

    create or replace view frd_bu_test as
    WITH metadata1 as
    (SELECT DISTINCT * FROM
    (SELECT fre_id, bu_id, eff_from_dt, rec_eff_from_dt,
    rec_eff_to_dt, rec_type, eff_to_dt,
    active_flg, nm_long, nm_short,
    rplcmnt_bu_id, pc_cc_cd, tax_cd, bu_type_cd,
    ledger_cd, internal_id, create_dt,
    last_upd_dt, last_upd_id,
    DENSE_RANK () OVER (PARTITION BY fre_id, bu_id, eff_from_dt
    ORDER BY fre_id, bu_id, eff_from_dt, rec_eff_from_dt) RANK
    FROM AUD_TEST)
    aud1 AS
    (SELECT column_name,
    DECODE (column_id,
    7, TO_CHAR (eff_to_dt, 'MMDDRRRR'),
    8, active_flg,
    9, nm_long,
    10, nm_short,
    11, rplcmnt_bu_id,
    12, pc_cc_cd,
    13, tax_cd,
    14, bu_type_cd,
    15, ledger_cd) col_val_new,
    '' col_val_old, fre_id, bu_id, eff_from_dt, rec_eff_from_dt, rec_type, rank
    FROM metadata1, all_tab_columns u
    WHERE table_name = 'AUD_TEST'
    AND column_name IN
    ('EFF_TO_DT',
    'ACTIVE_FLG',
    'NM_LONG',
    'NM_SHORT',
    'RPLCMNT_BU_ID',
    'PC_CC_CD',
    'TAX_CD',
    'BU_TYPE_CD',
    'LEDGER_CD'
    AND rank = '1')      ,
    aud2 AS
    (SELECT column_name,
    DECODE (column_id,
    7, TO_CHAR (eff_to_dt, 'MMDDRRRR'),
    8, active_flg,
    9, nm_long,
    10, nm_short,
    11, rplcmnt_bu_id,
    12, pc_cc_cd,
    13, tax_cd,
    14, bu_type_cd,
    15, ledger_cd) col_val_new,
    '' col_val_old, fre_id, bu_id, eff_from_dt, rec_eff_from_dt, rec_type, rank
    FROM metadata1 m, all_tab_columns u
    WHERE table_name = 'AUD_TEST'
    AND column_name IN
    ('EFF_TO_DT',
    'ACTIVE_FLG',
    'NM_LONG',
    'NM_SHORT',
    'RPLCMNT_BU_ID',
    'PC_CC_CD',
    'TAX_CD',
    'BU_TYPE_CD',
    'LEDGER_CD')
    AND rank = '2'),
    aud3 AS
    (SELECT column_name,
    DECODE (column_id,
    7, TO_CHAR (eff_to_dt, 'MMDDRRRR'),
    8, active_flg,
    9, nm_long,
    10, nm_short,
    11, rplcmnt_bu_id,
    12, pc_cc_cd,
    13, tax_cd,
    14, bu_type_cd,
    15, ledger_cd) col_val_new,
    '' col_val_old, fre_id, bu_id, eff_from_dt, rec_eff_from_dt, rec_type, rank
    FROM metadata1 m, all_tab_columns u
    WHERE table_name = 'AUD_TEST'
    AND column_name IN
    ('EFF_TO_DT',
    'ACTIVE_FLG',
    'NM_LONG',
    'NM_SHORT',
    'RPLCMNT_BU_ID',
    'PC_CC_CD',
    'TAX_CD',
    'BU_TYPE_CD',
    'LEDGER_CD')
    AND rank = '3'),
    aud4 AS
    (SELECT column_name,
    DECODE (column_id,
    7, TO_CHAR (eff_to_dt, 'MMDDRRRR'),
    8, active_flg,
    9, nm_long,
    10, nm_short,
    11, rplcmnt_bu_id,
    12, pc_cc_cd,
    13, tax_cd,
    14, bu_type_cd,
    15, ledger_cd) col_val_new,
    '' col_val_old, fre_id, bu_id, eff_from_dt, rec_eff_from_dt, rec_type, rank
    FROM metadata1 m, all_tab_columns u
    WHERE table_name = 'AUD_TEST'
    AND column_name IN
    ('EFF_TO_DT',
    'ACTIVE_FLG',
    'NM_LONG',
    'NM_SHORT',
    'RPLCMNT_BU_ID',
    'PC_CC_CD',
    'TAX_CD',
    'BU_TYPE_CD',
    'LEDGER_CD')
    AND rank = '4'),
    aud5 AS
    (SELECT column_name,
    DECODE (column_id,
    7, TO_CHAR (eff_to_dt, 'MMDDRRRR'),
    8, active_flg,
    9, nm_long,
    10, nm_short,
    11, rplcmnt_bu_id,
    12, pc_cc_cd,
    13, tax_cd,
    14, bu_type_cd,
    15, ledger_cd) col_val_new,
    '' col_val_old, fre_id, bu_id, eff_from_dt, rec_eff_from_dt, rec_type, rank
    FROM metadata1 m, all_tab_columns u
    WHERE table_name = 'AUD_TEST'
    AND column_name IN
    ('EFF_TO_DT',
    'ACTIVE_FLG',
    'NM_LONG',
    'NM_SHORT',
    'RPLCMNT_BU_ID',
    'PC_CC_CD',
    'TAX_CD',
    'BU_TYPE_CD',
    'LEDGER_CD')
    AND rank = '5'),
    aud6 AS
    (SELECT column_name,
    DECODE (column_id,
    7, TO_CHAR (eff_to_dt, 'MMDDRRRR'),
    8, active_flg,
    9, nm_long,
    10, nm_short,
    11, rplcmnt_bu_id,
    12, pc_cc_cd,
    13, tax_cd,
    14, bu_type_cd,
    15, ledger_cd) col_val_new,
    '' col_val_old, fre_id, bu_id, eff_from_dt, rec_eff_from_dt, rec_type, rank
    FROM metadata1 m, all_tab_columns u
    WHERE table_name = 'AUD_TEST'
    AND column_name IN
    ('EFF_TO_DT',
    'ACTIVE_FLG',
    'NM_LONG',
    'NM_SHORT',
    'RPLCMNT_BU_ID',
    'PC_CC_CD',
    'TAX_CD',
    'BU_TYPE_CD',
    'LEDGER_CD')
    AND rank = '6'),
    aud7 AS
    (SELECT column_name,
    DECODE (column_id,
    7, TO_CHAR (eff_to_dt, 'MMDDRRRR'),
    8, active_flg,
    9, nm_long,
    10, nm_short,
    11, rplcmnt_bu_id,
    12, pc_cc_cd,
    13, tax_cd,
    14, bu_type_cd,
    15, ledger_cd) col_val_new,
    '' col_val_old, fre_id, bu_id, eff_from_dt, rec_eff_from_dt, rec_type, rank
    FROM metadata1 m, all_tab_columns u
    WHERE table_name = 'AUD_TEST'
    AND column_name IN
    ('EFF_TO_DT',
    'ACTIVE_FLG',
    'NM_LONG',
    'NM_SHORT',
    'RPLCMNT_BU_ID',
    'PC_CC_CD',
    'TAX_CD',
    'BU_TYPE_CD',
    'LEDGER_CD')
    AND rank = '7'),
    aud8 AS
    (SELECT column_name,
    DECODE (column_id,
    7, TO_CHAR (eff_to_dt, 'MMDDRRRR'),
    8, active_flg,
    9, nm_long,
    10, nm_short,
    11, rplcmnt_bu_id,
    12, pc_cc_cd,
    13, tax_cd,
    14, bu_type_cd,
    15, ledger_cd) col_val_new,
    '' col_val_old, fre_id, bu_id, eff_from_dt, rec_eff_from_dt, rec_type, rank
    FROM metadata1 m, all_tab_columns u
    WHERE table_name = 'AUD_TEST'
    AND column_name IN
    ('EFF_TO_DT',
    'ACTIVE_FLG',
    'NM_LONG',
    'NM_SHORT',
    'RPLCMNT_BU_ID',
    'PC_CC_CD',
    'TAX_CD',
    'BU_TYPE_CD',
    'LEDGER_CD')
    AND rank = '8'),
    aud9 AS
    (SELECT column_name,
    DECODE (column_id,
    7, TO_CHAR (eff_to_dt, 'MMDDRRRR'),
    8, active_flg,
    9, nm_long,
    10, nm_short,
    11, rplcmnt_bu_id,
    12, pc_cc_cd,
    13, tax_cd,
    14, bu_type_cd,
    15, ledger_cd) col_val_new,
    '' col_val_old, fre_id, bu_id, eff_from_dt, rec_eff_from_dt, rec_type, rank
    FROM metadata1 m, all_tab_columns u
    WHERE table_name = 'AUD_TEST'
    AND column_name IN
    ('EFF_TO_DT',
    'ACTIVE_FLG',
    'NM_LONG',
    'NM_SHORT',
    'RPLCMNT_BU_ID',
    'PC_CC_CD',
    'TAX_CD',
    'BU_TYPE_CD',
    'LEDGER_CD')
    AND rank = '9'),
    aud10 AS
    (SELECT column_name,
    DECODE (column_id,
    7, TO_CHAR (eff_to_dt, 'MMDDRRRR'),
    8, active_flg,
    9, nm_long,
    10, nm_short,
    11, rplcmnt_bu_id,
    12, pc_cc_cd,
    13, tax_cd,
    14, bu_type_cd,
    15, ledger_cd) col_val_new,
    '' col_val_old, fre_id, bu_id, eff_from_dt, rec_eff_from_dt, rec_type, rank
    FROM metadata1 m, all_tab_columns u
    WHERE table_name = 'AUD_TEST'
    AND column_name IN
    ('EFF_TO_DT',
    'ACTIVE_FLG',
    'NM_LONG',
    'NM_SHORT',
    'RPLCMNT_BU_ID',
    'PC_CC_CD',
    'TAX_CD',
    'BU_TYPE_CD',
    'LEDGER_CD')
    AND rank = '10'),
    metadata2 as
    (select aud1.column_name,
    aud1.col_val_new,
    '' col_val_old,
    aud1.fre_id,
    aud1.bu_id,
    aud1.eff_from_dt,
    aud1.rec_eff_from_dt,
    aud1.rec_type,
    aud1.rank
    from aud1
    union all
    select aud2.column_name, DECODE(aud2.rec_type,'D','',aud2.col_val_new) col_val_new, aud1.col_val_new col_val_old, aud2.fre_id, aud2.bu_id,
    aud2.eff_from_dt, aud2.rec_eff_from_dt, aud2.rec_type, aud2.rank
    from aud1, aud2
    where (aud1.fre_id = aud2.fre_id and aud1.bu_id = aud2.bu_id and aud1.eff_from_dt = aud2.eff_from_dt
    and aud1.column_name = aud2.column_name
    and ( (aud2.rec_type = 'C' and nvl(aud1.col_val_new,'^') <> nvl(aud2.col_val_new,'~') ) or
    (aud2.rec_type <> 'C' or (nvl(aud1.col_val_new,'^') <> nvl(aud2.col_val_new,'~'))))
    union all
    select aud3.column_name, DECODE(aud3.rec_type,'D','',aud3.col_val_new) col_val_new, aud2.col_val_new col_val_old, aud3.fre_id, aud3.bu_id,
    aud3.eff_from_dt, aud3.rec_eff_from_dt, aud3.rec_type, aud3.rank
    from aud2, aud3
    where (aud2.fre_id = aud3.fre_id and aud2.bu_id = aud3.bu_id and aud2.eff_from_dt = aud3.eff_from_dt
    and aud2.column_name = aud3.column_name
    and ( (aud3.rec_type = 'C' and nvl(aud2.col_val_new,'^') <> nvl(aud3.col_val_new,'~') ) or
    (aud3.rec_type <> 'C' or (nvl(aud2.col_val_new,'^') <> nvl(aud3.col_val_new,'~'))))
    union all
    select aud4.column_name, DECODE(aud4.rec_type,'D','',aud4.col_val_new) col_val_new, aud3.col_val_new col_val_old, aud4.fre_id, aud4.bu_id,
    aud4.eff_from_dt, aud4.rec_eff_from_dt, aud4.rec_type, aud4.rank
    from aud3, aud4
    where (aud3.fre_id = aud4.fre_id and aud3.bu_id = aud4.bu_id and aud3.eff_from_dt = aud4.eff_from_dt
    and aud3.column_name = aud4.column_name
    and ( (aud4.rec_type = 'C' and nvl(aud3.col_val_new,'^') <> nvl(aud4.col_val_new,'~') ) or
    (aud4.rec_type <> 'C' or (nvl(aud3.col_val_new,'^') <> nvl(aud4.col_val_new,'~'))))
    union all
    select aud5.column_name, DECODE(aud5.rec_type,'D','',aud5.col_val_new) col_val_new, aud4.col_val_new col_val_old, aud5.fre_id, aud5.bu_id,
    aud5.eff_from_dt, aud5.rec_eff_from_dt, aud5.rec_type, aud5.rank
    from aud4, aud5
    where (aud4.fre_id = aud5.fre_id and aud4.bu_id = aud5.bu_id and aud4.eff_from_dt = aud5.eff_from_dt
    and aud4.column_name = aud5.column_name
    and ( (aud5.rec_type = 'C' and nvl(aud4.col_val_new,'^') <> nvl(aud5.col_val_new,'~') ) or
    (aud5.rec_type <> 'C' or (nvl(aud4.col_val_new,'^') <> nvl(aud5.col_val_new,'~'))))
    union all
    select aud6.column_name, DECODE(aud6.rec_type,'D','',aud6.col_val_new) col_val_new, aud5.col_val_new col_val_old, aud6.fre_id, aud6.bu_id,
    aud6.eff_from_dt, aud6.rec_eff_from_dt, aud6.rec_type, aud6.rank
    from aud5, aud6
    where (aud5.fre_id = aud6.fre_id and aud5.bu_id = aud6.bu_id and aud5.eff_from_dt = aud6.eff_from_dt
    and aud5.column_name = aud6.column_name
    and ( (aud6.rec_type = 'C' and nvl(aud5.col_val_new,'^') <> nvl(aud6.col_val_new,'~') ) or
    (aud6.rec_type <> 'C' or (nvl(aud5.col_val_new,'^') <> nvl(aud6.col_val_new,'~'))))
    union all
    select aud7.column_name, DECODE(aud7.rec_type,'D','',aud7.col_val_new) col_val_new, aud6.col_val_new col_val_old, aud7.fre_id, aud7.bu_id,
    aud7.eff_from_dt, aud7.rec_eff_from_dt, aud7.rec_type, aud7.rank
    from aud6, aud7
    where (aud6.fre_id = aud7.fre_id and aud6.bu_id = aud7.bu_id and aud6.eff_from_dt = aud7.eff_from_dt
    and aud6.column_name = aud7.column_name
    and ( (aud7.rec_type = 'C' and nvl(aud6.col_val_new,'^') <> nvl(aud7.col_val_new,'~') ) or
    (aud7.rec_type <> 'C' or (nvl(aud6.col_val_new,'^') <> nvl(aud7.col_val_new,'~'))))
    union all
    select aud8.column_name, DECODE(aud8.rec_type,'D','',aud8.col_val_new) col_val_new, aud7.col_val_new col_val_old, aud8.fre_id, aud8.bu_id,
    aud8.eff_from_dt, aud8.rec_eff_from_dt, aud8.rec_type, aud8.rank
    from aud7, aud8
    where (aud7.fre_id = aud8.fre_id and aud7.bu_id = aud8.bu_id and aud7.eff_from_dt = aud8.eff_from_dt
    and aud7.column_name = aud8.column_name
    and ( (aud8.rec_type = 'C' and nvl(aud7.col_val_new,'^') <> nvl(aud8.col_val_new,'~') ) or
    (aud8.rec_type <>'C' or (nvl(aud7.col_val_new,'^') <> nvl(aud8.col_val_new,'~'))))
    union all
    select aud9.column_name, DECODE(aud9.rec_type,'D','',aud9.col_val_new) col_val_new, aud8.col_val_new col_val_old, aud9.fre_id, aud9.bu_id,
    aud9.eff_from_dt, aud9.rec_eff_from_dt, aud9.rec_type, aud9.rank
    from aud8, aud9
    where (aud8.fre_id = aud9.fre_id and aud8.bu_id = aud9.bu_id and aud8.eff_from_dt = aud9.eff_from_dt
    and aud8.column_name = aud9.column_name
    and ( (aud9.rec_type = 'C' and nvl(aud8.col_val_new,'^') <> nvl(aud9.col_val_new,'~') ) or
    (aud9.rec_type <> 'C' or (nvl(aud8.col_val_new,'^') <> nvl(aud9.col_val_new,'~'))))
    union all
    select aud10.column_name, DECODE(aud10.rec_type,'D','',aud10.col_val_new) col_val_new, aud9.col_val_new col_val_old, aud10.fre_id, aud10.bu_id,
    aud10.eff_from_dt, aud10.rec_eff_from_dt, aud10.rec_type, aud10.rank
    from aud9, aud10
    where (aud9.fre_id = aud10.fre_id and aud9.bu_id = aud10.bu_id and aud9.eff_from_dt = aud10.eff_from_dt
    and aud9.column_name = aud10.column_name
    and ((aud10.rec_type = 'C' and nvl(aud9.col_val_new,'^') <> nvl(aud10.col_val_new,'~') )
    or (aud10.rec_type <> 'C' or (nvl(aud9.col_val_new,'^') <> nvl(aud10.col_val_new,'~'))))
    select * from metadata2
    where (rec_type = 'C' and (col_val_new is not null or col_val_old is not null))
    or (rec_type <> 'C');

  • Error while creating a View Cluster

    Hello Gurus,
         I have created two maintenance views ZVIEW1 & ZVIEW2  with table maintenance generator.Know I am trying
         to create a view cluster using these views.
         I have Proceeded with the following steps to create the View Cluster:
         1. Tcode : SE54 --> GIven the name ZVIEWCLUSTER as View Cluster name & pressed ENTER.
         2. Filled the description of the View cluster.
         3.Selected the tab OBJECT STRUCTURE  and filled it with ZVIEW1 & ZVIEW2.
         4.Selected view ZVIEW1 and clicked on button "FIELD-DEPENDENCE" ,System throws a message
             "Field-dependence generated succesfully"
         5. Selected view ZVIEW2 and clicked on button "FIELD-DEPENDENCE" ,System throws an error message
             "No log generated".
          Am stuck up at point 5 in the above mentioned steps.
          Please guide me in coming out of this error message.
    Regards,
    Najam

    Hi Najam,
    I don't think you need to define field dependencies for both tables, you only define the relationship from the second table to the first.
    Double-click on the Field dependencies folder and check the link between the two tables is correctly defined, if so you don't need to generate the field dependency twice.
    Regards,
    Nick

  • Error while creating materialized view which using database link

    Helo!
    I'm getting error "ORA-00942: table or view does not exist" when I want to create materialized view.
    Details:
    1. On destination database I create a database link:
    CREATE DATABASE LINK SDATABASE
    CONNECT TO MYUSER
    IDENTIFIED BY MYUSERPASS
    USING 'ORCL';
    => Command "SELECT * FROM TABLE1@SDATABASE" returns data normally!
    2. On source database I create MATERIALIZED VIEW LOG:
    CREATE MATERIALIZED VIEW LOG
    ON TABLE1
    WITH PRIMARY KEY
    INCLUDING NEW VALUES;
    3. Now, when I want to create MATERIALIZED VIEW on destination database:
    CREATE MATERIALIZED VIEW TABLE1
    REFRESH FAST
    START WITH SYSDATE
    NEXT SYSDATE + 1/1440
    WITH PRIMARY KEY
    AS SELECT * FROM TABLE1@SDATABASE;
    ...I get error "ORA-00942: table or view does not exist"!
    How is that possible if command "SELECT * FROM TABLE1@SDATABASE" returns data normally?
    Thanks,
    Voranc

    And, I'm using Oracle 10g.
    Voranc

Maybe you are looking for

  • Help me debug DAC-104, BC4J

    DAC-104: ImmediateAccess: setAttribute failed. ColumnView: Hct row: 1 JBO-26080: Error while selecting entity for Cbc [ODBC S1C00] driver not capable of this operation This is an Oracle Lite source. I'm confused by the ODBC statement - as I thought I

  • Unable to generate Pdf report for crystal 9/10  in Windows 2012 (Standard) server with Times New Roman font. With same font, report getting generated in excel, text, csv format in Windows 2012.

    For Times New Roman font in Windows server 2012 R2 (Standard), crystal 9/10 report in pdf format is not getting generated. When we change the font for specific report like Arial, Calibri , Cambria then pdf report getting created. In Windows 2008 R2,

  • GT70 - Turbomode wont work (Win7)

    Hey guys, since my GT70 was delivered i installed every stuff i need and everything is working fine...except the Turbomode/button... when i press it its blinking and turns off.. I installed SMC+MSI VGA overclocking tool.. Using Win7 (already tried on

  • Populate Combo in matrix

    Hi,      I have a Matrix.      In Each row i want like to populate matrix with values based on the row.      My problem is once a combo gets populated in one row, the same value      gets populated for other rows also(inspite of changing values)     

  • Unable to save values to the Database

    Hi, I have created a table in the database and a form with submit and the cancel button. When the values are entered in the form and the submit button is clicked, the values are not getting stored. When I was analyzing this, I changed the "Page in th