Query to test

I want to write complex queries to test my knowledge of sql and pl/sql.
Is there any online site that provides sample data and sample queries to write or a challenging sql query puzzle.
By complex i mean lots of lines of queries.
Thanks

Well, if you are looking for puzzles, go [url http://oraqa.com/author/frank-zhou/]to this site click on every link having word "puzzle" and go to the sites initally referred by Frank Zhou - and don't cheat ;-)
Best regards
Maxim

Similar Messages

  • BI SAP Query Connector test fails!

    BI SAP Query Connector test is failing in Portal 7.0 SP6
    Scuccessfully tested BI SAP Query connector using the
    URL : http://<myhost>:51200/TSapq/servlet/TestSapq
    But when i try to test from the portal its failing
    The Connection properties are defined both in Connection Connector in Visual admin as well as Portal as follows and user mapping is done as follows.
    Application Server  myhost.xxx.net
    Client  : 010
    Message Server  : myhost.xxx.net
    Query Area  : x
    System Number : 12
    System Name : BWT_SAPQ
    Master Language : en
    User Management
    Logon Method : SAPLOGONTICKET
    User Mapping : Admin, User
    In User Administration i have maped the BWT_SAPQ system and provided user id and password.
    Below is test result
    Test Connection with Connector
    Test Details:
    The test consists of the following steps:
    1. Retrieve the default alias of the system
    2. Check the connection to the backend application using the connector defined in this system object
    Results
    Retrieval of default alias successful
    Connection failed. Make sure user mapping is set correctly and all connection properties are correct.
    Would really appreciated your help on this.
    Thanks,
    Srinivas

    hi Aamod;
    it seems like you already have your BI SAP Query system working properly, if you can use it in the BI Integration Wizard. what's the problem you're seeing in VC?
    systems created with the BI SAP Query Connector are relational systems and therefore expose tables and fields in VC. via the BI Connector, these systems are 'lent' BI functionality and you can use these tables in the BI Integration Wizard, as you've seen. you might therefore call these "relational BI systems" (just like systems created with the BI JDBC Connector are).
    if you have consulted the System Landscape documentation on configuring properties for a BI SAP Query System (<a href="http://help.sap.com/saphelp_nw04s/helpdata/en/4b/9afe3323d14005a283dee9101c66fc/frameset.htm">here</a>) and you're still having problems connecting with the BI SAP Query Connector, i'd suggest you write up a CSS message.
    hope it helps;
    -m

  • XPath query to test for the existence of a tag

    I have the following piece of XML and I need to write a query against it that will check for the existence of the <content> tag in XML body... In other words, I want to get the row if the <content> tag is absent from the Asset portion of the metadata but only for Asset_Class = "encrypted"
    ADI>

    <Metadata>
    <AMS Asset_Class="package" Asset_ID="TTVV4136100000000001" Asset_Name="Package_4136" Creation_Date="2004-07-12" Description="Test package C1" Product="MOD" Provider="N2BB" Provider_ID="n2bb.com" Verb="" Version_Major="1" Version_Minor="0"/>
    <App_Data App="MOD" Name="Provider_Content_Tier" Value="HBO1"/>
    <App_Data App="MOD" Name="Metadata_Spec_Version" Value="CableLabsVOD1.1"/>
    </Metadata>

    <Asset>

    <Metadata>
    <AMS Asset_Class="title" Asset_ID="TTVV4136100000000002" Asset_Name="Package_4136_Title" Creation_Date="2004-07-12" Description="Test package C1 title" Product="MOD" Provider="N2BB" Provider_ID="n2bb.com" Verb="" Version_Major="1" Version_Minor="0"/>
    <App_Data App="MOD" Name="Distributor_Royalty_Percent" Value="12.11"/>
    <App_Data App="MOD" Name="Contract_Name" Value="Contract Name"/>
    <App_Data App="MOD" Name="Box_Office" Value="184000000"/>
    <App_Data App="MOD" Name="MSORating" Value="R"/>
    <App_Data App="MOD" Name="Distributor_Royalty_Flat_Rate" Value="15.549"/>
    <App_Data App="MOD" Name="Studio_Name" Value="N2Broadband, INC"/>
    <App_Data App="MOD" Name="Season_Premiere" Value="N"/>
    <App_Data App="MOD" Name="Country_of_Origin" Value="USA"/>
    <App_Data App="MOD" Name="Actors_Display" Value="Harrison Ford, Tommy Lee Jones, Sela Ward"/>
    <App_Data App="MOD" Name="Propagation_Priority" Value="1"/>
    <App_Data App="MOD" Name="Title_Sort_Name" Value="Pkg C1"/>
    <App_Data App="MOD" Name="Director" Value="Villaveces,Eduardo"/>
    <App_Data App="MOD" Name="Genre" Value="Test"/>
    <App_Data App="MOD" Name="Director" Value="Robertson,Mark"/>
    <App_Data App="MOD" Name="Summary_Short" Value="Test Package C1 Summary_Short"/>
    <App_Data App="MOD" Name="Closed_Captioning" Value="Y"/>
    <App_Data App="MOD" Name="Studio_Royalty_Minimum" Value="13.000"/>
    <App_Data App="MOD" Name="Producers" Value="phillips,chris"/>
    <App_Data App="MOD" Name="Studio" Value="Warner Bros."/>
    <App_Data App="MOD" Name="Rating" Value="G"/>
    <App_Data App="MOD" Name="Rating" Value="TV-G"/>
    <App_Data App="MOD" Name="Category" Value="Encryption Test"/>
    <App_Data App="MOD" Name="Provider_QA_Contact" Value="[email protected]"/>
    <App_Data App="MOD" Name="Display_As_Last_Chance" Value="40"/>
    <App_Data App="MOD" Name="Writer_Display" Value="test of writers disp"/>
    <App_Data App="MOD" Name="Home_Video_Window" Value="45"/>
    <App_Data App="MOD" Name="Billing_ID" Value="00270"/>
    <App_Data App="MOD" Name="Episode_ID" Value="E ID"/>
    <App_Data App="MOD" Name="Title_Brief" Value="test content"/>
    <App_Data App="MOD" Name="Display_Run_Time" Value="00:03"/>
    <App_Data App="MOD" Name="Maximum_Viewing_Length" Value="00:01:00"/>
    <App_Data App="MOD" Name="Distributor_Name" Value="fox movies"/>
    <App_Data App="MOD" Name="Studio_Royalty_Percent" Value="12.00"/>
    <App_Data App="MOD" Name="Audience" Value="Adult"/>
    <App_Data App="MOD" Name="Distributor_Royalty_Minimum" Value="14.552"/>
    <App_Data App="MOD" Name="Display_As_New" Value="10"/>
    <App_Data App="MOD" Name="Episode_Name" Value="E name"/>
    <App_Data App="MOD" Name="Preview_Period" Value="60"/>
    <App_Data App="MOD" Name="Title" Value="Test Package C1"/>
    <App_Data App="MOD" Name="Summary_Long" Value="Test Package C1 Summary_Long"/>
    <App_Data App="MOD" Name="Actors" Value="davis,bill"/>
    <App_Data App="MOD" Name="Summary_Medium" Value="Test Package C1 Summary_Medium"/>
    <App_Data App="MOD" Name="Licensing_Window_Start" Value="2009-10-01"/>
    <App_Data App="MOD" Name="Type" Value="title"/>
    <App_Data App="MOD" Name="Suggested_Price" Value="3.95"/>
    <App_Data App="MOD" Name="Run_Time" Value="00:01:02"/>
    <App_Data App="MOD" Name="Chapter" Value="00:01:00:00,test1"/>
    <App_Data App="MOD" Name="Licensing_Window_End" Value="2011-11-01"/>
    <App_Data App="MOD" Name="Subscriber_View_Limit" Value="2003-03-10,2003-03-12,12"/>
    <App_Data App="MOD" Name="Season_Finale" Value="Y"/>
    <App_Data App="MOD" Name="Year" Value="1993"/>
    <App_Data App="MOD" Name="Studio_Royalty_Flat_Rate" Value="14.000"/>
    </Metadata>

    <Asset>

    <Metadata>
    <AMS Asset_Class="movie" Asset_ID="TTVV4136100000000003" Asset_Name="Package_4136_Movie" Creation_Date="2004-07-12" Description="Test Package movie" Product="MOD" Provider="N2BB" Provider_ID="n2bb.com" Verb="" Version_Major="1" Version_Minor="0"/>
    <App_Data App="MOD" Name="Type" Value="movie"/>
    <App_Data App="MOD" Name="Encryption" Value="Y"/>
    <App_Data App="MOD" Name="Audio_Type" Value="Dolby Digital"/>
    <App_Data App="MOD" Name="Screen_Format" Value="Standard"/>
    <App_Data App="MOD" Name="Copy_Protection" Value="Y"/>
    <App_Data App="MOD" Name="Content_FileSize" Value="6902796"/>
    <App_Data App="MOD" Name="Content_CheckSum" Value="81647e1a3d38c4e64af3bbcf15711b40"/>
    </Metadata>
    <Content Value="movie4136.mpg"/>
    </Asset>

    <Asset>

    <Metadata>
    <AMS Asset_Class="poster" Asset_ID="TTVV4136100000000005" Asset_Name="Package_4136_Poster" Creation_Date="2004-07-12" Description="Test Package poster desc" Product="MOD" Provider="N2BB" Provider_ID="n2bb.com" Verb="" Version_Major="1" Version_Minor="0"/>
    <App_Data App="MOD" Name="Type" Value="poster"/>
    <App_Data App="MOD" Name="Image_Aspect_Ratio" Value="240x480"/>
    <App_Data App="MOD" Name="Content_CheckSum" Value="999dcd45d6374feb380c0f49029911b5"/>
    <App_Data App="MOD" Name="Content_FileSize" Value="30"/>
    </Metadata>
    <Content Value="poster4136.bmp"/>
    </Asset>

    <Asset>

    <Metadata>
    <AMS Asset_Class="preview" Asset_ID="TTVV4136100000000004" Asset_Name="Package_4136_Preview" Creation_Date="2004-07-12" Description="Test Package Preview" Product="MOD" Provider="N2BB" Provider_ID="n2bb.com" Verb="" Version_Major="1" Version_Minor="0"/>
    <App_Data App="MOD" Name="Type" Value="preview"/>
    <App_Data App="MOD" Name="Screen_Format" Value="Standard"/>
    <App_Data App="MOD" Name="Audience" Value="General"/>
    <App_Data App="MOD" Name="MSORating" Value="All-Ages"/>
    <App_Data App="MOD" Name="Audio_Type" Value="Dolby Digital"/>
    <App_Data App="MOD" Name="Languages" Value="en"/>
    <App_Data App="MOD" Name="Dubbed_Languages" Value="is"/>
    <App_Data App="MOD" Name="Subtitle_Languages" Value="is"/>
    <App_Data App="MOD" Name="Rating" Value="G"/>
    <App_Data App="MOD" Name="Rating" Value="TV-14 S"/>
    <App_Data App="MOD" Name="Run_Time" Value="00:03:54"/>
    <App_Data App="MOD" Name="Content_FileSize" Value="6902796"/>
    <App_Data App="MOD" Name="Content_CheckSum" Value="81647e1a3d38c4e64af3bbcf15711b40"/>
    </Metadata>
    <Content Value="preview4136.mpg"/>
    </Asset>

    <Asset>

    <Metadata>
    <AMS Asset_Class="encrypted" Asset_ID="TTVE0000000000202939" Asset_Name="TTVV4136100000000003.n2bb.com" Creation_Date="2010-06-28" Description="Encrypted asset for movie4136.mpg" Product="MOD" Provider="N2BB" Provider_ID="n2bb.com" Verb="" Version_Major="1" Version_Minor="1"/>
    <App_Data App="MOD" Name="Content_CheckSum" Value="81647e1a3d38c4e64af3bbcf15711b40"/>
    <App_Data App="MOD" Name="Bit_Rate" Value="3594"/>
    <App_Data App="MOD" Name="Encryption_Key_Block" Value="<?xml version="1.0" encoding="UTF-8"?><ERPayload xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://localhost/namespaces/ERPayload.xsd"> <EncryptionRecord> <ERVer1.0> <TitleIdCode>TTVV4136100000000003</TitleIdCode> <ContentTitle>TTVV4136100000000003</ContentTitle> <EncryptionTime>2010-06-23T18:18:58Z</EncryptionTime> <OLESId>268</OLESId> <Label>12138</Label> <EncryptionMode>2</EncryptionMode> <EncryptedDataVersion>0</EncryptedDataVersion> <EncryptedDataBlock>rd00X2wXJ3uQVd6tNJDimuBMNod/zkXKmxdoR5skbFOd84eVhNdX4NQAE6Nt/iX/cz4IyHXYmYpOHVvLe5GtGFqnRxkoPhBHmMpKgFtDsDX63kgM9p00qI5SEyX4F+VNudY3GZQEQQU4qP61+dXkBYMsnGm5qV18OMnF+xThCGU=</EncryptedDataBlock> </ERVer1.0> </EncryptionRecord></ERPayload>"/>
    <App_Data App="MOD" Name="Receiver_Type" Value="MOTO"/>
    <App_Data App="MOD" Name="Asset_Encrypted" Value="TTVV4136100000000003"/>
    <App_Data App="MOD" Name="Encryption_Type" Value="oles"/>
    <App_Data App="MOD" Name="Encrypting_System_Info" Value="MOTO_OLES_1"/>
    <App_Data App="MOD" Name="Content_FileSize" Value="6902796"/>
    </Metadata>
    <Content Value="movie4136_encr.mpg"/>
    </Asset>
    </Asset>
    </ADI>

    Hi,
    You may use this in the WHERE clause :
    EXISTSNODE(xmltype_column, 'ADI/Asset/Asset[Metadata/AMS/@Asset_Class="encrypted"]/Content') = 0The XML has to be stored in an XMLType column, is that the case?

  • Transport of Query to Test System

    Hi
    All do you transport newly craeted query and its web template to Test system. I have created a query now will have to craete the transport request for the same and transport it to Test system.
    Regards,
    Rohini

    Thanks Brat, Bhanu and Roberto
    Bhanu i already have a development package created.
    and i ahve already done with my query design.
    Now how will have to transport to Test system?
    Creating transport request now when iam done with query design will consider this new report in the request and move the report to QA?
    Regards,
    Rohini

  • Af:query & selenium testing

    af:query creates search elements with ids such as "myQuery:value00", "myQuery:value10", and so on.
    As I understand it, adding or shuffling search attributes will break any automated testing (in our case, our Selenium tests).
    I would think that ids such as "myQuery:city", "myQuery:state", "myQuery:someOtherAttributeName" would result in more robust tests.
    Is there any way to accomplish this?

    Hi.
    this article might be useful "Testing Your Oracle ADF Faces Application with Selenium"
    http://www.oracle.com/technetwork/articles/adf/part6-094560.html

  • Transport or import bex query to test environment

    hi gurus
    is there a way I can move a bex query from production to my test environment?
    I guess : RSA1- Transport - Export / Import, but i never used them...
    regards

    HI,
    I am also facing the same issue.
    : "Manually start the maintenance transaction for objects of type CWM Document"
    @5C\QError@ SAP object 0CURRENCY () cannot be imported @35\QLong text exists@
    SAP object 0CURRENCY () cannot be imported
    Message no. RSOXML218
    Diagnosis
    You attempted to import SAP object 0CURRENCY of type  into the system via the
    XMI interface. However, you are not allowed to import SAP objects.
    System Response
    The object will be ignored during the import.
    Note: It can be that the import is incomplete when the required SAP objects
    are still not active in the system.
    Procedure
    Install the specified objects from BI Content. Only import the metadata
    afterwards.
    If any one resolved this issue , can you please let me know how to resolve it.
    Regards,
    Anil Kumar

  • Transport query from test system

    Hi
    We want to create our BEx queries in our test system and thereby transport them to the production system. We don’t want to create the queries in the development system because we don’t have any data there.
    Scenario: create a query in the test system, then use Transport Connection in RSA1 to put the query into a transport.
    When we try to add the query to a transport, we have to put it into another package then $tmp. We are not allowed to do that and we get the message: System setting does not allow changes to be made to object ELEM A5S4UZE…... We have set all the settings in Object Changeability (in Transport Connection) to Everything Changeable. Do we have to open the test system using se06 and scc4 to be able to transport BEx objects from the test system to the production system?
    We use BI 7.0 SP15.
    Kind regards
    Erik

    Erik,
    It's all much easier than that...use xml.
    Go to the transport conection in your test system.
    Note the xml export import icons.
    Select your query under object types.
    Export as xml..it will create a file that you can store in your PC.
    Go to your target system.
    Execute an import of your new xml file. That's all...now you have your query in P..and you can forget about all the STMS and requests, etc..
    Regards,
    Alberto

  • Message: 'user' missing BI SAP Query Connector Test

    Dear all,
    The BI SAP Connector test to SAP R/3 system D01 results in :
    Portal version is EP7 SP15. Any help will be greatly appreciated.
    Error> occured >Tue Mar 31 13:42:56,777<
    RfcException:
    message: 'user' missing
    Return code: RFC_INVALID_PARAMETER(19)
    error group: 101
    key: RFC_ERROR_PROGRAM
    at com.sap.mw.rfc.api.RfcOptions.checkLogonData
    (RfcOptions.java:201)
    at com.sap.mw.rfc.api.RfcOptions.checkParameters
    (RfcOptions.java:498)
    at com.sap.mw.rfc.api.RfcApi.RfcOpen(RfcApi.java:707)
    at com.sap.mw.jco.MiddlewareJRfc$Client.connect
    (MiddlewareJRfc.java:1018
    at com.sap.mw.jco.JCO$Client.connect(JCO.java:3255)
    at
    com.sap.ip.bi.sdk.dac.connector.sapq.impl.Connection.connectDB(Connec
    tion.java:333)
    at com.sap.ip.bi.sdk.dac.connector.sapq.impl.Connection.connect
    (Connecti
    on.java:128)
    at
    com.sap.ip.bi.sdk.dac.connector.sapq.SapqManagedConnection.<init>(Sap
    qManagedConnection.java:117)
    at
    com.sap.ip.bi.sdk.dac.connector.sapq.SapqManagedConnectionFactory.cre
    ateManagedConnection(SapqManagedConnectionFactory.java:117)
    Best Regards, Neeta

    hi Aamod;
    it seems like you already have your BI SAP Query system working properly, if you can use it in the BI Integration Wizard. what's the problem you're seeing in VC?
    systems created with the BI SAP Query Connector are relational systems and therefore expose tables and fields in VC. via the BI Connector, these systems are 'lent' BI functionality and you can use these tables in the BI Integration Wizard, as you've seen. you might therefore call these "relational BI systems" (just like systems created with the BI JDBC Connector are).
    if you have consulted the System Landscape documentation on configuring properties for a BI SAP Query System (<a href="http://help.sap.com/saphelp_nw04s/helpdata/en/4b/9afe3323d14005a283dee9101c66fc/frameset.htm">here</a>) and you're still having problems connecting with the BI SAP Query Connector, i'd suggest you write up a CSS message.
    hope it helps;
    -m

  • Report Painter/ Writer - Query on Testing of customization changes

    Hello,
    Customer requirement is to add newly created GL accounts as line Items in existing Zee report under Report Painter.
    The same is done. But, how can we do the testing, if any ?
    Regards.

    Hi,
    I do not use sets. Yes, I meant  that this account appears in the report after customization. The report exists under directory.
    (GR32)
    Functionally, is testing applicable to this scenario ?  If yes, then how do we do it. ?
    Regards.

  • How to query Oracle Testing ID???

    Dear all
    i lost my Oracle Testing ID
    and how to get???

    user5548654 wrote:
    Dear all
    i lost my Oracle Testing ID
    and how to get???When did you last take an (Oracle) exam ?
    Assuming it was since sept 2009.
    Visit here: Gotot My account and folllow - forgot username:
    .... or if that fails go here:
    Get together all the information about yourself, contact details, exam details, email address at the last time of registration.
    If your exam was through Prometric the same applied to them.
    As a last resort try here:
    http://education.oracle.com/pls/eval-eddap-dcd/OU_SUPPORT_OCP.home?p_source=OCP

  • Simple query help in plsql - help

    oracle version : 10gR2
    indexes are created on each column, is there anyway to make them used while searching for the records rewriting the following query to test given data in any case (lower ,upper)...
    SELECT * FROM TX_USERS
    WHERE userid like decode( UPPER('Md'),null,userid, UPPER( 'MD')||'%' ) and
    first_name like decode(UPPER('Na'),null, first_name, UPPER( 'NA')||'%' ) AND
    LAST_name like decode(('Ra'),null, LAST_name, UPPER('RA')||'%' )
    -- list goes on..
    UPPER('Md') -- is the input values comes from form.. for example i_userid.. this query works fine .. is there anyway of getting indices used without using functional based indexing when we rewrite query like shown below??? input parameter valeus can be anything and table column values can be anything i.e. anycase (upper or lower or mix of both)..
    actual code would be
    upper(userid) like decode( UPPER(i_userid),null,userid, UPPER( i_userid)||'%' ) and
    upper(first_name) like decode(UPPER(i_first_name),null, first_name, UPPER( i_firstname)||'%' )
    if we put upper(userid) then index not used ..........anyway of rewriting using it or any other technique... or any other new way

    No, its not working... see the below..
    create table test5 as select owner, object_name, subobject_name, object_type from all_objects;
    create unique index test5_i5 on test5 (owner, object_name, subobject_name, object_type);
    select * from test5 where owner like 'SCOTT' AND OBJECT_NAME LIKE 'EMP';
    INDEX RANGE SCAN| TEST5_I5 | 4 | 248 | 1 (0)| 00:00:01 |
    but when i use
    select * from test5 where UPPER(OWNER) LIKE 'SCOTT%' AND UPPER(OBJECT_NAME) LIKE 'EMP%';
    TABLE ACCESS FULL| TEST5 | 3 | 186 | 65 (5)| 00:00:01 |
    i know it goes to full scan, i want to know is there any other way to make index used .. without using functional based indx...
    the reason is user can search any one of the column data and data is mixed case in table columns and/or conditions specified in query..
    .. any help...
    not sure how to use 'NLS_SORT=BINARY_CI' on multicolumn index and enable index used in search operation.. ANY OTHER WAY OF DOING THIS...
    requirements is
    mixed (lower,upper) data stored in db columns and mixed case data searched, 5 columns specified in where condition, data may be provided in search conditon to one or two or to all 5 columns in mixed case... matching records need to be returned.. suggest a good way of doing this... thnx

  • How can I query TestStand Database quickly?

    Hello everybody
    I have a performance issue with default TestStand database what puzzled me for long time.
    In default database TestStand organize the different test item to different table, if I want to query a test record according to a special Serial Number, the query will look into UUT_RESULT at first to find a GUID then forward to the other table to find a series of GUID bound with this SN which will be used to go into different tables like a numeric values table or pass_fail table to find out the result of each test step.
    Half a year ago, we have a small tool embeded with customized TestStand Interface to access this SQL Server 2005 Express database to fetch a SN and all its test results details for faulty analysis. Recently I found it will cost me more than 2 minutes to fetch all related test results of one SN, I tried to write some query in SQL SERVER management studio to get the same thing, the case is still there. And also I check the tables, all tables are already indexed, so I'm quite confused.
    Did someone meet similar thing with me? Can you provide some suggestion on this?
    *The best Chinese farmer*

    What exactly is the query that you are using? Depending on how many records you are attempting to retrieve, two minutes may not be unreasonable. If the database is on a network share, if others are attempting to do similar, large queries, can also affect performance. Making your query into a stored procedure could save some time.

  • BI server generating  query in a different way between two instances

    Hi All,
    We have executed a report in dev,test instances,BI server generated query in a different way in two instances where as dev BI server is on AIX operating system(recently we migrated from windows),test instance is on still on Windows environment.
    For a report below are the queries
    DEV(AIX)
    WITH
    SAWITH0 AS (select sum(T316025.SALES_QUOTA) as c1,
    T329697.DIVISION_DESC as c2,
    T329697.AREA_DESC as c3,
    T329697.TERRITORY_DESC as c4,
    case when T329697.ACCOUNT_NUM is null then T329697.BILL_TO_PARTY_NAME else concat(concat(concat(T329697.BILL_TO_PARTY_NAME, '('), T329697.ACCOUNT_NUM), ')') end as c5,
    T150993.X_CONS_MAJOR_GROUP as c6,
    T66755.PER_NAME_ENT_YEAR as c7
    from
    W_DAY_D T66755 /* Dim_W_DAY_D_Common */ ,
    W_PRODUCT_D T67704 /* Dim_W_PRODUCT_D */ ,
    WC_SLX_DATA_F T316025 /* Fact_WC_SLX_DATA_F */ ,
    WC_CUSTOMER_HIERARCHY_D T329697 /* Dim_WC_Customer_Hierarchy_D_With_Error */ ,
    OBIEE_SECURITY_LOCATION_SALES T339204,
    W_PROD_CAT_DH T150993 /* Dim_W_PROD_CAT_DH_General */
    where ( T66755.ROW_WID = T316025.DAY_WID and T316025.CUSTOMER_HIERARCHY_WID = T329697.ROW_WID and T67704.ROW_WID = T316025.PRODUCT_WID and T67704.PROD_CAT2_WID = T150993.ROW_WID and T329697.TERRITORY_CODE = nvl(T339204.LOCATION , T329697.TERRITORY_CODE) and T329697.AREA_DESC = 'GROCERY AREA - EAST' and T329697.DIVISION_DESC = 'DOMESTIC SALES DIVISION' and T339204.USER_NAME = upper('Administrator') and case when T329697.ACCOUNT_NUM is null then T329697.BILL_TO_PARTY_NAME else concat(concat(concat(T329697.BILL_TO_PARTY_NAME, '('), T329697.ACCOUNT_NUM), ')') end = 'JETRO CASH AND CARRY ENTERPRISES INC(10313)' and (T66755.PER_NAME_ENT_YEAR in ('2011', '2012')) and (T329697.TERRITORY_DESC in ('BOSTON', 'CHARLOTTE', 'FLORIDA', 'GREAT LAKES', 'MID-SOUTH', 'NEW YORK', 'WHITE ROSE')) )
    group by T66755.PER_NAME_ENT_YEAR, T150993.X_CONS_MAJOR_GROUP, T329697.TERRITORY_DESC, T329697.AREA_DESC, T329697.DIVISION_DESC, case when T329697.ACCOUNT_NUM is null then T329697.BILL_TO_PARTY_NAME else concat(concat(concat(T329697.BILL_TO_PARTY_NAME, '('), T329697.ACCOUNT_NUM), ')') end )
    select distinct SAWITH0.c2 as c1,
    SAWITH0.c3 as c2,
    SAWITH0.c4 as c3,
    SAWITH0.c5 as c4,
    SAWITH0.c5 as c5,
    SAWITH0.c6 as c6,
    SAWITH0.c7 as c7,
    SAWITH0.c1 as c8
    from
    SAWITH0
    order by c1, c6
    Test(Windows)
    select distinct D1.c2 as c1,
    D1.c3 as c2,
    D1.c4 as c3,
    D1.c5 as c4,
    D1.c5 as c5,
    D1.c6 as c6,
    D1.c7 as c7,
    D1.c1 as c8
    from
    (select sum(T316025.SALES_QUOTA) as c1,
    T329697.DIVISION_DESC as c2,
    T329697.AREA_DESC as c3,
    T329697.TERRITORY_DESC as c4,
    case when T329697.ACCOUNT_NUM is null then T329697.BILL_TO_PARTY_NAME else concat(concat(concat(T329697.BILL_TO_PARTY_NAME, '('), T329697.ACCOUNT_NUM), ')') end as c5,
    T150993.X_CONS_MAJOR_GROUP as c6,
    T66755.PER_NAME_ENT_YEAR as c7
    from
    W_DAY_D T66755 /* Dim_W_DAY_D_Common */ ,
    W_PRODUCT_D T67704 /* Dim_W_PRODUCT_D */ ,
    WC_SLX_DATA_F T316025 /* Fact_WC_SLX_DATA_F */ ,
    WC_CUSTOMER_HIERARCHY_D T329697 /* Dim_WC_Customer_Hierarchy_D_With_Error */ ,
    OBIEE_SECURITY_LOCATION_SALES T339204,
    W_PROD_CAT_DH T150993 /* Dim_W_PROD_CAT_DH_General */
    where ( T66755.ROW_WID = T316025.DAY_WID and T316025.CUSTOMER_HIERARCHY_WID = T329697.ROW_WID and T67704.ROW_WID = T316025.PRODUCT_WID and T67704.PROD_CAT2_WID = T150993.ROW_WID and T329697.TERRITORY_CODE = nvl(T339204.LOCATION , T329697.TERRITORY_CODE) and T329697.AREA_DESC = 'GROCERY AREA - EAST' and T329697.DIVISION_DESC = 'DOMESTIC SALES DIVISION' and T339204.USER_NAME = upper('Administrator') and case when T329697.ACCOUNT_NUM is null then T329697.BILL_TO_PARTY_NAME else concat(concat(concat(T329697.BILL_TO_PARTY_NAME, '('), T329697.ACCOUNT_NUM), ')') end = 'JETRO CASH AND CARRY ENTERPRISES INC(10313)' and (T66755.PER_NAME_ENT_YEAR in ('2011', '2012')) and (T329697.TERRITORY_DESC in ('BOSTON', 'CHARLOTTE', 'FLORIDA', 'GREAT LAKES', 'MID-SOUTH', 'NEW YORK', 'WHITE ROSE')) )
    group by T66755.PER_NAME_ENT_YEAR, T150993.X_CONS_MAJOR_GROUP, T329697.TERRITORY_DESC, T329697.AREA_DESC, T329697.DIVISION_DESC, case when T329697.ACCOUNT_NUM is null then T329697.BILL_TO_PARTY_NAME else concat(concat(concat(T329697.BILL_TO_PARTY_NAME, '('), T329697.ACCOUNT_NUM), ')') end
    ) D1
    order by c1, c6
    If we observe test query is very simple and easy to back track but in Dev it is appending like sawwith0,sawwith1 etc..looking difficult.
    Is there in any configuration to change to generate query like Test(with out SAWWITH0).
    NOTE:Any how results are same in both instances.
    Please help me to resolve this issue.
    Thank You,
    Anil Kumar.

    Anil,
    Are your database settings the same in both of the rpds dev and test?
    Check wether you didn't change anything to the default. Open your RDP double click on the Database in the physical layer and go to Feature you can check all the settings there
    Adil

  • Report Query returning "No Data Found" with bind variables

    I put a simple query into Report Query:
    Select "bluefish". "name" as "name",
    "bluefish"."primary_flag" as "primary_flag",
    "bluefish"."status" as "status",
    "bluefish"."ID" as "ID" from "bluefish" "bluefish" where "bluefish"."ID" = :P3_XPRINTID
    When I test the query, data is returned; however, when I try to run the query using "Test Report" button, I get an error 01403 No Data Found. If I replace the bind variable with an explicit value, the report works.
    Anyone have any ideas as to what is causing this problem? I am using the Generic Report Layout, with various output types. I AM editting the query and defining the bind variable before I test the report (otherwise, the query wouldn't run).
    Charles

    Sometimes if you create a form/report/whatever using the wizards, it will create an After Submit process called something like Reset Page - basically you want to make sure you don't have any After Submit processes that call a Clear Session state (it may say something like Clear Cache for Page).
    In your branch, there is also a box that says Clear Cache - you want to make sure that does not have page Number 8 in it or it will clear your session state.
    Put the page in Debug mode and read through it - check to make sure your value is getting saved and maybe you can see what is going wrong.

  • Problems with Database Link in query

    When I run this code:
    SELECT NVL2(wbs1.wbs1_seq, wbs1.wbs1, pcn.pron) AS pron
         , h.fy AS data_fy
    FROM pcn_list@THE_LINK pcn
         JOIN project@THE_LINK x
         ON x.pcn_seq = pcn.pcn_seq
         JOIN
           SELECT h.project_seq
                , EXTRACT(year FROM (h.data_dt + 92)) AS fy
           FROM pcn_data@THE_LINK h
                JOIN setup@THE_LINK
                ON (
                     setup.data_dt = h.data_dt
                     OR (
                          EXTRACT(year FROM h.data_dt) > DECODE(setup.site, 'TYAD', 2006, 2007)
                          AND h.data_dt < setup.data_dt
                          AND TO_CHAR(h.data_dt, 'MMDD') = '0930'
                     OR (
                          EXTRACT(year FROM h.data_dt) BETWEEN 2000 AND DECODE(setup.site, 'TYAD', 2006, 2007)
                          AND TO_CHAR(h.data_dt, 'MM') = '09'
                          AND h.data_dt = NEXT_DAY(LAST_DAY(h.data_dt) - 7, 'FRIDAY')
           WHERE h.data_dt BETWEEN '01-SEP-06' AND '31-OCT-08'
         ) h
         ON h.project_seq = x.project_seq
         LEFT JOIN wbs1_list@THE_LINK wbs1
         ON (
                wbs1.fiscal_yr = pcn.fiscal_yr
                AND (
                      wbs1.legacy_pron = pcn.pron
                      OR SUBSTR(wbs1.legacy_pron, 1, 2) || SUBSTR(wbs1.legacy_pron, 4) = pcn.pron
              OR (
                   TRIM(wbs1.legacy_pron) IS NULL
                   AND wbs1.wbs1 = SUBSTR(pcn.pron, 1, 2)
                                   || SUBSTR(TO_CHAR(wbs1.start_dt + 92, 'YY'), 1, 1)
                                   || SUBSTR(pcn.pron, 3, 1)
                                   || SUBSTR(pcn.mission, 1, 1)
                                   || SUBSTR(pcn.pron, 4, 5)
                                   || DECODE(
                                              SUBSTR(pcn.pron, 12, 1)
                                            , '0', SUBSTR(pcn.pron, 13, 2) || SUBSTR(pcn.pron, 13, 2)
                                            , SUBSTR(pcn.pron, 11, 4)
         LEFT JOIN xref_pron_command cmd1
         ON cmd1.command_cd = SUBSTR(pcn.pron, 11, 2)
         LEFT JOIN xref_pron_command cmd2
         ON cmd2.command_cd = SUBSTR(pcn.pron, 1, 2)
         LEFT JOIN mdms@THE_LINK mdms
         ON mdms.pron = SUBSTR(pcn.pron, 1, 8) || SUBSTR(pcn.pron, 11, 1)
         LEFT JOIN if_fedlog fedlog
         ON fedlog.fsc || fedlog.niin = SUBSTR(pcn.nsn, 1, 13)
         LEFT JOIN awpsammo@THE_LINK ammo
         ON ammo.pron = pcn.pron
         LEFT JOIN if_core_workload c
         ON (
              c.site = 'SITE'
              AND NVL2(wbs1.wbs1_seq, wbs1.wbs1, pcn.pron) = c.pron
              AND h.fy = c.data_fy
    WHERE pcn.mission != 'NOP'
    AND   x.pmc_cancel_fg = 'F'
    AND   NVL(wbs1.cancel_fg, 'F') = 'F'
    AND   NVL2(wbs1.wbs1_seq, wbs1.wpc, pcn.wpc) <> 'ZZ'I get:
    ORA-00904: "SETUP"."SITE": invalid identifier
    ORA-02063: preceding line from THE_LINK
    However, if I remove any of the cmd1, cmd2, fedlog, mdms, or ammo joins, it runs properly.
    It also runs properly if I remove both "WHERE h.data_dt BETWEEN '01-SEP-06' AND '31-OCT-08'" (line 25) and "AND x.pmc_cancel_fg = 'F'" (third line from the end).
    Also, there are three different external sites; the problems happen on two of them, but on a third, the code works as is.
    The query also works if:
    * I remove the links and run it directly on the external sites
    * I add something that makes it return no rows immediately (for example, "AND 0 = 1" as the last line)
    * "WHERE h.data_dt BETWEEN '01-SEP-06' AND '31-OCT-08'" is replaced by "WHERE h.data_dt = '30-SEP-09'" (which returns rows)
    * For that matter, at one of the problem sites, changing the first date in that WHERE clause to anything between '19-JUN-09' and '29-SEP-09' works, but '18-JUN-09' and earlier causes the error; at the other, the earliest working date is '02-NOV-08'.
    All three external databases, as well as the database on which this is run, are running 11.2.0.1.0 64-bit Production.
    Any ideas as to what is happening?

    sb92075 wrote:
    WHERE h.data_dt BETWEEN '01-SEP-06' AND '31-OCT-08'With Oracle characters between single quote marks are STRINGS!
    'This is a string, 2009-12-31, not a date'
    When a DATE datatype is desired, then use TO_DATE() function.Actually, usually I do (since there's no guarantee as to what the "default" date format will be - besides, the default tends to be 2-year dates). The one line where I don't is really just something I added to speed up the query when testing for the error.
    However changing that line to:
    WHERE h.data_dt BETWEEN TO_DATE('09/01/2006', 'MM/DD/YYYY') AND TO_DATE('10/31/2008', 'MM/DD/YYYY')causes the same results.

Maybe you are looking for