Need to execute the query twice in order to get results

I have a query in which I need to run twice in a row to obtain results. The first round returns no value and each race after which returns lines expected.

Any ideas?

Champion wrote:
I have a query in which I need to run twice in a row to obtain results. The first round returns no value and each race after which returns lines expected.

Any ideas?

Well, when I run a query through TOAD, SQL or SQL Developer *, it results the first time.

So what you do differently? Or are we supposed to guess forever?

{message: id = 9360002}

Tags: Database

Similar Questions

  • How to implement enter and execute the query in the ADF

    I'm new to ADF and I'm trying to create a simple data entry in ADF 11 g based on a database table. I'm looking to implement the equivalent of the request function enter and execute the query in Oracle Forms. I tried the default operations that are available with the data controls. But they don't seem to have this feature. Can someone help / tell me how this can be implemented.

    Thank you
    Srini.

    How to add a query Panel? Who has the most benefits that the use of Find.

    More info on af:query

    http://docs.Oracle.com/CD/E28389_01/apirefs.1111/e12419/tagdoc/af_query.html

    Arun-

  • Extend the VO - need to change the query of VO - screen is off

    {Re-post the message in this forum (thanks to John Stegeman to lead me here...)   {Posted: August 28, 2009 04:27}

    Dear all,

    Thanks to this great body of knowledge, I ask my questions.

    I need to extend a VO to display the name of the country.
    The column is not in the VO. So, I need to get another table: FndTerritories

    I want to change the query, but the request frame is turned off (in the wizard the View - step 5 of 6 - Generated statement object substitution)

    Could you be it someone please let me know: how to change the application of the VO in this case?

    OR is there another solution for such cases, to maintain development standards

    Thank you very much

    Kind regards

    Hello

    I think that's when you just have to add an attribute, you should not click the expert mode checkbox... make use of
    Mix and add the button.

    But when you need to modify the query, and then we want to use to modify the query window...

    Thank you
    Gerard

  • Need help with the query to get the County

    Hello

    Oracle 10 g 2 10.2.0.3 - 64 bit

    I want back the number of accounts with two different types of funds (say A and B). Some accounts hold only one of the two funds, and some support both. I want to get the counts like this:

    • account held funds - has only
    • accounts holding funds-B only
    • accounts holding the Fund-A and B funds

    Here is what I started with but need assistance to meet the requirement above:

    select 
    count(distinct acct.bkoff_acct_no ) accounts_holding_fund_A
    from xe_account acct,
            xec_tal_investment_mandate iman,
            xec_tal_asset_allocation alloc,
            xe_benchmark bmark,
            xe_benchmark_usage bu,
            xe_object_description xod,
            xec_asset_class cls
    where iman.mandate_status_cd='A'
    and cls.asset_class_cd = alloc.asset_class_cd
    and iman.mandate_id = alloc.mandate_id
    and acct.account_id = iman.object_id
    and iman.object_type_cd = 'ACCT'
    and iman.mandate_id = xod.object_id
    and xod.field_nm='XEC_TAL_INVESTMENT_MANDATE.COMMENT_TXT'
    and xod.language_cd = 'E'
    and acct.acct_status_cd = 'O'
    and bu.object_type_cd(+) = 'TMAA'
    and bu.object_id(+) = alloc.asset_allocation_id
    and bmark.benchmark_id(+) = bu.benchmark_id
    and alloc.resp_txt like '%fund-A%'
    
    
    

    And suppose that the Fund-B has resp_txt like ' % of Fund-B»

    Please suggest.

    Concerning

    Hello

    Here is another way, it is easier to adapt to different jobs and different numbers of jobs:

    WITH got_distinct_jobs AS

    (

    SELECT DISTINCT deptno, job

    FROM scott.emp

    WHERE job IN ("ANALYST", "CLERKS") - or what

    )

    got_job_list AS

    (

    SELECT LISTAGG (job, ",") THE Group (ORDER BY work) AS job_list

    OF got_distinct_jobs

    GROUP BY deptno

    )

    SELECT job_list

    COUNT (*) AS num_departments

    OF got_job_list

    GROUP BY job_list

    ;

    This shows all the combinations of the jobs listed in the WHERE clause of got_distinct_jobs.  You don't need to change anything else in the query.  There may be any number of jobs.

    Output:

    JOB_LIST NUM_DEPARTMENTS

    ------------------------------ ---------------

    CLERK                                        2

    ANALYST, CLERK 1

  • Need help with the query (transpose)

    Hello experts, please help here - 11 g Oracle, attribute APA APB are fixed values and can be hard coded in query

    Need to transpose these data. Max(decode.. perd les données en sortie à cause de la condition de Max.)

    Entry:

    Name | Attribute | Value

    A1 APP 10

    A1 PDB 11

    A1 APA 20

    A1 PDB 21

    A2 BPA 13

    A2 BPB 14

    Expected results:

    Name AttVal1 AttVal2

    A1 10 11

    13 14 A2

    20 21 A1

    Hello

    Here's one way:

    WITH relevant_columns AS

    (

    SELECT name

    value

    CASE

    WHEN the attribute ("APA", "BPA") THEN 1

    WHEN the attribute ("PDB", "BPB") THEN 2

    END AS c_num

    ROW_NUMBER () (PARTITION BY NAME, attirbute

    Value of ORDER BY

    ) AS r_num

    FROM table_x

    )

    SELECT name, attval1, attval2

    OF relevant_columns

    PIVOT (MAX (value)

    FOR c_num IN (1 AS attval1

    2 UNDER attval2

    )

    )

    ORDER BY r_num, name

    ;

    If you would care to post CREATE TABLE and INSERT statements for your sample data, and then I could test this.

    Why do you want to

    NAME ATTVAL1 ATTVAL2

    ----  -------  -------

    A1 10 11

    20 21 A1

    in the results, rather than

    NAME ATTVAL1 ATTVAL2

    ----  -------  -------

    10 21 A1

    20 11-A1

    ?  You would be satisfied to one or the other?

    Depending on your answer, you may need to modify the analytical ORDER BY clause in the ROW_NUMBER function.

  • Need help with the query. Help, please

    Hey everyone, need your help.  Thank you in advance.  In my view, there is function Pivot.  Just do not know how to use this function.  I have the query that works.  The result is:

    11-111-1111 Vlad 16505 01/04/2013 5 August 13 dental plan pre-tax amount 29,65

    11-111-1111 Vlad 16505 01/04/2013 dental pre-tax 5 August 13 Plan level EE + SP

    11-111-1111 16505 Vlad 01/04/2013 5 August 13 pre-tax Option TOP dental plan

    11-111-1111 Vlad 16505 01/04/2013 5 August 13 pre-tax dental care plan pay the value

    11-111-1111 16505 Vlad 01/04/2013 dental pre-tax 5 August 13 Plan period Type

    11-111-1111 Vlad 16505 01/04/2013 amount pre-tax medical Plan of 5 August 13 149

    11-111-1111 Vlad 16505 01/04/2013 5 August 13 pre-tax Medical Plan level EE + SP

    11-111-1111 Vlad 16505 01/04/2013 5 August 13 pre-tax Plan medical Option MED

    11-111-1111 Vlad 16505 01/04/2013 5 August 13 plan pre-tax pay value

    11-111-1111 16505 Vlad 01/04/2013 5 August 13 pre-tax Medical Plan period Type

    11-111-1111 Vlad 16505 01/04/2013 5 August 13 pre-tax Plan PPO medical Plan

    11-111-1111 Vlad 16505 01/04/2013 5 August 13 Vision Plan amount 5.94 pre-tax

    But I need the result to be

    Amount of SSN ID name item level Option PayValue period Type

    11-111-1111 Vlad 16505 01/04/2013 null null high of 5 August 13 pre-tax Dental Plan 29,65 EE + SP

    11-111-1111 Vlad 16505 01/04/2013 null null MED 5 August 13 149 medical plan pre-tax EE + SP

    11-111-1111 Vlad 16505 01/04/2013 Vision Plan before taxes of 5 August 13

    Select distinct
    ' 11-111-1111 "as ssn,
    WOMEN'S WEAR. Employee_number,
    "Vlad" as EMPLOYEE_FULL_NAME,
    TO_CHAR (papf.start_date, "MM/DD/YYYY") as Date_Of_Hire
    a.effective_start_date,
    PETF.element_name,
    pivf. Name,
    peevf.screen_entry_value

    Of
    PER_all_PEOPLE_F women's wear
    per_assignments_f A
    pay_element_types_f petf
    pay_element_links_f pelf
    PAY_ELEMENT_ENTRIES_F penf
    PAY_ELEMENT_ENTRY_VALUES_F peevf
    pay_input_values_f pivf
    WHERE
    PETF.element_name ('Dental Plan before taxes', 'Medical Plan before taxes', "Vision Plan before taxes")
    and petf. ELEMENT_TYPE_ID = pelf. ELEMENT_TYPE_ID
    and (trunc (sysdate) BETWEEN pelf. EFFECTIVE_START_DATE AND pelf. EFFECTIVE_END_DATE)
    and (pelf. ELEMENT_LINK_ID = penf. ELEMENT_LINK_ID and a.assignment_id = penf. ASSIGNMENT_ID)
    and (trunc (sysdate) BETWEEN penf. EFFECTIVE_START_DATE AND penf. EFFECTIVE_END_DATE)
    and penf. ELEMENT_ENTRY_ID = peevf. ELEMENT_ENTRY_ID
    and peevf. INPUT_VALUE_ID = pivf. INPUT_VALUE_ID
    AND papf.employee_number IS NOT NULL
    AND A.assignment_type = 'E '.
    AND A.person_id = papf.person_id
    and papf.effective_end_date > sysdate
    and a.effective_end_date > sysdate
    and (trunc (sysdate) BETWEEN women's wear. EFFECTIVE_START_DATE AND women's wear. EFFECTIVE_END_DATE)
    and a.effective_start_date = (select MAX (effective_start_date) from PER_ASSIGNMENTS_f where assignment_id = a.assignment_id)
    and a.assignment_id = 42643
    and a.assignment_status_type_id = '1'
    order of petf.element_name;

    Change with your query

    SELECT * FROM (select distinct)

    ' 11-111-1111 "as ssn,

    WOMEN'S WEAR. Employee_number,

    "Vlad" as employee_full_name,

    TO_CHAR (papf.start_date, "MM/DD/YYYY") as date_of_hire

    a.effective_start_date,

    PETF.element_name,

    pivf. Name,

    peevf.screen_entry_value

    Of

    PER_all_PEOPLE_F women's wear

    per_assignments_f A

    pay_element_types_f petf

    pay_element_links_f pelf

    PAY_ELEMENT_ENTRIES_F penf

    PAY_ELEMENT_ENTRY_VALUES_F peevf

    pay_input_values_f pivf

    WHERE

    PETF.element_name ('Dental Plan before taxes', 'Medical Plan before taxes', "Vision Plan before taxes")

    and petf. ELEMENT_TYPE_ID = pelf. ELEMENT_TYPE_ID

    and (trunc (sysdate) BETWEEN pelf. EFFECTIVE_START_DATE AND pelf. EFFECTIVE_END_DATE)

    and (pelf. ELEMENT_LINK_ID = penf. ELEMENT_LINK_ID and a.assignment_id = penf. ASSIGNMENT_ID)

    and (trunc (sysdate) BETWEEN penf. EFFECTIVE_START_DATE AND penf. EFFECTIVE_END_DATE)

    and penf. ELEMENT_ENTRY_ID = peevf. ELEMENT_ENTRY_ID

    and peevf. INPUT_VALUE_ID = pivf. INPUT_VALUE_ID

    AND papf.employee_number IS NOT NULL

    AND A.assignment_type = 'E '.

    AND A.person_id = papf.person_id

    and papf.effective_end_date > sysdate

    and a.effective_end_date > sysdate

    and (trunc (sysdate) BETWEEN women's wear. EFFECTIVE_START_DATE AND women's wear. EFFECTIVE_END_DATE)

    and a.effective_start_date = (select MAX (effective_start_date) from PER_ASSIGNMENTS_f where assignment_id = a.assignment_id)

    and a.assignment_id = 42643

    and a.assignment_status_type_id = '1')

    PIVOT (MAX (screen_entry_value) FOR (name) TO ("Amount" AS 'Amount', 'level' AS 'level', 'Option High' AS 'High Option', 'Pay the value' AS 'Value to pay', 'Period of Type' AS 'Type period'))

    order by element_name;

    (GOLD)

    SELECT ssn,

    Employee_number,

    employee_full_name,

    date_of_hire,

    effective_start_date,

    element_name,

    Max (decode (Name, 'Amount', screen_entry_value)) 'amount. "

    Max (decode (Name, 'Level', screen_entry_value)) 'level ',.

    MAX (DECODE (name, "High Option", screen_entry_value)) "High Option",

    MAX (DECODE (name, 'Value of pay', screen_entry_value)) 'value of pay. "

    MAX (DECODE (name, 'Period Type', screen_entry_value)) 'period of Type '.

    FROM (select distinct)

    ' 11-111-1111 "as ssn,

    WOMEN'S WEAR. Employee_number,

    "Vlad" as employee_full_name,

    TO_CHAR (papf.start_date, "MM/DD/YYYY") as date_of_hire

    a.effective_start_date,

    PETF.element_name,

    pivf. Name,

    peevf.screen_entry_value

    Of

    PER_all_PEOPLE_F women's wear

    per_assignments_f A

    pay_element_types_f petf

    pay_element_links_f pelf

    PAY_ELEMENT_ENTRIES_F penf

    PAY_ELEMENT_ENTRY_VALUES_F peevf

    pay_input_values_f pivf

    WHERE

    PETF.element_name ('Dental Plan before taxes', 'Medical Plan before taxes', "Vision Plan before taxes")

    and petf. ELEMENT_TYPE_ID = pelf. ELEMENT_TYPE_ID

    and (trunc (sysdate) BETWEEN pelf. EFFECTIVE_START_DATE AND pelf. EFFECTIVE_END_DATE)

    and (pelf. ELEMENT_LINK_ID = penf. ELEMENT_LINK_ID and a.assignment_id = penf. ASSIGNMENT_ID)

    and (trunc (sysdate) BETWEEN penf. EFFECTIVE_START_DATE AND penf. EFFECTIVE_END_DATE)

    and penf. ELEMENT_ENTRY_ID = peevf. ELEMENT_ENTRY_ID

    and peevf. INPUT_VALUE_ID = pivf. INPUT_VALUE_ID

    AND papf.employee_number IS NOT NULL

    AND A.assignment_type = 'E '.

    AND A.person_id = papf.person_id

    and papf.effective_end_date > sysdate

    and a.effective_end_date > sysdate

    and (trunc (sysdate) BETWEEN women's wear. EFFECTIVE_START_DATE AND women's wear. EFFECTIVE_END_DATE)

    and a.effective_start_date = (select MAX (effective_start_date) from PER_ASSIGNMENTS_f where assignment_id = a.assignment_id)

    and a.assignment_id = 42643

    and a.assignment_status_type_id = '1')

    GROUP BY ssn, employee_number, employee_full_name, date_of_hire, effective_start_date, NOM_ELEMENT

    order by element_name;

  • need help with the query, thx

    Hello
    I need a little help with the query I have to write;
    the table has 4 columns:
    col1               col2         col3       col4
    emp_name     empl_id    salary      year
    
    content of data:
    
    col1               col2         col3       col4
    smith             12           1200      1999
    smith             12           1340      2000
    smith             12           1500      2001
    jones             13           1550      1999 
    jones             13           1600      2000
    aron              14           1200      2002
    what I am asking is the following result: salary according to the latest available year
    i.e.
    smith         12         1500        2001
    jones         13         1600        2000
    aron          14         1200        2002
    ID appreciate some guidance on how to achieve
    Thank you
    Rgds
    select *from
    (select col1, col2,col3, col4,row_number() over(partition by col1 order by col4 desc)  rn  from 
    ) where rn=1
    
  • Need help with the query using the AVG function

    First post here.
    I am a student taking a SQL class and I can't find a query.
    I think I'm close to get it, but I can not quite all the way there.

    Three tables are involved in this problem. Here is a list of the tables and the areas concerned:
    orders table:
      order#
      shipstate
    
    orderitems table:
      order#
      isbn
      quantity         (How many copies of book purchased on that order)
    
    books table:
      isbn
      retail    (retail price of book)
    Problem:
    I want to get an average of "total amount" by shipstate.

    For example, in these tables, there are 8 records of the State of Florida.
    However, there are only 5 unique order # for this State.
    The amount of detail * quantity for these 8 disks (or 5 orders) is $345,10
    Now to get my average $345,10 should be divided by 5. (number of unique commands)
    In the following query it divides this $345,10 8. (number of records)

    How to make this request to divide by the number of unique order # rather than the number of records?
    SELECT shipstate, AVG(quantity * retail)
    FROM orders JOIN orderitems USING (order#)
    JOIN books USING (isbn)
    GROUP BY shipstate
    HAVING SUM(quantity * retail) =ANY
                                  (SELECT SUM(quantity * retail)
                                    FROM books JOIN orderitems USING (isbn)
                                    JOIN orders USING (order#)
                                    GROUP BY shipstate) 
    According to me, once I get this part down, I can understand the rest of the problem.
    The end result, I need, is to find all the individual commands that have a "total amount due" that is greater than the 'average amount due' for this state of clients.

    Any help, suggestions or comments welcome.
    Matt

    Your average take into account the shipstate (8 disks), you can do that for the expected results.
    With some examples of input data it would be easier, but here a try:

    SELECT shipstate, sum(quantity * retail)/count(distinct order#)
    FROM orders JOIN orderitems USING (order#)
    JOIN books USING (isbn)
    GROUP BY shipstate;
    

    Nicolas.

    delete the alias
    Edited by: N. Gasparotto on October 3, 2008 19:28

  • How to execute the query automatically when a query is added, Panel

    Hello

    Jdev: 12.1.3

    I added a queryPanel (af:query) on my Page. Everything works fine when I do a search.

    I wish I had the original Version to run the query that is executed automatically when loading the page. How can this be achieved?

    What I have to do this explicitly, or is it a property that I can use?

    See you soon

    AJ

    You can generate the default display criteria again, setting the mode to automatic query.

    You generate default criteria by adding each attribute to a criterion without specifying and literal bind variable.

    Timo

  • Error oracle FRM-40505 unable to execute the query

    Hi gurus,

    When query the values in host order of Super order management user

    The following error is displayed:

    FRM-40505: ORACLE error: cannot perform the query

    What is the solution for this error?

    Concerning

    SBJ *.

    Take a look at Metalink Note: "Troubleshooting FRM-40505 [ID 1004134.6].

    Khan

  • Need to update the query

    Hi all

    I update a table using the loop... but its taking too much time.

    I think to update this table using the single update statement... How can I write a single update statement.

    Below you will find the updated my for loop:

    BEGIN

    for c4 to (select source_logo, news_sources a.channel_id, matched_news_industry a

    where s.channel_id = a.channel_id

    and a.newS_id in (select news_id was in gm_sector_activity_tracker where is_transferred = am' and news_type = "Report entry")

    and a.newS_type like '% reports '.

    and a.LOGO_SOURCE is null

    and a.channel_id not in (6522,6835,5395)

    and a.channel_id not in (select thomson_channel_id from si_portals)) loop

    Update matched_news_industry

    Set logo_source = c4.source_logo

    where channel_id = c4.channel_id;

    end loop;

    Total: = SQL % ROWCOUNT;

    IF Total = 0 THEN

    dbms_output.put_line (' no data updates in matched_news_industry - logo_source');

    ON THE OTHER

    dbms_output.put_line ('Total records updated in matched_news_industry - logo_source' |)

    In total);

    END IF;

    Total: = 0;

    EXCEPTION

    WHEN No_data_found THEN

    dbms_output.put_line ('zero immeasurably updated in matched_news_industry - logo_source');

    WHILE OTHERS THEN

    dbms_output.put_line (' there was an error updating data in matched_news_industry - logo_source');

    END;

    Thank you

    Try the query optimized below:

    Fusion in matched_news_industry one

    using news_sources c4

    on)

    a.channel_id = c4.channel_id

    and a.newS_id in (select news_id was in gm_sector_activity_tracker where is_transferred = am' and news_type = "Report entry")

    and a.newS_type like '% reports '.

    and a.LOGO_SOURCE is null

    and a.channel_id not in (6522,6835,5395)

    and a.channel_id not in (select thomson_channel_id from si_portals)

    )

    When matched then

    update set a.logo_source = c4.source_logo

  • Need to simplify the query

    Hi gurus

    I have the following data:

    Drop table

    DROP TABLE lb_source;

    DROP TABLE lb;

    Insertion and table creation

    CREATE TABLE lb_source
    (
    source_cd VARCHAR2 (5)

    );


    INSERT INTO lb_source
    (
    SELECT 'a' STARTING from two
    UNION ALL
    SELECT 'b' double
    UNION ALL
    Select 'l' to double
    );

    CREATE TABLE lb
    (
    group_number VARCHAR2 (10),
    source_cd varchar2 (5)
    );

    INSERT INTO lb
    (
    SELECT '100', 'l' FROM dual
    UNION ALL
    SELECT '100', double null

    );

    ------------

    If you see table lb then it contained a line with source_cd = l against 100 and source_cd = Null group against group 100, now I want to create this kind of query, in which all correspondence lines in tables to join both if lb is null, then query join all the source_cd of table lb_source except source_cd = 'l '. So far, I created the following query and its works ok but I want to do all my work in one in where condition...

    Query

    SELECT * FROM

    (

    SELECT s1, s2 b.source_cd A.source_cd

    OF lb_source A

    lb b

    WHERE A.source_cd = nvl (b.source_cd, A.source_cd)

    )

    WHERE s2 IS NULL

    ;

    Result

    s1 s2

    a null value

    b zero

    l null

    Please guide

    Hello

    So, you want something that produces the same accurate results as the query you posted, but does more just; Isn't it?

    Here's one way:

    SELECT ls.source_cd S1

    NULL AS s2

    OF ls lb_source

    JOIN lb l WE l.source_cd IS NULL

    AND ls.source_cd IS NOT NULL;

    I'm curious; What is the business problem that requires this request?  What tables and columns represent, and what tell you the query?

    Thanks for posting the CREATE TABLE and INSERT statements; It's very useful!

  • Need help with the query logic

    I have 2 tables.

    Table Tb1:
    THE PLAN_ID PARENT_PLAN_ID ARGUMENT
    Value null P1
    P1 P2
    P3 P2
    P4 P1

    Table tb2:
    THE PLAN_ID ACTIVITY_ID PICKING ARGUMENT
    P2 A1 5000
    P2 A2 5000
    P2 A3 5000
    P3 A1 10000
    P3 A2 10000
    P4 A1 4000


    I need to find the sum of the value of reduction of the workforce for each PLAN_ID which is parent root. In the case above, this is the argument PLAN_ID P1 (WHERE PARENT_PLAN_ID IS NULL). Please note that the value of the downsizing is repeated in the tb2 table. For example, the PLAN_ID P2 argument, the value of the downsizing is 5000 and not 5000 + 5000 + 5000.

    The result of the output for the above data must be
    THE ARGUMENT PLAN_ID DRAWDOWN
    P1 19000

    Published by: user10566312 on October 30, 2012 12:30
    with t as
    (   select t1.plan_id,t1.parent_plan_id,max(t2.DRAWDOWN) DRAWDOWN
        from tb1 t1,tb2 t2
        where t1.plan_id = t2.plan_id(+)
        group by  t1.plan_id,t1.parent_plan_id
    )
    select plan_id,sum(drawdown) drawdown
    from(
          select  connect_by_root plan_id as plan_id,
                  nvl(DRAWDOWN,0) DRAWDOWN
          from t
          start with parent_plan_id is null
          connect by parent_plan_id  = prior plan_id
        )
    group by plan_id  ; 
    
    PLAN_ID DRAWDOWN
    ------- --------
    P1         19000 
    

    Published by: JAC on October 30, 2012 13:23

  • Need help in the query.

    with t as
    (
    Select 'AAA', 'AAA01' wers_feature_code of all family_code the double union
    Select 'AAA', 'AAA02' from dual union all
    Select "BBB-", 'BBB01' from dual union all
    Select "BBB-", 'BBB02' from dual
    )
    Select t1.wers_feature_code. T t1, t t2 T2.wers_feature_code

    Result:

    T1. WERS_FE

    --------------------------------------------------------------------------------
    AAA01AAA01
    AAA01AAA02
    AAA01BBB01
    AAA01BBB02
    AAA02AAA01
    AAA02AAA02
    AAA02BBB01
    AAA02BBB02
    BBB01AAA01
    BBB01AAA02
    BBB01BBB01

    T1. WERS_FE

    --------------------------------------------------------------------------------
    BBB01BBB02
    BBB02AAA01
    BBB02AAA02
    BBB02BBB01
    BBB02BBB02

    The above query should be filtered. The above documents not family_code even.
    For example AAA01AAA01, AAA01AAA02, AAA02AAA01, AAA02AAA02, BBB01BBB01, BBB02BBB01,
    BBB02BBB02 should not be visible. The code is not difficult family_code in the query. Can be more than a family_code.

    Thank you
    Vinodh

    Hi, Vinodh,

    That's what you asked for:

    WITH     got_family_cnt     AS
    (
         SELECT     family_code
         ,     wers_feature_code
         ,     COUNT (DISTINCT family_code) OVER ()          AS family_cnt
         FROM     sample_tbl
    )
    SELECT     REPLACE ( SYS_CONNECT_BY_PATH (wers_feature_code, '>')
              , '>'
              ) AS output
    FROM     got_family_cnt
    WHERE     LEVEL     = family_cnt
    CONNECT BY NOCYCLE     family_code     != PRIOR family_code
    ;
    

    It produces 48 lines
    (2 choices for family 'AAA'
    * 2 for "BBB".
    * 2 for "CCC".
    * 3 choices for 1 family
    * 2 (2nd).

    This assumes you know some substring that never happens in wers_feature_code. I used ' > ' above, but you can use anything else.

    Published by: Frank Kulash, June 15, 2010 10:42
    Simplified query.

  • Fill a text element to EXECUTE the QUERY

    Fill a text element when a list item is changed by using the following code in a trigger WHEN-LIST-CHANGED:

    SELECT ROOM_DESC IN: SESSIONS. ROOM_DESC OF ROOMS WHERE ROOM_REF =: SESSIONS. ROOM_REF;

    It works fine but when I start a new form and click on run query that do not appear in the text element data.

    What type of trigger can I use these data through when I press to run the query and if I can use the same code?

    Bravo guys

    Hello

    This because when you pull, the trigger WHEN LIST-CHANGED does not occur. So, write the same line in the trigger after REQUEST of the block.

    Kind regards

    Manu.

    If my answer or the answer to another person has been useful or appropriate, please mark accordingly

Maybe you are looking for