Merge the queries based on the conditional

Apex 4.2

I have a pretty complex question. I have a page that will have a selection list on the data entry form. The selection list contains a list of both 1) Active only or 2) active and inactive areas. We show the active areas when we create a new record (P101_ID IS NULL), we appear active and inactive sectors when you edit a record (P101_ID IS NOT NULL). I have therefore two separate queries to account for each case. Simple so far.

Problem I am seeing that create two lists of selection on the page and put a separate condition on each one (hiding one of selection lists depending on the case the ID IS NULL or the ID IS NOT NULL) does not work. So I was wondering if there was a way to combine queries for that to work based on a conditional statement. I did experiment with the instructions box and unions, etc., but my questions are a bit complicated. They are as follows:

LIST OF ASSETS SECTORS (P101_ID is NULL)

Select unique
ISEC.inspection_sector_name,
ISEC.inspection_sector_id
From
INSPECTION_SECTORS ISEC
left join HWE_INSPECTION_SCHEDULING SCH on ISEC.inspection_sector_id = SCH.inspection_sector_id
Where (ISEC.hurricane_protection_flag = :P157_IS_HURR and ISEC.river_protection_flag = :P157_IS_RIV) AND
ISEC.superseded_date is null AND
ISEC.commenced_date is not null AND
ISEC.inspection_sector_id not in (
Select ISEC.inspection_sectors_id
From INSPECTION_SECTORS ISEC
left join HWE_INSPECTION_SCHEDULING SCH on ISEC.inspection_sector_id = SCH.inspection_sector_id
Where SCH.high_water_event_id = :P157_high_water_event_id AND
SCH.inspection_date = :P157_inspection_date)
OR ISEC.inspection_sector_id = :P157_inspection_sector_id AND
ISEC.superseded_date is null
Order by inspection_sector_name

LIST ACTIVE AND INACTIVE SECTORS (P101_IS is NOT NULL)

Select inspection_sector_name, inspection_sector_id From (
Select ISEC.inspection_sector_name, ISEC.inspection_sector_id, '0' as this
From dual, INSPECTION_SECTORS ISEC
left join HWE_INSPECTION_SCHEDULING SCH on ISEC.inspection_sector_id = SCH.inspection_sector_id
Where (ISEC.hurricane_protection_flag = :p157_IS_HURR and ISEC.river_protection_flag = :P157_IS_RIV) AND
ISEC.superseded_date is null AND
ISEC.commenced_date is not null AND
ISEC.inspection_sector_id not in (
Select ISEC.inspection_sector_id
From inspection_sectors ISEC
left join HWE_INSPECTION_SCHEDULING SCH on ISEC.inspection_sector_id = SCH.inspection_sector_id
Where SCH.high_water_event_id = :P157_high_water_event_id AND
SCH.inspection_date = :P157_inspection_date)
OR ISEC.inspection_sector_id = :P157_inspection_sector_id AND ISEC.superseded_date is null
UNION
Select unique
ISEC.inspection_sector_name|| ' [CLOSED]', ISEC.inspection_sector_id, '1' as this
From dual, INSPECTION_SECTORS ISEC
left join HWE_INSPECTION_SCHEDULING SCH on ISEC.inspection_sector_id = SCH.inspection_sector_id
Where ISEC.superseded_date is not null and ISEC.commenced_date is not null AND
ISEC.river_protection_flag =:P157_IS_RIV and ISEC.hurricane_protection_flag = :P157_IS_HURR AND
ISEC.inspection_sector_id not in (
Select ISEC.inspection_sector_id
From INSPECTION SECTORS ISEC
left join HWE_INSPECTION_SCHEDULING SCH on ISEC.inspection_sector_id = SCH.inspection_sector_id
Where SCH.high_water_event_id = :P157_high_water_event_id AND
SCH.inspection_date = :P157_inspection_date)
OR ISEC.inspection_sector_id = :P157_inspection_sector_id NAD ISEC.superseded_date is not null
Order by this, inspection_sector_name asc

If the requests are quite complex. I tested the times and they work in APex, separately from the course. Forgive me if I have mispeled anything. But any help on this would be greatly appreciated. Thanks in advance.

Thank you for taking to your friend Frank. You are a bird-guy (my attempt at sarcasm). Nobody has questioned whether its knowledge base; more so in the way he responded to my original post did not «do» Like the people who come on this forum looking for help to those who have greater knowledge, it would be nice to be greeted a little more friendly, lol. Just my thoughts. But, feel free to correct my spelling test, grammar and syntax in my sentences so (the effort once again to emphasize that I misspelled 'AND', and that the request would not be performed--> of course... smh... you are funny)

Apparently I failed to explain the issue in its entirety. I should start by saying... "I have two separate petitions that I tested and already working and am looking to put on a list of selection (at the top) with a conditional execution statement one or the other, through the conditional statement, but again, I was looking for more so for syntax and structure." I'm sorry, I forgot to mention that.

Anyway, enough of this. I found a solution to my problem:

Within the Apex 4.2, you can have a list of selection as a page element. I want to display different results depending on whether Yes or no P101_ID is set to Null or NOT NULL

P101_ID is a primary key for a table.

P101_ID is not the exact name I use in my application / request however.

In addition, you don't need to include double; It's not make or break the query. Something that I forgot to omit them.

In addition, something along the lines of

Select inspection_sector_name, inspection_sector_id From (
.....all the stuff in query 1.......)
Where P101_ID is null
UNION
Select inspection_sector_name, inspection_sector_id From (
....all the stuff in query 2.....)
Where P101_ID is not null

will work on a selection list in the APex. So problem solved. Thank you for all your wonderful insight, of words and thoughts. Thank you.

Tags: Database

Similar Questions

  • Insert data into the same table based on certain conditions

    Hello. I'm new to this forum.
    I have to write a stored procedure to insert data in a table MYTABLE say, having a structure like:

    Col1 Col2 Col3... TotalInstallments CurrentInstallment PaidAmount MonthYear
    I have to insert all the data that it is in the same table (MYTABLE) except change some fields based on certain conditions:

    1. if PaidAmount > 0 & & CurrentInstallment < TotalInstallment then

    CurrentInstallment = CurrentInstallment + 1

    2. in the field MonthYear I have data ex. 01/2012, 11/2012 formate(month/year)...

    So, I have to insert data by incrementing the month and year. for example:

    If currentdata is 11/2012 next data will be 12/2012

    But following will be 01, 2013
    I have to select all records that belongs to the previous month (across the field MonthYear) and put the audit on each record selected and insert data and then turns them into table (MYTABLE) even.

    How to achieve that?

    Thank you.

    978184 wrote:
    Hello. I'm new to this forum.
    I have to write a stored procedure to insert data in a table MYTABLE say, having a structure like:

    Col1 Col2 Col3... TotalInstallments CurrentInstallment PaidAmount MonthYear
    I have to insert all the data that it is in the same table (MYTABLE) except change some fields based on certain conditions:

    1. if PaidAmount > 0 & CurrentInstallment

    CurrentInstallment = CurrentInstallment + 1

    2. in the field MonthYear I have data ex. 01/2012, 11/2012 formate(month/year)...

    So, I have to insert data by incrementing the month and year. for example:

    If currentdata is 11/2012 next data will be 12/2012

    But following will be 01, 2013
    I have to select all records that belongs to the previous month (across the field MonthYear) and put the audit & on each of the selected data record and insert then turns them into table (MYTABLE).

    You can do this way:

    This is not tested, but if you can provide the example of table structure and data (IN create table and insert scripts), it can be put to the test.

    insert into your_table
    (col1, col2, col3...current_installment, month_field)
    select col1, col2, col3..,
           current_installment +
           case when paidamount > 0 and current_installment < total_installment then
            row_number() over (
                                partition by column1, column2,.. columnn      -->You may choose partition if you want the
                                                                              --Increment of Current_installment to reset after particular combination ends
                                order by primary_key        -->Order the Increment, you may choose to add more columns to order by
                              )
          else
            0                                               --> if condition is not met, then Add 0
          end curr_installment,
          add_months(to_date(month_field, 'MM/YYYY'), 1) nxt_month
      from your_table;
    
  • How to enable or disable a paragraph based on a condition in the BIPS

    Hello reading,
    <? country? >
    How to display a line based on a condition in the DARK...
    I have a tag as a country that has the value zero or in India, I shouldn't show paragraph
    para should be included
    and also, I don't want the line below to access his location

    How can I do this...
    pls help

    I sent you the code to achieve this. Take a peek inside.

    Thank you
    BIPuser

  • delete records of the condition-based BAM data object

    Is it possible to delete files or data data object when any user defined condition occurs? This means that I have used the data object which consists of salary, I want to delete all data in the BAM data object when the salary is higher than 700000.

    Yes. You must create an alert in Active Studio which will remove based on this condition. Choose an event (each date interval starting at a specific date, at a specific time), and then select the action 'Clear data from a data object', choose your object data, and then add a filter for salary higher than 700000. Once the time comes it will remove the records.

    -Keith

  • Ignore the condition AVERAGEIF referenced cell is empty?

    I'm trying to run an AVERAGEIF function based on up to 3 sets of test values whose conditions are determined by the entries in cells referenced in the formula.

    Here is a picture of the table:

    Seminar, day and hour are the columns from the drop-down list. Registered average and average archived have AVERAGEIF formulas that use the data in the table another as test values that resolves as true when they correspond to data in the corresponding cells of the seminar, day and hour [example: IFERROR (AVERAGEIF (seminar, Schedule::Registered, $Topic, $A2, $Days, $B2, hourly seminars: $B, $C2),' ')]. This set works fine if I have all three of the cells in the columns of seminar, day and time information, but I would like to also see average which which do not take into account (i.e., what are the averages for what seminar is offered Monday, regardless of what time?). Is it possible to get these formulas to ignore the conditions that are left in white?

    Thank you!

    AVERAGEIF accept them * and? wildcard characters.  You could try to enter * in the Time column and see if your formula returns desired results.  Without seeing the data format in your time table of the seminars, however, it is difficult to know if you need to make other adjustments to make it work.

    For example, you use Date & time format of data?  If so, numbers actually stores a date and time, even if you have a cell that is formatted to display only the time. This can give results, that you are not pregnant if you do not have two cells showing that same time can be interpreted by the numbers as being different, because the part of associated of the date string date and hour is different.

    SG

  • I have created my version of Office Web site, but when I try to transfer them to the phone or Tablet setting it does not merge the info previously created on the desktop

    I have created my version of Office Web site, but when I try to transfer them to the phone or Tablet setting it does not merge the info previously created on the desktop

    Hello

    When you try to create a layout of desktop-based Tablet or phone you can get 3 options open to copy the layout of office. This do not understand the content placed in the pages.

    However, you can view each page individually and can copy the contact that you want to move the tablet or phone. then open the same presentation page of the Tablet/phone and use Edit > paste in Place then move and resize the elements according to the size of the layout.

    You can also take a look at the link below to better understand the available phone/tablet.

    Jam Muse: Designing for mobile devices in Muse - YouTube

    Please let me know if you need help for the same.

    Concerning

    Vivek

  • Display of the conditional field of Apex Oracle

    Hello

    I created two Wizard page in Oracle Apex.

    I have a table point and item_detail. For element1, I have a record of detail and item2, I have two detail record.

    Step 1: Choose the section that will fall to the bottom of the roll of the order of the day.

    On step 2: based on the record number of detail items, I want to display the text on step 2 fields. If item1 is selected in display 1 thenl, textdisplay1, and textfield1 to step 2 step. If item2 is not selected ' will display textfield1, textfield2 to step 2, textdisplay1, textdisplay2.

    SQL/pl/sql condition will be: select count (*) in the item_detail where item_id in (select item_id station where nom_element = 'provided to the step 1 "

    I want this dynamic ability to display fields or at least to hide textdisplay2, textfield2 based on condition of sql/plsql.

    Thank you

    Fields / display items (or hidden) by the result of the 'Condition' selection on the page field specification APEX / point. (You have all the tabs at the top: Identification, UI, grid, Label,..., Condition,...) Condition determines whether the field is displayed. Defaults to '-point not conditional ' but if you click on the drop-down menu, there are different conditions of 30-50. There are, there's NO..., never, always. If you select "PL/SQL function body returning a Boolean", it will add an Expression 1 box in the GUI where you can write a "starting...". End; "block to return TRUE or FALSE for the condition. It display if TRUE is returned, skins, if FALSE is returned. (Someone other chime in here if I missed something.)

    It is a VERY characteristic slick of APEX. The only addiitons I could ask would be: positive, negative and "do what I mean".

    Howard

  • Please, help me to by merging the same id assining people

    Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production
    Please help me
    We_addr_id defines the Address.
    We_pid     Defines the Person.
    
    i am planning to merge the same person together by assigining the same we_pid.
    WITH merge_names AS (SELECT   1000 We_pid,
                                  999898989 We_addr_id,
                                  'DONALD' first_name,
                                  'BOATRIGHT' last_name,
                                  'L' middle_name,
                                  NULL Suffix FROM DUAL
                                  UNION ALL
                                  SELECT   1001 We_pid,
                                  999898989 We_addr_id,
                                  'DONALD' first_name,
                                  'BOATRIGHT' last_name,
                                  'LARRY' middle_name,
                                  NULL Suffix
                           FROM   DUAL
                         UNION ALL
                         SELECT   1002 We_pid,
                                  999898989 We_addr_id,
                                  'DONALD' first_name,
                                  'BOATRIGHT' last_name,
                                  NULL middle_name,
                                  NULL Suffix
                           FROM   DUAL
                         UNION ALL
                         SELECT   33065 WE_PID,
                                  99000000 We_addr_id,
                                  'LUNA' First_name,
                                  'JOSE' last_name,
                                  NULL middle_name,
                                  NULL suffix
                           FROM   DUAL
                         UNION ALL
                         SELECT   8450527 WE_PID_LINK,
                                  99000000 We_addr_id,
                                  'LUNA' First_name,
                                  'JOSE' last_name,
                                  'A' middle_name,
                                  NULL suffix
                           FROM   DUAL
                         UNION ALL
                         SELECT   373453429 WE_PID_LINK,
                                  99000000 We_addr_id,
                                  'LUNA' First_name,
                                  'JOSE' last_name,
                                  NULL middle_name,
                                  NULL suffix
                           FROM   DUAL
                         UNION ALL
                         SELECT   442303062 WE_PID,
                                  99000000 We_addr_id,
                                  'LUNA' First_name,
                                  'JOSE' last_name,
                                  'S' middle_name,
                                  NULL suffix
                           FROM   DUAL
                         UNION ALL
                         SELECT   30088775765 WE_PID,
                                  990000878 We_addr_id,
                                  'BILL' last_name,
                                  'RAY' first_name,
                                  'M' middle_name,
                                  NULL SUFFIX
                           FROM   DUAL
                         UNION ALL
                         SELECT   30088775766 WE_PID,
                                  990000878 We_addr_id,
                                  'RAY' first_name,
                                  'BILL' last_name,
                                  NULL middle_name,
                                  NULL SUFFIX
                           FROM   DUAL
                         UNION ALL
                         SELECT   30088775767 WE_PID,
                                  990000878 We_addr_id,
                                  'RAY' first_name,
                                  'BILL' last_name,
                                  'MAX' middle_name,
                                  NULL SUFFIX
                           FROM   DUAL
                         UNION ALL
                         SELECT   30088775768 WE_PID,
                                  990000878 We_addr_id,
                                  'RAY' first_name,
                                  'BILL' last_name,
                                  'MICHEL' middle_name,
                                  NULL SUffix
                           FROM   DUAL
                         UNION ALL
                         SELECT   399998776 WE_PID,
                                  9901111 We_addr_id,
                                  'ELLISON' first_name,
                                  'LAWRANCE' last_name,
                                  NULL middle_name,
                                  NULL SUFFIX
                           FROM   DUAL
                         UNION ALL
                         SELECT   399998777 WE_PID,
                                  9901111 We_addr_id,
                                  'ELLISON' first_name,
                                  'LAWRANCE' last_name,
                                  'J' middle_name,
                                   'JR' SUFFIX
                           FROM   DUAL
                         UNION ALL
                         SELECT   399998778 WE_PID,
                                  9901111 We_addr_id,
                                  'ELLISON' first_name,
                                  'LAWRANCE' last_name,
                                  'JAMES' middle_name,
                                   'SR' SUFFIX
                           FROM   DUAL
                         UNION ALL
                         SELECT   399998779 WE_PID,
                                  9901111 We_addr_id,
                                  'ELLISON' first_name,
                                  'LAWRANCE' last_name,
                                  'JACK' middle_name,
                                  'JR' SUFFIX
                           FROM   DUAL)
    SELECT   *
      FROM   merge_names
      o/p Required
    
    WE_PID    WE_ADDR_ID        FIRST_NAME    LAST_NAME    MIDDLE_NAME    SUFFIX      MERGE_WEPID
    1000            999898989       DONALD    BOATRIGHT    L                          1000
    1001            999898989       DONALD    BOATRIGHT    LARRY                      1000
    1002            999898989       DONALD    BOATRIGHT                               1000
    33065           99000000        LUNA        JOSE                                  33065
    8450527         99000000        LUNA        JOSE       A                          8450527
    373453429       99000000        LUNA        JOSE                                  33065
    442303062       99000000        LUNA        JOSE       S                          442303062
    30088775765     990000878       BILL        RAY        M                          30088775765
    30088775766     990000878       RAY         BILL                                  30088775766
    30088775767     990000878       RAY         BILL       MAX                        30088775767
    30088775768     990000878       RAY         BILL       MICHEL                     30088775768
    399998776       9901111         ELLISON     LAWRANCE                              399998776 
    399998777       9901111         ELLISON     LAWRANCE    J        JR               399998777  
    399998778       9901111         ELLISON     LAWRANCE    JAMES    SR               399998778
    399998779       9901111         ELLISON     LAWRANCE    JACK     JR               399998777
    Thank you

    Hello

    Interesting problem!

    That's what you asked for:

    WITH    got_min_we_pid  AS
    (
         SELECT     merge_names.*
         ,     MIN (we_pid) OVER ( PARTITION BY  first_name
                                     ,                  last_name
                            ,            middle_name
                            ,            suffix
                            )     AS min_we_pid
         FROM    merge_names
    )
    ,     possible_matches       AS
    (
         SELECT     CONNECT_BY_ROOT min_we_pid     AS min_we_pid
         ,     we_pid                    AS leaf_we_pid
         FROM     got_min_we_pid
         WHERE     CONNECT_BY_ISLEAF  = 1
         START WITH   we_pid                = min_we_pid
         CONNECT BY   first_name             = PRIOR first_name
              AND  last_name                = PRIOR last_name
              AND  SUBSTR ( 'x' || middle_name
                       , 1
                       , LENGTH ('x' || PRIOR middle_name)
                       )                   = 'x' || PRIOR middle_name
              AND  'x' || middle_name    > 'x' || PRIOR middle_name
              AND  'x' || suffix        = 'x' || PRIOR suffix
    )
    ,     got_match_cnt     AS
    (
         SELECT DISTINCT
              min_we_pid
         ,     leaf_we_pid
         ,     COUNT (DISTINCT leaf_we_pid) OVER (PARTITION BY  min_we_pid)     AS match_cnt
         FROM     possible_matches
    )
    SELECT       c.*
    ,       NVL (p.leaf_we_pid, c.min_we_pid)     AS merge_wepid
    FROM              GOT_MIN_we_pid  c
    LEFT OUTER JOIN      got_match_cnt   p   ON  p.min_we_pid     = c.min_we_pid
                                      AND p.match_cnt     = 1
    ORDER BY  c.last_name
    ,            c.first_name
    ,       c.middle_name
    ;
    

    Here's how it works:
    First of all, we take care of the exact replica, by finding the we_pid lowest for each group defined by (first_name, last_name, middle_name, suffix). For example, the two lines for Jose Luna (no middle name) are assigned to the min_we_pid = 33065. It is this min_we_pid, not the original we_pid, that is used in all future operations.
    Then we are all names other names that are similar, but more comprehensive, using a CONNECT BY (subquery possible_matches) query. The parents in this query are stored with short middle_names, and children are lines that have first_name, last_name identical and suffix, but middle_names longer. I concatenated the x at the beginning of all middle_names for comparisons, to treat the NULL as being less at, but similar to something else. Is so, that we had a group of lines with identical names (and suffixes) with the exception of the middle_names, then
    NULL middle_name might be a parent got ', "DEB" and "DEBORAH",.
    A ' would be a parent of "DEB" and "DEBORAH", and
    "DEB" would be a parent of 'DEBORAH '.
    By following this chart until we find the lines that have no children, we may associate each short middle_name with the similar longer middle_name, or names. At this point, we will have "BILL RAY" as the ancestor of 'RAY MAX BILL' as well as "RAY MICHEL BILL". Here comes the following subquery, got_match_cnt. If notes how many descendants are associated with each ancesotor, in other words, how much longer names might match a name more runs. If this number is greater than 1, we do not consider one of the matches. That is why match_cnt = 1 is one of the join conditions in the main query, where each row in the theoriginale table is related to its more relative, when it exists, and if it is unique.

  • Merge the statement or Update SET =?

    Hi I have 3 tables: Agreement_line, nov_10 and nov_10_final.
    select CASE WHEN 
                 (select count(1)
                   from agreement_line
                   where policy_no = ff.policy_no
                   and ff.incident_date between cover_start_date and cover_end_date
                   and agr_line_no <> ff.agr_line_no
                   and product_line_id NOT IN ('MPA','INITF','JOINF','ONGNF','SRIA')
                   and trans_code <> 0
                   and cancel_code = 0
                   ) > 0 THEN 'Y' ELSE 'N' END Additional
    from nov_10 ff
    I'm trying to merge the above query nov_10_final as a new column entitled 'supplementary '.

    Nov_10_final is based on Nov_10 and has all of its columns and a few additional ones.

    If a merger does not work I can add a column called 'extra' to nov_10 which will follow up to nov_10_final and maybe use a complementary SET update =... .etc

    Nov_10_final and nov_10 can be attached on the so-called cla_case_no.
    There is also a policy_no in nov_10_final if that helps.
    All columns of Nov_10 must stay so I was thinking of a left join but I can't seem to do things.

    Any help would be appreciated.

    Banner:
    Oracle Database 11 g Release 11.2.0.2.0 - 64 bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    "CORE 11.2.0.2.0 Production."
    AMT for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production

    Something like that? (not tested):

    MERGE
    INTO  nov_10_final nf
    USING (SELECT ff.cla_case_no
           ,      CASE WHEN COUNT(al.policy_no) > 0 THEN 'Y' ELSE 'N' END additional
           FROM   nov_10         ff
           LEFT JOIN
                  agreement_line al
           ON     al.policy_no        = ff.policy_no
           AND    ff.incident_date   BETWEEN al.cover_start_date AND al.cover_end_date
           AND    al.agr_line_no     != ff.agr_line_no
           AND    al.product_line_id NOT IN ('MPA','INITF','JOINF','ONGNF','SRIA')
           AND    al.trans_code      !=0
           AND    al.cancel_code      = 0
           GROUP BY ff.cla_case_no) ff
    ON  (nf.cla_case_no = ff.cla_case_no)
    WHEN MATCHED THEN
     UPDATE
     SET    additional = ff.additional;
    

    An update statement should work too:

    UPDATE nov_10_final nf
    set additional = (SELECT CASE WHEN COUNT(al.policy_no) > 0 THEN 'Y' ELSE 'N' END additional
                      FROM   nov_10         ff
                      ,      agreement_line al
                      WHERE  al.policy_no        = ff.policy_no
                      AND    ff.incident_date   BETWEEN al.cover_start_date AND al.cover_end_date
                      AND    al.agr_line_no     != ff.agr_line_no
                      AND    al.product_line_id NOT IN ('MPA','INITF','JOINF','ONGNF','SRIA')
                      AND    al.trans_code      !=0
                      AND    al.cancel_code      = 0
                      AND    ff.cla_case_no      = nf.cla_case_no) ff;
    

    If all the lines of NOV_10 are in NOV_10_final do you still need her?

    UPDATE nov_10_final ff
    set additional = CASE WHEN
                     (SELECT CASE WHEN COUNT(al.policy_no)
                      FROM   agreement_line al
                      WHERE  al.policy_no        = ff.policy_no
                      AND    ff.incident_date   BETWEEN al.cover_start_date AND al.cover_end_date
                      AND    al.agr_line_no     != ff.agr_line_no
                      AND    al.product_line_id NOT IN ('MPA','INITF','JOINF','ONGNF','SRIA')
                      AND    al.trans_code      !=0
                      AND    al.cancel_code      = 0)
                     > 0 THEN 'Y' ELSE 'N' END;
    
  • How to write a select statement in which the condition?

    Hello Frs,

    Need help in the development of a discoverer report.

    My requirement is to write a query similar to this one

    Select * from emp is dept_no not in (select Department dept_no where emp_name like ' a % ;))

    Help, please.


    Thank you
    Rajesh

    Hello
    to do this exactly how you can do 1 of 3 things:
    1 use the Discoverer Desktop edition (most didn't do it) and use the sub query option you will find in the conditions.
    2. create a custom in the BA folder and create the report on the new custom folder
    3. create a view of db that contain your selection, and then create a folder in the BA based on this point of view and then create your report.

    Tamir

  • Is it possible to make the condition depending on the sql statements in the data models

    Hi all

    Is it possible to include the condition based on sql statements in the data models.

    For example
    if (some parameter is not null)
    <sqlstatement name="STATEMENT_1">
    ...
    </sqlstatement>
    else
    <sqlstatement name="STATEMENT_2">
    ...
    </sqlstatement>
    Is something like this? Also, the good doc is available for ' how to take full advantage of the "data models" in BI Publisher?

    Thank you
    -Sookie

    Hello Sookie,
    I couldn't find the time to get a data model of demonstration of work for you, but I'll try to explain.

    First, write a PL/SQL package. Make sure that you set all the parameters of model of data such as a global variable in the default PL/SQL package.

    CREATE OR REPLACE
    package as employee
    function BeforeReportTrigger return Boolean;
    query_text varchar (2000);
    number of p_DEPTNO;
    END;
    /

    CREATE OR REPLACE
    package as body employee
    function BeforeReportTrigger return Boolean IS
    Start

    IF (p_DEPTNO = 10) THEN
    query_text: = select col1, col2, col3 from HR.
    elsif (p_DEPTNO = 20) THEN
    query_text: = select col1, col2, col3 hr_history.
    on the other
    query_text: = select col1, col2, col3 hr_history1.
    end if;
    Returns true;
    end;
    /

    Use this package in the default package in your data model. Check the "defaultPackage ="employee"in the following data model header.

    Sample data model
    ------------------------------












    --
    --
    --
    --

    Before running the query SQL, data engine reads the "before the release of the report" and all the texte_requete argument based on the p_DeptNo value. When executing the Q1, engine sqlQuery analyze the query ' & quert_text and replace it with the actual value. For example if the p_deptno = 10, the query will be "select col1, col2, col3 from HR.

    Try it...

  • When you configure synchronization how sync manages information on two computers? It merges the information?

    When you configure synchronization how sync manages information on two computers? It merges the information?

    Hello!

    Yes, how Sync is that it brings together all the bookmarks and pushes them to all your devices. Same thing with the story.

    You will lose all the information in one of your computers.

  • OSX EL CAPITAN UPDATE CANNOT BE INSTALLED TO THIS DISK. THIS VOLUME DOES NOT MEET THE CONDITIONS FOR THIS UPDATE

    Hi all

    My iMac features are:

    • 27-inch, late 2013
    • 3.2 GHz Intel Core i5 processor
    • 8 GB 1600 MHz DDR3 memory
    • Start drive Macintosh HD
    • NVIDIA GeForce GT 1024Mo of 755M graphics
    • Storage: 301,35 free GB of 999,35 GB

    Running currently on OS X El Capitan with Update Version 10.11.3 installed January 27, 2016

    Problem: I was on the purchase of 2016 Office for Mac and tried to install the update of El Capitan OS X 10.11.1 which is necessary to solve the problems with this version of Microsoft Office.  During installation, the following error message appears:

    "OS X El Capitan update cannot be installed on this drive. This volume does not meet the conditions required for this update".

    I would be very happy if someone can help me in installing this update.

    Thank you.

    Slpm6

    I just got a quick reply saying 'You are not allowed to create or update this content'. What should I do to solve the problem? Thank you.

    You are using a newer version of El Capitan that the updater contains and so cannot install it.

    (139598)

  • What are effective ways to merge the duplicate in the iOS Contacts? I have thousands of duplicate contacts and mosta cases there are dozens of identical entries.

    Hello

    I've generated many Contacts duplicated in iOS and Mac OS X.

    In most cases the input Contact is copied dozens of times.

    I would like to remove n - 1 contacts identical and, if possible, merge the contacts with the same name + email address + telephone number.

    Can you recommend a few applications that are designed to accomplish these tasks?

    Can you suggest reasons why copies of contacts have been generated?

    Whatever the reason, copies can still be generated. Then, I also need to resolve the first cause.

    Thank you.

    You do not want to do it on your computer... not on a less recommended small device such as a phone.

  • How to merge the event structures?

    I have a program of VI script that reads a text file of records and displays a structure of the event.  It works very well because it creates all the controls and indicators I need associated with the defined registry and code backend (i.e. the structure of the event).

    After I generated all this code, I copy and paste in the main VI I develop.  Everything works very well.  The only problem is that there are 100 text files from separate registry.  This means that I end up with 100 separate event structures.  Although it works, it takes a lot of space and I prefer to combine them.  However, each event structure has anywhere from 15 to 75 entries, so to do this manually is not an option.

    Is it possible to selectively merge the event automatically structures?

    I guess I could write a labview scripting routine that could get a reference to the structure of the event in VI, then merge... but part of the problem there is that there are a handful of structures of event I want to separate them just because they are not associated with the set of registers, that I mentioned.


Maybe you are looking for

  • Restore the toolbars

    I lost my firefox toolbar (history, etc.) and my add on operate, how can I recover them thank you for your consideration and cooperation

  • My Sony Handycam DCR-TRV950 flashes a yellow icon, C:31:23 and will not record or play.

    A year ago, the camera suddenly started flashing and beeps a yellow icon in the middle of the screen. C:31:23 flashes in the upper right corner above the minutes from the end. The camcorder will not record or play. If I remove and reseat or change th

  • HP LaserJet M4345 MFP: Network printer problem: cannot print, but can ping

    Good evening I have a big problem. We have a network HP LaserJet M4345 MFP printer. It is connected to a switch and the switch is connected to a Modem of Telmex.  It has a static IP address. 5 computers to connect to this printer, but I'm going to us

  • Support rich text display?

    I'm trying to create a user interface for a list of the content of the micro-blog, and it would be on the grid to display several rich text line that has a few icons inside the lines of text. So far, I don't see a multiline label, I searched this for

  • Mobile Division of LR on Instagram

    HelloI would like to get rid of InstaSize when sharing formats such as 3:2 or 16:9 in Instagram.InstaSize creates a canvas to fit into elongation Instagram. Is it possible to do from mobile LR already?S7 edge 6.0.1LR 2.1.1 mobile