Report with the query with union and parameters

Hello

We have an obligation to create a report with the request, which is the union and parameters.

I intend to create a database for the report based on a query. But the problem here is that the way to pass parameters in the query.

Request is something like that

Select x.a, x.b, x.c
x
where x.year =: para1
and x.status = 'A '.
Union of all the
Select x.a, x.b, x.c
x
where x.year =: para1 - 1
and (x.status = 'c' and x.date =: para2 or x.status = 'I' and x.date < =: para2)

Here x.year in the first select statement must be equal to: para1 and second select statement, it should be: para - 1.

How this requirement can be achieved?

Client don't want to separate worksheet, a parameter and another for the actual data that I tried with sys_context and it worked. But the client wants the result in a single sheet only... So I need to change their approach.

Help, please.

Thank you

Hello
Another option is to convert the request so that you will have the items from the selection
for example on the query you provided that you can use:

Select 'Curr' rec_type, x.a, x.b, x.c, x.year, x.date, x.status
x
where x.status = "A".
Union of all the
Select 'Prev' rec_type, x.a, x.b, x.c, x.year, x.date, x.status
x
where x.status in ('c', 'I')

then, in the workbook, you will be able to create conditions such as:
rec_type = 'Curr' and year =: para1

rec_type = 'Prev' and year =: para1-1
rec_type = 'Prev' and (status = 'c' and date =: para2 or status = 'I' and date)<=>

Tamir

Tags: Business Intelligence

Similar Questions

  • Use the dynamic report with BI Publisher parameters

    Are there tips for reports in BI Publisher? For example, I would use the same report for one person or many people. This would mean that where clause should be added when it is for the individual and is not necessary for the entire population. I don't see a way to dynamically build the report using "Report queries" in the shared components.
    It is easy to build a sql query based on various selection criteria in the Source to a pagethat of the region then gets displayedd on the page but I don't see a lot of flexibility in creating a report with BI Publisher at the Apex.

    How about from the collections?

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Apress.com/9781430235125
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    http://www.Amazon.de/Oracle-Apex-XE-Praxis/DP/3826655494
    -------------------------------------------------------------------

  • Interactive report with checkbox and editable field

    Hello

    For a project I'm working on, I need to create an interactive report in Apex 3.2 with the ability to select rows and change one of the columns in the report.
    To do this, I started by adding these two fields at the request of my IR selection:

    CB apex_item. CheckBox (1, product_number)

    and

    apex_item. Text (2, QTY_TO_ORDER) QTY_TO_ORDER

    CB is the files checkbox and QTY_TO_ORDER is the editable field.

    It worked like a charm and I had my two fields in the report.
    To process the values, I've added this page process, which currently must store only the "product number" and the "QTY_TO_ORDER" fields in a table.

    BEGIN
    BECAUSE me in 1.APEX_APPLICATION. G_F01. Count LOOP
    insert into mytmptable values (APEX_APPLICATION. G_F01 (i), APEX_APPLICATION. G_F02 (i));
    END LOOP;
    commit;
    end;

    However, this does not work as I want it to work. When I check the boxes of the two rows, it will store two numbers of good product lines, but it will take the field QTY_TO_ORDER two albums from the table, regardless of who those are checked. I was able to solve this problem, by adding a rownum in the query and using the rownum as the value for the checkbox control. Because I still need that the areas of product_number and qty_to order I made them two text fields.

    I changed my page process of:

    BEGIN
    BECAUSE me in 1.APEX_APPLICATION. G_F01. Count LOOP
    insert into mytmptable values (APEX_APPLICATION. G_F02 (APEX_APPLICATION. G_F01 (i)),
    APEX_APPLICATION. G_F03 (APEX_APPLICATION. G_F01 (i)));
    END LOOP;
    commit;
    end;

    This seemed to solve the problem, and I have now received the good values in the table, unless I used in the report to sort... As soon as I've sorted the report in a different way from that of rownum, I had bad values in the table. The reason is of course that my insert simply selects the nth line in the table, and my rownums are not dynamic.

    I found a lot of examples on the internet using "#ROWNUM #" in the selection, which is expected to spawn a rownum in the report. It seems to work in normal report, but in interactive reports, literal values "#ROWNUM #" appears.

    Is it possible to fix this?

    Hello

    Try with 3 fields:

    CB apex_item. CheckBox (1, product_number).
    apex_item. Text (2, QTY_TO_ORDER) QTY_TO_ORDER,.
    prod_no apex_item. Hidden (3, product_number)

    The hidden field should be view as a hidden column.

    Then your process can be:

    BEGIN
    BECAUSE me in 1.APEX_APPLICATION. G_F01. Count LOOP
    J in 1.APEX_APPLICATION. G_F03. Count LOOP
    IF APEX_APPLICATION. G_F01 (i) = APEX_APPLICATION. G_F03 (j)) THEN
    insert into mytmptable values (APEX_APPLICATION. G_F01 (i), APEX_APPLICATION. G_F02 (j));
    "exit";
    END IF;
    END LOOP;
    END LOOP;

  • Help on report with max and group of?

    Hello I need to display the next report

    SELECT THE TABLE TABLE_NAME, NOM_PARTITION, LAST_ANALYZED IN USER_TAB_PARTITIONS;
    However, I need to display the table table_name time with sound (partition_name) MAX current (assuming that the names are P2010, P2011, etc...) and when he was last_analyzed

    What is the most effective way to do it? Subselect statement? Inner join?

    Thank you!

    Hello

    Using a GROUP BY:

    SELECT table_name,
           max(partition_name) as partition_name,
           max(last_analyzed) keep (dense_rank last order by partition_name) as last_analyzed
    FROM all_tab_partitions
    GROUP BY table_name
    ;
    

    Another solution would be a TOP - n query, using the ROW_NUMBER analytic function:

    SELECT table_name, partition_name, last_analyzed
    FROM (
      SELECT table_name,
             partition_name,
             last_analyzed ,
             row_number() over( partition by table_name
                                order by nlssort(partition_name,'NLS_SORT=BINARY') desc ) as rn
      FROM all_tab_partitions
    )
    WHERE rn = 1
    ;
    

    Note that I had to use the NLSSORT function to get the same result as the value that the query GROUP BY.
    Depending on your NLS DB/SESSION settings, you may not do.

    Edited by: odie_63 Feb 4. 2011 14:31

  • What is the limit on the query string / post / URL parameters?

    Is there a limitation on the url parameters sent in the post method?

    Thanks in advance.

    Chandra, I'm afraid that I don't know what you just said.

    URL parameters, as far as I know, are not encrypted even in an HTTPS Exchange, because they are considered as part of the URL, only not part of the message.  The body of the message (i.e. POST), on the other hand, it's protected.

    I suggest that you send the query parameters in JSON format, just as you could do it with AJAX.  It is a well designed and well understood Protocol with good support on the client and server side.  (XML is also the same.)  This will put the exchange of information in the body of the message (encrypted), and it also will allow you to send and receive information structured structs and lists and tables and so - on.

    You still need to be aware of the size of the messages, but not nearly as much with the URL string.

    Whenever you feel that you could be "pushing a limit", it is time to think that "there must be a better way to do it."

  • APEX export report rerun the query

    Hi all!

    Version-
    Oracle 11.2
    Apex 4.1

    We have a report of Apex that is generated by calling a function. When the report is displayed in the area, when you click Export to export to CSV, the query is executed again. The report should not be exported without rerunning the query?
    Y at - it all parameters must be configured to disable the query to new while exporting a report or it comes to APEX?

    Thanks in advance.

    -SS.

    Export a report is a separate application and it will get the requested data and create a CSV file out of it. Thus, the query will always to run once more. The report that you view on your page will always get only that number of lines to the customer as requested in the paging and the condition in your report can ask many more lines.

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Apress.com/9781430235125
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    http://www.Amazon.de/Oracle-Apex-XE-Praxis/DP/3826655494
    -------------------------------------------------------------------

  • need a report on the status of delivery and response for the beneficiaries of the capaign

    Hi, I need to make a report on the State status of response to the beneficiaries of the capaign and discount but cannot find them in the area of subject campaign or the subject of the campaign, any idea response area?
    Thank you

    Just the history of campaign response is the report you're looking for. The fields that you may find useful are.

    The response status - this shows the message open, click, disengagement etc.
    State of delivery - Hard bounce, soft bounce etc.

    To get more details on the above results add the following.

    Type of answer-, this will show the URL TO which the user has clicked a click where you have several followed links in an e-mail. It will also show the reason for hard bounces. This is important because not all hard bounces will trigger the 'Never Email' flag to check. This happens for emails with the statutes of rebound in wrong address.
    Just moved address or unknown address.

  • Helps the query using case and County

    Hello!

    I have problems with a small part of a query below that finally can settle the invoice price.

    (count (distinct spm97.sample_id) * 36.1) as "PROFILE."
    case count (distinct spm33.sample_id)
    When (count (distinct spm97.sample_id) = 0) then (count (distinct spm33.sample_id) * 26)
    another (count (distinct spm33.sample_id) * 4.75)
    put an end to 'CC ',.

    The first line works - 0 or 36.10 is returned depending on whether or not a profile has been ordered for the sample.

    The cost of CC is 4.75 if a profile was also sentenced, if it isn't then the cost is 26. The case statement is supposed to verify this and return the exact amount, but I can't make it work... I get the error message that a closing parenthesis is missing somewhere in the middle of line 3, if that helps.

    Any advice would be much appreciated! Of course, this isn't the entire query - joins and all are all working well, it's just this little section with the County that I can't just.

    Thank you

    JO

    the piece of code below, seems to me is incorrect

        CASE COUNT(DISTINCT spm33.sample_id)
            WHEN
                (
                    COUNT(DISTINCT spm97.sample_id) = 0
                )
            THEN (COUNT(DISTINCT spm33.sample_id) * 26)
            ELSE (COUNT(DISTINCT spm33.sample_id) * 4.75)
        END AS "CC"
    

    It seems that the requirement here is that if * 'COUNT (DISTINCT spm97.sample_id) = 0' *, then * "CC" * should be ' COUNT (DISTINCT spm33.sample_id) (* 26) "ELSE, it should be" COUNT (DISTINCT spm33.sample_id) (* 4.75)»
    If this is the case, the statement must include:

        CASE COUNT(DISTINCT spm97.sample_id)
            WHEN
                0
            THEN (COUNT(DISTINCT spm33.sample_id) * 26)
            ELSE (COUNT(DISTINCT spm33.sample_id) * 4.75)
        END AS "CC"
    
  • Reports of the counts of base and vcpu

    I'm sure it's easy enough, although the answer has escaped me and I have not really seen a script that quiet that I'm looking for. I'm trying to get the result of count basis by host with a sum of the vcpus placed in service in this topic. Basically something like that

    host1.whatever:

    Carrots: 16

    vCPUS: 64

    host2.whatever:

    Carrots: 12

    vCPUS: 45

    and so on.

    Try something like this

    Get-VMHost | Select Name, @{N="Cores";E={$_.ExtensionData.Summary.Hardware.NumCpuCores}}, @{N="vCPU";E={Get-VM -Location $_ | Measure-Object -Property NumCpu -Sum | select -ExpandProperty Sum}}
    
  • Why not include the tag Module syntax and parameters on the Page Tag Ko?

    Colombia-British team @.

    Tags - fast in the KB reference Page http://KB.worldsecuresystems.com/134/bc_1342.html seems to be the place that is authoritative for the tags. What is lacking is the Module about the syntax and available parameters (current version).

    Currently, we are obliged to try to assemble this information ourselves from multiple resources and this leads to obsolete or incomplete information, confusion and loss of productivity of your customers.

    I would like to see this added info and links back to each module page KB from here. Developers having to create their own documentation solutions to fill the gaps in the BC docs takes away from the time of construction sites and increase the sales. Instead of promoting other "partners" who build the subscription models filling your poor docs, you should invest in the documentation of quality for us all.

    What prevent you from adding this information to this already popular resource page? Is there a better solution?

    http://helpx.Adobe.com/business-catalyst/KB/modules-quick-reference.html

    The two joined the forums on the right landing page.

  • More than 1 SQL query with checkbox and error invalid number report

    Hi all

    I have two SQL query reports that each has an apex_item.checkbox and two processes for each report.  A report/process works very well.  It gives me an error of invalid number.

    In addition, another query SQL (editable report) gives me the following error when using the Multi line process, delete.

    ORA-06502: PL/SQL: digital or value error: character number conversion
    error ORA-06502: PL/SQL: digital or value error: character number conversion
    error
    Ok

    When I got a report from SQL query (with box and a process) and the query SQL (editable report) everything worked.  It stopped working when I added another SQL query report (with box and a process).

    A SQL query has the following in my query: apex_item.checkbox(3,email_id,'UNCHECKED') ""

    The other SQL query has the following: apex_item.checkbox(2,b.file_id,'UNCHECKED') ""

    Any help will be greatly appreciated,

    Sylvia

    Hi Reema,

    I've recreated the region and now it works!

    Thank you for this, looking at

    Sylvia

  • Structure of the query with parameters

    Hello
    Consume the web service, the results in a file xml with complex structures.
    The function below the structure of the query
    < TemplateName CcResultItems = "CgrInfo_1" >
    My question is how to reorganize the query to obtain the results of the structure
    < TemplateName CcResultItems = "CgrOwners_4" >
    which should return three rows.

    Kind regards
    Kostadin

    create or replace
    FUNCTION WS_SELECT_XML RETURN VARCHAR2 AS
    XML_VAR XMLTYPE: = XMLTYPE)
    "" ' < soap envelope: xmlns:soap = 'http://www.w3.org/2003/05/soap-envelope"" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" container = "http://www.w3.org/2001/XMLSchema" >. "
    < soap: Header >
    "< XmlSoapHeader xmlns ="https://test.wstestx.com/XWS2/ "/>"
    < / soap: Header >
    < soap: Body >
    "< ProcessRequestResponse xmlns ="https://test.wstestx.com/XWS2/">."
    < ProcessRequestResult > <! [CDATA [< CcResponse >

    < TemplateName CcResultItems = "CgrInfo_1" >
    < CcResultItem > < InfoMessage > < / InfoMessage > < IsitTerminated > 0 < / IsitTerminated > < IdObject > 365124 < / IdObject > < sanctuary ObjectlName > < / ObjectlName > < ObjectTaxNumber > 305089321502 < / ObjectTaxNumber > < / CcResultItem >
    < / CcResultItems >
    < TemplateName CcResultItems = "CgrUnits_2" >
    < / CcResultItems >
    < TemplateName CcResultItems = "CgrActors_3" >
    < CcResultItem > < IdObject > 365124 < / IdObject > < UnitNo > 0 < / UnitNo > < EntityTYPEcode > 1 < / EntityTYPEcode > < EntityTYPEdesc > person < / EntityTYPEdesc > < / CcResultItem >
    < / CcResultItems >
    < TemplateName CcResultItems = "CgrOwners_4" >
    < CcResultItem > < IdObject > 365124 < / IdObject > < EntityTYPEcode > 1 < / EntityTYPEcode > < EntityTYPEdesc > person < / EntityTYPEdesc > < OwnerID > 610697843014 < / OwnerID > < OwnerName > ALEX < / OwnerName > < / CcResultItem >
    < CcResultItem > < IdObject > 365124 < / IdObject > < EntityTYPEcode > 1 < / EntityTYPEcode > < EntityTYPEdesc > person < / EntityTYPEdesc > < OwnerID > 840645947005 < / OwnerID > < OwnerName > JOHN < / OwnerName > < / CcResultItem >
    < CcResultItem > < IdObject > 365124 < / IdObject > < EntityTYPEcode > 2 < / EntityTYPEcode > < company EntityTYPEdesc > < / EntityTYPEdesc > < OwnerID > 703454 < / OwnerID > < OwnerName > BROWN < / OwnerName > < / CcResultItem >
    < / CcResultItems >
    < TemplateName CcResultItems = "CgrActivities_5" >
    < / CcResultItems >
    < TemplateName CcResultItems = "CgrMembership_6" >
    < / CcResultItems >
    < TemplateName CcResultItems = "CgrFounding_7" >
    < CcResultItem > < IdObject > 365124 < / IdObject > < FoundingDate > 2007-08-16 13:53 < / FoundingDate > < Total > 146701.00 < / Total > < / CcResultItem >
    < / CcResultItems >
    [[< / CcResponse >]] > < / ProcessRequestResult >
    < / ProcessRequestResponse >
    < / soap: Body >
    < / envelope soap: >
    ');
    BEGIN
    FOR R IN)
    WITH T AS (SELECT (XML_VAR) DOUBLE COLLAR)
    SELECT x2.*
    FROM XMLTable)
    XMLNamespaces)
                ' http://www.w3.org/2003/05/soap-envelope ' LIKE 'SOAP'
    , by default ' https://test.wstestx.com/XWS2/ '
    )
    , ': soap envelope / soap: Body/ProcessRequestResponse/ProcessRequestResult '
    by the way XML_VAR
    path of CcResponse clob columns '.'
    ) x 1
    XMLTABLE)
    ' / CcResponse/CcResultItems.
    XMLPARSE PASSAGE (DOCUMENT X 1.) CCRESPONSE)
    COLUMNS
    TemplateName VARCHAR2 (140) path "@TemplateName"
    , IDOBJECT VARCHAR2 (140) PATH "CcResultItem/IdObject.
    , PATH of VARCHAR2 (340) OBJECTLNAME ' CcResultItem/ObjectlName '.

    , PATH of VARCHAR2 (140) VRSKA 'CcResultItem '.
    ) X 2
    WHERE X 2. TemplateName = "CgrInfo_1."
    -WHERE X 2. TemplateName = "CgrActors_3."
    -WHERE X 2. TemplateName = "CgrOwners_4."
    ) LOOP
    DBMS_OUTPUT. Put_line (' IdObject: ' |) R.IDOBJECT |  ' ObjectlName: ' | R.ObjectlName | "TemplateName ' |" R.TemplateName);
    END LOOP;
    DBMS_OUTPUT. Put_line ("- end -");
    RETURNS A NULL VALUE.
    END WS_SELECT_XML;

    Based on your query, I'll assume that you started with

    Extract data from webservice response

    In my opinion, it comes of the change you are looking for

    FOR R IN (
       SELECT x2.TemplateName, x3.idobject, x3.OWNERID
          FROM XMLTable(
                 XMLNamespaces(
                   'http://www.w3.org/2003/05/soap-envelope' AS "soap"
                 , default 'https://test.wstestx.com/XWS2/'
                 )
               , 'soap:Envelope/soap:Body/ProcessRequestResponse/ProcessRequestResult'
                 passing XML_VAR
                 columns
                 CcResponse clob path '.'
               ) x1
          , XMLTABLE(
              '/CcResponse/CcResultItems[@TemplateName="CgrOwners_4"]'
              PASSING XMLPARSE(DOCUMENT X1.CCRESPONSE)
              COLUMNS
                      TemplateName  VARCHAR2(20) PATH '@TemplateName'
                    , ItemXML       XMLTYPE       PATH 'CcResultItem'
            ) X2
          , XMLTABLE(
              '/CcResultItem'
              PASSING x2.itemXML
              COLUMNS
                      IDOBJECT      VARCHAR2(20) PATH 'IdObject'
                    , OWNERID       VARCHAR2(20) PATH 'OwnerID'
            ) X3
    )
    

    As Odie post pointed out.  The first (x 1) XMLTable retrieves the content of ProcessRequestRequest and by doing this, delete the CDATA tag.  We now have a CLOB that resembles XML.  The second XMLTable (x 2) converts this CLOB into an XMLType and looking for the node that matches the XPath expression.  It's where I've hardcoded in your query to search for a specific node.  As you want node has a repeated structure that you want to retrieve each row, I spent structures repeatedly in the third XMLTable (x 3) so he could analyze.  You could combine x 2 and x 3 using XQuery, but I suggest starting by this method I found that it's easier to understand what is happening.

    To test out your code, simply replace the line

    by the way XML_VAR

    with

    from XMLTYPE ("... the content of the SOAP Message...")

    and run the query.  You can do this to debug the query as you and just do a SELECT * to see what all went from XMLTable to XMLTable, so went to check the correct data.

  • Interactive report with display of the icon to set the page element

    Hi all

    I am currently using Apex 4.2.4, I have an interactive report using icons, each icon has a link to another page but a few I want to set a value in a page hidden in the same page element which is then used as a variable for a classic report.

    I have this work via link href in the icon as f? p ='|| FA.page |': 1 :'|| : app_session |': P10_ID_ITEM :'|| FA.link_name without error.

    My problem is that I wanted to put the value of the element without using a link href that I could handle the clicked icon to change the background color so that the user can have a Visual representation, where it was clicked, then using the value of the page item appears the classic report in another region with a partial refresh.

    Any help is appreciated, thanks.

    Can you provide a detailed explanation of the purpose of this report and the logic used in the report query? What are the rules to control which icons appear in the IR, what icons link to the second report on the page of IR, and icons to link to separate pages?

    For me, the report query seems too complicated and inefficient by returning the data it does, and if another level of data is added to the hierarchy or more data is added to the second level, it fails with:

    ORA-01427: einreihig subquery returns multiple rows

    I'm guessing that the intent is that the IR displays only the icons at the top level of the hierarchy and icons for posting a link to a different page when they have no descendants, or to display the related lines in the secondary report below the IR when they do. I created a new page with the report query modified to a route of tree and keep the upper level lines. It is much more effective than the original query and simplifies the logic necessary for the verification of end-nodes. Instead of generating a URL link (which violates the separation of concerns), the query returns of the discrete values that can be used to implement the HTML link in the Icon View link Custom property:

    with icon_tree as (
          select
              ic.id_icon
            , ic.icon_name
            , ic.link_name
            , nullif(connect_by_isleaf, 1) is_parent
            , level depth
          from
              icons ic
                connect by
                    prior ic.link_name = ic.id_parent
                start with
                    ic.id_parent is null)
    select
        id_icon
      , icon_name
      , link_name
      , apex_util.get_blob_file_src('P10_ICON_IMAGE', id_icon) img_src
      , nvl2(is_parent, '586', link_name) target
      , nvl2(is_parent, 'P586_ID_PARENT', null) parent_item
      , nvl2(is_parent, link_name, null) parent_id
      , :app_id app_id
      , :app_session app_session
      , :debug debug
    from
        icon_tree
    where
        depth = 1
    

    In the interactive report, Use Custom Icon Link is set to Yes, and the custom link is:

    
      
      
    #ICON_NAME#

    Public static ID icons and results are applied to the IR and the regions second report respectively for use as selectors in action dynamics and CSS. The protected value property for the page P586_ID_PARENT element must be set to No for the value can be defined by a dynamic action.

    Dynamic action with several real actions is needed to bind alternatives click behavior to the links on the icons that have descendants (i.e. where the data-parent-id attribute has a value):

    Event: Click

    Selection type: jQuery Selector

    jQuery Selector:.apexir_WORKSHEET_ICONS a:not([data-parent-id=""])

    Real Actions

    Seq: 10

    Action: Delete the class

    Class:selected

    Selection type: jQuery Selector

    jQuery Selector:.apexir_WORKSHEET_ICONS a

    Seq: 20

    Action: Add the class

    Class:selected

    Selection type: trigger element

    Seq: 30

    Action: Set value

    Wait for result: Yes

    Type of value: Expression of JavaScript

    JavaScript expression:$(this.triggeringElement).attr('data-parent-id')

    Selection type: Agenda

    Point: P586_ID_PARENT

    Seq: 40

    Action: Discount

    Selection type: Region

    Region: results

    Seq:50

    Action: Show

    Selection type: Region

    Region: results

    Seq: 60

    Action: Cancel event

    Finally, add a style sheet to the Inline CSS property page. Initially, this hides the secondary report and select the parent clicked icon:

    #results {
      display: none;
    }
    #icons .apexir_WORKSHEET_ICONS a {
      border: 1px solid transparent;
      border-radius: 3px;
      padding: 0.8em 0 0.5em;
    }
      #icons .apexir_WORKSHEET_ICONS a.selected {
        border-color: #6a9cda;
        background-color: #bbd1ec;
        transition: 0.6s;
      }
    

    However, after all it is the question of why you use an interactive report here if you turned off all the features of the IR? A dynamic list with a custom template box seems to be more applicable?

  • Reg: Query with UNION

    Dear all,

    I have two tables

    TABLE A (A_DATE, COLA1, COLA2)

    TABLE B (B_DATE)

    A_DATE = B_DATE

    Examples of tables:

    TABLE A (11 selected lines)

    A_DATE COLA1 COLA2
    03/01/201354VAL76
    04/01/201311VAL78
    04/01/201311VAL22
    04/01/201374VAL22
    04/02/201315VAL45
    04/02/201311VAL22
    04/03/201344VAL22
    04/03/201371VAL73
    04/04/201399VAL13
    04/05/201311VAL22
    04/05/201311VAL23

    TABLE B (01 April-30 April)

    B_DATE
    04/01/2013
    04/02/2013
    04/03/2013
    04/04/2013

    (condition 1: month: April)

    AND

    condition 2: CALA1-> 11

    AND

    condition 3: COLA2-> VAL22)

    I need to display all records for the months April to TABLE A,.

    If the documents are not present in TABLE A for every 30 days, I need to display null, by reading DATE information in TABLE B

    Expected results (sample)

    Date COLA1 COLA2
    04/01/201311VAL22
    04/02/201311VAL22
    04/03/2013
    04/04/2013
    04/05/201311VAL22

    Currently I have the following query

    Select A_DATE, COLA1, COLA2 from TABLEA

    where COLA1 = 11 and COLA2 in ('VAL22') and A_DATE between ' 2013-04-01 00:00:00.0' AND ' 00:00:00.0' 2013-04-30

    Union of all the

    Select B_DATE, null, null from TABLEB if date between ' 2013 - 04 - 01 00:00:00.0' AND ' 00:00:00.0' 2013-04-30

    But I'm the duplicate records for the values in TABLE a.

    Output current (sample)

    Date COLA1 COLA2
    04/01/201311VAL22
    04/01/2013
    04/02/201311VAL22
    04/02/2013
    04/03/2013
    04/04/2013
    04/05/201311VAL22
    04/05/2013

    I tried with UNION and UNION ALL, but getting the same result.

    Hello

    Try this:

    Select b.B_DATE, a, COLA1, one, COLA2

    from TABLEB b

    the left join TABLEA a

    On a.A_DATE = b.B_DATE

    and COLA1 = 11

    and COLA2 in ('VAL22')

    where B_DATE between to_date('2013-04-01','yyyy-mm-dd') AND to_date('2013-04-30','yyyy-mm-dd')

    ----

    Ramin Hashimzade

  • Using a control of the chain with the Enter key, return * and * allowing repeated identical entry

    Hi all

    There must be a simple solution for this, but it's Friday afternoon, and my brain is not cooperating.

    I create a simple terminal through which a user can interact with an instrument. My question is about the only query string control. The button send and the Terminal Table are here for reference.

    Here is my desired behavior:

    (a) the user types a command in the field of the query, tape input or return. An event is triggered, and the request is sent to the instrument. The focus remains on the field in the query.

    (b) with any other action the interface user, the user types Enter or return again and again, by triggering an event that sends the request to the instrument every time Enter or return is typed. The focus remains on the field in the query.

    Here's what I have:

    This allows for one), but fails to b). The reason is, because the value of the field in the query has not changed, change value event does not fire when the user starts to spam keys enter or return. There is a way around this, as suggested by this post. Here is the solution in a few words:

    Instead of looking for the change in the value of the query command, the event fires for each key event to the bottom of the control and resembles a pressure of enter key or return. What attracts the user action, even if the content of the field of the request have not changed. The problem with this approach is that, when this event fires, I need to read the value of the query string order and send it to the instrument, but the value I get via the local Variable query is the old value, probably because the key down event fires before the value of query is saved as changed. Is there a way to programatically "enter" the contents of the control channel so it is recorded as a change in value, until I have the question via a local Variable? Is there a different way I should go about it? I'd rather not do anything that bound the input keys or return to this particular area, since I have many other UI elements that need these keys in my program.

    If not, is there a way to make the control of the fire 'Change of value' query string event when the user presses enter or return even if the value has not changed?

    Thank you for your comments!

    I thought about it.

    (1) control of the string (query) a value of update while typing.

    (2) save the key event down to the control of the chain. If the entry or return was pressed, send the state machine to the State 'send request '.

    (3) in the application 'send' State read control channel via the local Variable value.

    This is the desired behavior to allow the user repeatedly hit entry or return to regularly send a command, and the user can also type in a new order and send it by pressing enter or return.

    Thanks to all who have helped me this something to think about!

Maybe you are looking for

  • Premiere page do not disappear after the first run

    I just installed the latest firefox (9.0.1) and as usual, the first immediate window rises, explaining my rights etc. It is fine and normal. My problem is that no matter how many times I reboot my computer or browser, this first run page does NOT go

  • HPDM: HPDM can't see any of my thin clients

    A few months ago, I set up a server HPDM on Win 2012r2 and light HP 12, mainly mt245 clients. I could see all the thin clients with HPDM, I even used it for the Image of each of them. Yesterday, I went to add a new abd mt245 the image. All TCs went f

  • How can I change my default search engine in firefox 4?

    At the present time, my search engine is powered by Babylon... He got installed with a download manager.

  • Satellite L300D - upgrade Windows 7 32 bit

    Can someone point me in the right direction please. I want to upgrade my L300D Vista 32 bit to Windows 7 32 bit. Are there guidelines in these forums?

  • Cannot read the data in FPGA

    Hi guys, I have a code I developed for playback of digital data through a PXI-7813R digital lines. But unfortnately, in vi of the host, I can't acquire all data, even if I have enough to an external signal to digital line in PXI via a connector. I ha