Kindly help for mentioning out with an SQL query, thanks

Hello

Please find below the input grid and help me get the result. Thanks in advance.  [Seeks assistance of query tunned]

with the temp as

(select alert_id 100, 111 double branch_code)

Union of all the

Select double 100 111

Union of all the

Select double 100 222

Union of all the

Select double 101 333

Union of all the

Select double 101 444

Union of all the

Select double 101 555

Union of all the

Select double 102 666

Union of all the

Select double 102 666

Union of all the

Select 102 666 double)

Select * Temp;

Entry
Alert_IDBranch_code
100111
100111
100222
101333
101444
101555
102666
102666
102666

Output
Alert_idBranch_code
100111 222
101333,444,555
102666

Thanks a ton

Arpit

Oracle 11 g 2, with analysis of the table only once. .. Here's how:

WITH temp1

AS (SELECT alert_id,

branch_code,

ROW_NUMBER)

COURSES (PARTITION BY alert_id ORDER BY branch_code)

DSB

TEMP

GROUP BY alert_id, branch_code)

SELECT alert_id,

LISTAGG (branch_code, ",") WITHIN GROUP (ORDER BY DSB) branch_code

OF temp1

GROUP BY alert_id;

ALERT_ID BRANCH_CODE

100 111 222

101 333,444,555

102 666

See you soon,.

Manik.

Tags: Database

Similar Questions

  • Need help for the Partition of PL/SQL query for a question

    Hi all


    I'm running on a question that I'm not able to get the desired result. I would appreciate if one of you experts can help resolve this.

    SQL * more: Production of release 11.2.0.1.0 game 4 Feb 09:31:26 2016
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.

    Connected to:
    Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production
    With partitioning, OLAP, Data Mining and Real Application Testing options


    with t as)
    Select 1 numero_enregistrement, Student_ID 123, nvl (trim (01), 'NULL') like Item_id, 'ITEM_ID_01' FIELD_NAME Union double all the
    Select 1 numero_enregistrement, Student_ID 123, nvl (trim(' '), 'NULL') like Item_id, 'ITEM_ID_02' FIELD_NAME Union double all the
    Select 1 numero_enregistrement, Student_ID 123, nvl (trim(' '), 'NULL') like Item_id, 'ITEM_ID_03' FIELD_NAME Union double all the
    Select 1 numero_enregistrement, Student_ID 123, nvl (trim(' '), 'NULL') like Item_id, 'ITEM_ID_04' FIELD_NAME Union double all the
    Select 1 numero_enregistrement, Student_ID 123, nvl (trim(' '), 'NULL') like Item_id, 'ITEM_ID_05' FIELD_NAME Union double all the
    Select 1 numero_enregistrement, Student_ID 123, nvl (trim(' '), 'NULL') like Item_id, 'ITEM_ID_06' FIELD_NAME Union double all the
    Select 2 numero_enregistrement, Student_ID 123, nvl (trim('01'), 'NULL') like Item_id, 'ITEM_ID_01' FIELD_NAME Union double all the
    Select 2 numero_enregistrement, Student_ID 123, nvl (trim('02'), 'NULL') like Item_id, 'ITEM_ID_02' FIELD_NAME Union double all the
    Select 2 numero_enregistrement, Student_ID 123, nvl (trim('03'), 'NULL') like Item_id, 'ITEM_ID_03' FIELD_NAME Union double all the
    Select 2 numero_enregistrement, Student_ID 123, nvl (trim('01'), 'NULL') like Item_id, 'ITEM_ID_04' FIELD_NAME Union double all the
    Select 2 numero_enregistrement, Student_ID 123, nvl (trim('01'), 'NULL') like Item_id, 'ITEM_ID_05' FIELD_NAME Union double all the
    Select 2 numero_enregistrement, Student_ID 123, nvl (trim('02'), 'NULL') like Item_id, 'ITEM_ID_06' double FIELD_NAME)
    SELECT distinct COUNT (*) OVER (PARTITION BY numero_enregistrement ORDER BY numero_enregistrement) REC_COUNT, numero_enregistrement, STUDENT_ID, ITEM_ID, Field_Name FROM t
    where ITEM_ID = 'NULL '.

    I get the following result.


    NUMERO_ENREGISTREMENT ITEM_ID FIELD_NAME STUDENT_ID REC_COUNT
    5                                   1                                             123                              NULL               ITEM_ID_02
    5                                   1                                             123                              NULL               ITEM_ID_03
    5                                   1                                             123                              NULL               ITEM_ID_04
    5                                   1                                             123                              NULL               ITEM_ID_05
    5                                   1                                             123                              NULL               ITEM_ID_06


    My desired output is

    Rec_COUNT Student_ID ITEM_ID FIELD_NAME numero_enregistrement
    5 1 123 NULL ITEM_ID_02, ITEM_ID_03, ITEM_ID_04, ITEM_ID_04, ITEM_ID_05

    Thanks in advance

    Rajesh

    Hi, Renon,

    Thanks for posting the sample data and results; It is very useful.

    Be sure to explain exactly how you get these results from these data.  There are many different reasons you may have, that all happen to produce the same results with the sample data you posted, but will get different results with other data sets.

    This looks like a job for aggregate (including the LISTAGG) functions and GROUP BY, not for functions, analytical and PARTITION BY

  • Need help with a SQL query

    Hello

    I have a data in table (raj_table) with columns (char11) raj_id, raj_number (varchar2 (15)), raj_format (NUMBER), Primary_ID (identity with the values of the primary key column)

    Primary_ID raj_id Raj_number Raj_format

    1                            raj                 rajvend                      1

    2                            raj                 rajvend                      1

    3                            raj                 rajvendor1                 2

    4                            raj                 rajvendor1                 2

    5                            raj                 rajvendor1                 2

    6                            raj                 rajvendor2                 3

    I used under SQL to get query output as below, but has not achieved the required result:

    Select client_id vendor_number, vendor_format, primary_id, row_number() on sl_no (client_id partition, primary_id, vendor_format order of client_id primary_id, vendor_format, vendor_number, vendor_number)

    from raj_table by sl_no asc

    SL_NO raj_id raj_number raj_format primary_id

    1                   1                   raj              rajvendor                 1

    1                   2                  raj              rajvendor                 1

    2                   3                   raj              rajvendor1                2

    2                   4                   raj              rajvendor1                2

    2                   5                  raj               rajvendor1                2

    3                   6                    raj              rajvendor2                3

    I need help with a SQL query to get the result as above without using the group by clause. I want to bring together the combination of separate line of the three columns (raj_id, raj_number, raj_format) and add a unique serial number for each online game (SL_NO column below). So, above there are 3 unique set of (raj_id, raj_number, raj_format) I can get in a group by clause, but I can not add prmiary_id, SL_NO values if I group by clause. I used the analytical functions like row_number() but no luck. Need solution for this.

    with t as)

    Select 'raj' raj_id, 'rajvend' raj_number, 1 raj_format, 1 primary_id Union double all the

    Select option 2, 'raj', 'rajvend', 1 double Union all

    Select 3, 'raj', 'rajvendor1', 2 double Union all

    Select 4, 'raj', 'rajvendor1', 2 double Union all

    Select 5, 'raj', 'rajvendor1', 2 double Union all

    Select 6, 'raj', 'rajvendor2', 3 double

    )

    Select dense_rank() over (order of raj_id, raj_number, raj_format) sl_no,

    t.*

    t

    order by primary_id

    /

    PRIMARY_ID RAJ RAJ_NUMBER RAJ_FORMAT SL_NO
    ---------- ---------- --- ---------- ----------
    1 1 raj rajvend 1
    1 2 raj rajvend 1
    2 3 raj rajvendor1 2
    2 4 raj rajvendor1 2
    2 5 raj rajvendor1 2
    3 6 raj rajvendor2 3

    6 selected lines.

    SQL >

    SY.

  • Help with making SQL query references to column aliases in the Case statement

    I need help with a sql query that I'm trying. I can go about it the wrong way, but I would be grateful if I could get any suggestions on possible solutions. This is my query:


    SELECT DISTINCT spriden_pidm, spriden_id id, spriden_last_name | ',' | spriden_first_name name,

    CASE
    WHEN rcresar_comm_code_01 IN ('268 ', '269', ' 270') THEN rcresar_comm_code_01
    WHEN rcresar_comm_code_02 IN ('268 ', '269', ' 270') THEN rcresar_comm_code_02
    WHEN rcresar_comm_code_03 IN ('268 ', '269', ' 270') THEN rcresar_comm_code_03
    WHEN rcresar_comm_code_04 IN ('268 ', '269', ' 270') THEN rcresar_comm_code_04
    WHEN rcresar_comm_code_05 IN ('268 ', '269', ' 270') THEN rcresar_comm_code_05
    WHEN rcresar_comm_code_06 IN ('268 ', '269', ' 270') THEN rcresar_comm_code_06
    WHEN rcresar_comm_code_07 IN ('268 ', '269', ' 270') THEN rcresar_comm_code_07
    WHEN rcresar_comm_code_08 IN ('268 ', '269', ' 270') THEN rcresar_comm_code_08
    WHEN rcresar_comm_code_09 IN ('268 ', '269', ' 270') THEN rcresar_comm_code_09
    WHEN rcresar_comm_code_10 IN ('268 ', '269', ' 270') THEN rcresar_comm_code_10
    END acg_elig_comm_code

    CASE
    WHEN acg_elig_comm_code = ' 268' THEN 'rigorous HS course. "
    WHEN acg_elig_comm_code = '269' THEN ' 2 or several AP or IB"
    WHEN acg_elig_comm_code = '270' THEN 'NOC as possible ".
    END comm_code_description

    OF spriden, rcresar, rcrapp1

    WHERE (rcresar_comm_code_01 IN ('268 ', '269', ' 270')

    OR rcresar_comm_code_02 ('268 ', '269', ' 270')

    OR rcresar_comm_code_03 ('268 ', '269', ' 270')

    OR rcresar_comm_code_04 ('268 ', '269', ' 270')

    OR rcresar_comm_code_05 ('268 ', '269', ' 270')

    OR rcresar_comm_code_06 ('268 ', '269', ' 270')

    OR rcresar_comm_code_07 ('268 ', '269', ' 270')

    OR rcresar_comm_code_08 ('268 ', '269', ' 270')

    OR rcresar_comm_code_09 ('268 ', '269', ' 270')

    OR rcresar_comm_code_10 ('268 ', '269', ' 270'))


    Rcresar_aidy_code = & aidy_code

    AND rcrapp1_aidy_code = rcresar_aidy_code

    AND rcrapp1_curr_rec_ind = 'Y '.

    AND rcrapp1_seq_no = rcresar_seq_no


    AND spriden_pidm = rcresar_pidm

    AND rcrapp1_pidm = rcresar_pidm


    AND spriden_change_ind IS NULL

    ORDER BY name


    The second case statement is where I don't know exactly what it takes to get what I want.

    Output should be like:
    spriden_pidm name ID acg_elig_comm_code comm_code_description
    «0000000000', ' 1111111111 ","John Doe","268", «rigorous HS race"»

    If I take the second case statement it works great except that I do not have my comm_code description column. My question is how can I use my first statement value box to determine this column? I think that I need a case statement as I have, but I don't know how to reference the value of acg_elig_comm_code. Any help would be greatly appreciated. Thank you.

    Published by: blackhole82 on January 20, 2009 09:20

    Hello

    You cannot use the alias column in the query, even where it is set (except in the ORDER BY clause).
    You can set the alias in a subquery and then use it in a great query, like this:

    WITH  sub_q  AS
    (
        SELECT DISTINCT spriden_pidm,spriden_id id, spriden_last_name||', '||spriden_first_name name,
            CASE
                WHEN rcresar_comm_code_01 IN ('268','269','270') THEN rcresar_comm_code_01
                WHEN rcresar_comm_code_02 IN ('268','269','270') THEN rcresar_comm_code_02
                WHEN rcresar_comm_code_03 IN ('268','269','270') THEN rcresar_comm_code_03
                WHEN rcresar_comm_code_04 IN ('268','269','270') THEN rcresar_comm_code_04
                WHEN rcresar_comm_code_05 IN ('268','269','270') THEN rcresar_comm_code_05
                WHEN rcresar_comm_code_06 IN ('268','269','270') THEN rcresar_comm_code_06
                WHEN rcresar_comm_code_07 IN ('268','269','270') THEN rcresar_comm_code_07
                WHEN rcresar_comm_code_08 IN ('268','269','270') THEN rcresar_comm_code_08
                WHEN rcresar_comm_code_09 IN ('268','269','270') THEN rcresar_comm_code_09
                WHEN rcresar_comm_code_10 IN ('268','269','270') THEN rcresar_comm_code_10
            END acg_elig_comm_code   -- Originally posted with , here (error)
        FROM spriden, rcresar, rcrapp1
        WHERE (rcresar_comm_code_01 IN ('268','269','270')
                OR rcresar_comm_code_02 IN ('268','269','270')
                OR rcresar_comm_code_03 IN ('268','269','270')
                OR rcresar_comm_code_04 IN ('268','269','270')
                OR rcresar_comm_code_05 IN ('268','269','270')
                OR rcresar_comm_code_06 IN ('268','269','270')
                OR rcresar_comm_code_07 IN ('268','269','270')
                OR rcresar_comm_code_08 IN ('268','269','270')
                OR rcresar_comm_code_09 IN ('268','269','270')
                OR rcresar_comm_code_10 IN ('268','269','270'))
        AND rcresar_aidy_code = &aidy_code
        AND rcrapp1_aidy_code = rcresar_aidy_code
        AND rcrapp1_curr_rec_ind = 'Y'
        AND rcrapp1_seq_no = rcresar_seq_no
        AND spriden_pidm = rcresar_pidm
        AND rcrapp1_pidm = rcresar_pidm
        AND spriden_change_ind IS NULL
    )
    SELECT    sub_q.*,
              CASE
                  WHEN acg_elig_comm_code = '268' THEN 'Rigorous HS course'
                  WHEN acg_elig_comm_code = '269' THEN '2 or more AP or IB'
                  WHEN acg_elig_comm_code = '270' THEN 'ACG possible'
              END comm_code_description
    FROM      sub_q
    ORDER BY  name
    

    Furthermore, you might think to rearrange your table, so that you do not have 10 columns (rcresar_comm_code_01, rcresar_comm_code_02,...) that essentially do the same thing. The usual way to handle this kind of one-to-many relationship is to have all rcresar_comm_codes in a separate table, one per line, with a pointer to the table where you have them now.

    Published by: Frank Kulash, January 20, 2009 11:35
    Syntax error has been corrected

  • Link to calendar for a calendar with a Union query

    I have a calendar with an SQL query. The query is a union with 3 different tables data.  When a user clicks the calendar of events, go to different pages based on the element in the query

    How to create the link.  Can someone guide me

    I'm on apex.oracle.com

    Caledar Query

    **************

    Select (event_no |) » -'|| event_name) name, event_date main_events

    Union of all the

    Select (order_no |) » -'|| order_name) name, Order_date main_orders

    Union of all the

    Select (action_number |) » -'|| wo_name) name, main_actions scheduled_start_date

    gkthomas wrote:

    Definition of color for the different elements are clear. But building the target of the dynamic link is not clear. Would you like to explain a little more.

    I also want the link to go to that particular record when the user click the input data for the calendar

    I don't really see how it can be made clearer. Have you read the online help for the attributes of link calendar? Do you understand the concept of chains of substitution? And the use of APEX URL to link pages and applications?

    Link target URL can be built dynamically in the region of link attributes. In a UNION data source, each request can contain values that are used to specify the different target pages and elements of page/values to define column. These columns are referenced in the attributes of calendar display/change link as substitution strings to specify the page number and set the values of the elements of the requested page:

    Source of the region


    select
        event_no || ' - ' || event_name event_title
      , event_date
      , 'apex-cal-green' css_class
      , '10' link_page
      , 'P10_EVENT_NO' link_items
      , event_no link_values
    from
        main_events
    union all
    select
        order_no || ' - ' || order_name
      , order_date
      , 'apex-cal-yellow' css_class
      , '11'
      , 'P11_ORDER_NO'
      , order_no
    from
        main_orders
    union all
    select
        action_number || ' - ' || wo_name
      , scheduled_start_date
      , 'apex-cal-red'
      , '12'
      , 'P12_ACTION_NO,P12_WO_NAME'
      , order_no || ',' || wo_name
    from
        main_actions
    

    View/Edit link

    f?p=&APP_ID.:&LINK_PAGE.:&SESSION.::&DEBUG.:&LINK_PAGE.:&LINK_ITEMS:&LINK_VALUES.
    


    If you really have trouble with this then as usual the best course of action is to create and share an example on apex.oracle.com where the proper techniques can be demonstrated.

  • Pool pane there problem with long sql query?

    Hello

    I use Jdeveloper 11.1.2.2.0

    In the application I'm developing, there is a long sql query to call (it's a function from a package, which may take a few minutes to run) and I want to display a progress bar for the user.

    The progress bar component is a "progress indicator" and the percentage of achivement is refreshed by a component 'pool' with 1-second interval.

    The two components are connected in a javabean.

    The function with the sql query is the javabean too.

    To run the sql query that is long on background I am calling from a thread, and the pool component get the advancement of the percentage of a pipe filled with the sql function.

    If the function to run is just a long loop of java operations the progress bar works fine, but if I put my long sql query instead, stop listener pool should be performed to stop long, s sql queryo progress are updated only at the end of the long sql query.

    You have any ideas?

    Thank you

    Thanks for your replies. Unfortunately, it was not the solution to my case, sql procedures to block the entire application while ADF awaits them at the end...

    To solve my problem, I finally used a PL SQL Job to call my sql procedure (dbms_job.submit).

    The application is released right after the call and the component of the pool is not more secure!

    Kind regards

    Yann

  • Need help with PL/SQL query complex

    I need help with a query that need access to data from 3 tables. That's what I did

    I created 3 tables

    CREATE TABLE post_table
    (
    post_id varchar (20),
    datepost DATE,
    KEY (post_id) elementary SCHOOL
    ) ;

    CREATE TABLE topic
    (
    TOPIC_ID varchar (20),
    name varchar (20),
    PRIMARY KEY (topic_id)
    );

    CREATE TABLE blogpost_table
    (
    TOPIC_ID varchar (20),
    post_id varchar (20),
    PRIMARY KEY (topic_id, post_id);
    FOREIGN KEY (topic_id) REFERENCES topic (topic_id) ON DELETE CASCADE,
    FOREIGN KEY (post_id) REFERENCES post_table (post_id) ON DELETE CASCADE
    );


    Now, I inserted a few values in these tables as

    INSERT INTO post_table VALUES ('p1', to_date ('2009-09-14 18:00 "," MM/DD/YYYY mi:ss'));))
    INSERT INTO post_table VALUES ('p2', to_date ('2009-07-18 18:00 "," MM/DD/YYYY mi:ss'));))
    INSERT INTO post_table VALUES ('p3', to_date ('2009-07-11 18:00 "," MM/DD/YYYY mi:ss'));))
    INSERT INTO post_table VALUES ('p4', to_date ('2009-03-11 18:00 "," MM/DD/YYYY mi:ss'));))
    INSERT INTO post_table VALUES ('p5', to_date ('2009-07-13 18:00 "," MM/DD/YYYY mi:ss'));))
    INSERT INTO post_table VALUES ('p6', to_date ('2009-06-12 18:00 "," MM/DD/YYYY mi:ss'));))
    INSERT INTO post_table VALUES ('p7', to_date ('2009-07-11 18:00 "," MM/DD/YYYY mi:ss'));))

    INSERT INTO VALUES subject ("t1", "baseball");
    INSERT INTO category VALUES ('t2', 'football');

    INSERT INTO blogpost_table VALUES ("t1", "p1");
    INSERT INTO blogpost_table VALUES ('t1', 'p3');
    INSERT INTO blogpost_table VALUES ("t1", "p4");
    INSERT INTO blogpost_table VALUES ('t1', 'p5');
    INSERT INTO blogpost_table VALUES ('t2', 'p2');
    INSERT INTO blogpost_table VALUES ('t2', 'p6');
    INSERT INTO blogpost_table VALUES ("t2", "p7");


    I'm launching SQL queries on the table in this topic.

    I want to write a SQL query that returns me the name of a topic (s) and the number of blog_post (s) associated with the topic in descending order of the number of blog posts created in July.

    Can someone please help me to write this query?

    Thank you

    Published by: user11994430 on October 9, 2009 07:24

    Thanks for the test of the configuration!

    SQL>SELECT   t.NAME, COUNT(*)
      2      FROM topic t, blogpost_table b, post_table p
      3     WHERE b.topic_id = t.topic_id
      4       AND p.post_id = b.post_id
      5       AND p.datepost >= DATE '2009-07-01'
      6       AND p.datepost < DATE '2009-08-01'
      7  GROUP BY t.NAME
      8  ORDER BY COUNT(*) desc;
    
    NAME                   COUNT(*)
    -------------------- ----------
    baseball                      2
    soccer                        2
    

    HTH, Urs

  • Please help me with this SQL query

    I'm practicing of SQL queries and met one involving the extraction of data from 3 different tables.

    The three paintings are as below

    < pre >
    Country
    Location_id country
    LOC1 Spain
    loc2 England
    LOC3 Spain
    loc4 USA
    loc5 Italy
    loc6 USA
    loc7 USA
    < / pre >
    < pre >


    User
    user_id location_id
    loc1 U1
    loc1 U2
    loc2 U3
    loc2 U4
    loc1 U5
    U6 loc3
    < / pre >
    < pre >


    Publish
    user_id post_id
    P1 u1
    P2 u1
    U2 P3
    P4 u3
    P5 u1
    P6 u2
    < / pre >

    I am trying to write a SQL query - for each country of the users, showing the average number of positions

    I understand the logic behind all this that we must first consolidate all locations, and then the users in one country and then find the way to their positions.
    But, I'm having a difficulty to this format SQL. Could someone help me please with this request.

    Thank you.

    Select
    Country.Country,
    Count (*) Totalpostspercountry,
    Count (distinct post.user_id) Totaldistincuserspercountry,
    count (*) / count (distinct post.user_id) Avgpostsperuserbycountry
    Of
    countries, have, post
    where country.location_id = muser.location_id
    and muser.user_id = post.user_id
    Country.country group

    The output is like this for your sample data - hope that's what you're looking for :)

    COUNTRY, TOTALPOSTSPERCOUNTRY, TOTALDISTINCUSERSPERCOUNTRY, AVGPOSTSPERUSERBYCOUNTRY
    In England, 1, 1, 1.
    Spain, 5, 2, 2.5.

  • need help for VMWARE 8 with Server 2008

    Hi, need your help for my current problem,

    I am currently using vmware workstation 8 for my MCITP LAB. I have windows 7 OS and host in vmware W/S I installed server 2008 and windows 7 Pro. I have a static IP for the host operating system (10.1.1.31 255.255.255.0 10.1.1.1) DNS - (203.X.X.35 203.X.X.36) and also, I configured two comments with a static IP address. Server 2008 - (10.1.1.191 255.255.255.0 10.1.1.1) DNS (127.0.0.1) have active directory and the DNS service is installed, and there also is the main DNS 127.0.0.1 and for the comments of Pro windows 7 - (10.1.1.192 255.255.255.0 10.1.1.1 (10.1.1.191), the primary dns is pointed to comments Server 2008) I use a bridge network for host OS and the two guest operating system, but when I tried to connect to the internet there is no connection as it is not the internet for the two guest operating system and there is no internal connectivity to the two guest operating system. virtual bridge Protocol option, it is also so please need your help to solve this problem, I can do my TP.

    the main solution, I need, that's how I use the PDC 2008 sever in same vmware W/S with three customer reviews OS I can do my work Practicle without buying a few physical computers. Please see the attached diagram-

    I have core I5 with Virtulisation

    8 GB Ram

    HARD DRIVE 500 GB

    Wireless WLAN cards

    DVD R/W

    Please need help as soon as POSSIBLE.

    Thank you and best regards,

    Martinuzzi

    OK, for the windows 2008, try to install the DNS service (Add Server Manager roles) in there... (you cannot point the others it as DNS if it does not act as DNS)

    also in it the IP configuration, set as follows:

    IP 10.1.1.31

    Subnet 255.255.255.0

    Gateway 10.1.1.1

    Primary DNS 10.1.1.31

    203.x.x.35 secondary DNS (you can also add the 203.x.x.36)

    Do the same for your guests to WIndows 7.

    Make sure all are workers and they can ping each other...

    If everything is OK, you should have internet on them...

  • Report with the sql query area

    Hello

    I have a region in relation to the sql query. There are two regions in the page. Top of page, the user enters data and after that second data enterd to see the region, which is related region
    based on a sql query.

    Now, when this page is opned, because the user has not entered anything, region report shows the message "no data found". Is it possible to remove this message or
    may I have conditionally disaply region report IE if data are inserted only region report is dispalyed.

    Thank you

    Hello

    You can use conditions for example "Exists (SQL query returns at least one row).

    Kind regards
    Jari

  • help automate an UPDATE with PL/SQL statement

    Hello, I'm on 10g R2, I am trying to learn PL/SQL, got a few books, watch YouTube videos and other things as best practices and etc. I wanted to automate this SQL:

    Basically every month I have to update a lot of old paintings against the current months Table.

    Old Table = your
    New Table = tt

    I thought maybe I can put anything in a list (like a table) and list all the old tables in there for your, I have 26 far and every month I add + 1.

    The tt table is only one, that's why I thought I could automate only inside a loop?
    UPDATE OLDER_TABLE_DATE ta
    
     SET (ta.GTP, ta.UPDATE_DT) = 
         (SELECT tt.GTP, SYSDATE
          FROM NEWEST_TABLE_UPDATED tt
          WHERE ta.customer_id = tt.customer_id
          AND ta.STAMP_DATE = tt.STAMP_DATE)
    
    WHERE EXISTS (SELECT 1
            FROM NEWEST_TABLE_UPDATED tt
            WHERE ta.customer_id = tt.customer_id
            AND ta.STAMP_DATE = tt.STAMP_DATE
            AND (NVL(ta.GTP, 'X') != NVL(tt.GTP, 'X')));
            
    COMMIT;
    What do you think guys? example or help would be appreciated. I can run this as an anonymous block for now, it is very good, thanks!

    Assumptions: -.
    -Your old/new all the tables are in the same schema.
    -Their names have the word "more ANCIENT".
    -You can run the procedure of the same pattern where all the tables of the old and the new spell.

    NOTE:-handle exceptions in the code accordingly, for example, when the update fails then handle exceptions.
    -As mentioned previously, this approach does not sound very well. Change in design to a single table (partition on month) stores all monthly data will be a good solution.

    CREATE OR REPLACE PROCEDURE UPDATE_TABLES_PROC
    AS
    cursor c1 is
    select table_name from user_tables
    where table_name like '%OLDER%';
    
    type t_current_table is table of c1%rowtype;
    v_current_table t_current_table;
    
    SQL_STMT VARCHAR2(3000):=0;
    
    BEGIN
    
    OPEN C1;
     LOOP
    
        FETCH C1 BULK COLLECT INTO  v_current_table  LIMIT 10; 
    
        IF v_current_table.count>0 then
    
        FOR i in v_current_table .first..v_current_table .last
        LOOP
    
        SQL_STMT:='UPDATE ' ||v_current_table(i).table_name|| ' ta
                         SET (ta.GTP, ta.UPDATE_DT) =
                                       (SELECT tt.GTP, SYSDATE
                                        FROM NEWEST_TABLE_UPDATED tt
                                        WHERE ta.customer_id = tt.customer_id
                                       AND ta.STAMP_DATE = tt.STAMP_DATE)
                          WHERE EXISTS (SELECT 1
                                       FROM NEWEST_TABLE_UPDATED tt
                                       WHERE ta.customer_id = tt.customer_id
                                       AND ta.STAMP_DATE = tt.STAMP_DATE
                                       AND (NVL(ta.GTP, ''X'') != NVL(tt.GTP, ''X'')))';
    
        EXECUTE IMMEDIATE SQL_STMT;
        EXIT WHEN c1%NOTFOUND;
    
        END LOOP;
        END IF;
    
    COMMIT;
    EXIT WHEN c1%NOTFOUND;
    END LOOP;
    CLOSE C1;
    END UPDATE_TABLES_PROC;
    
  • need help for an outer join query

    Hi friends...
    I have oracle 10g...
    I have a question which involve is joining three tables...

    the query is as follows:
    SELECT DISTINCT MU.MKT_ID                  "PAR ID",
                       MU.MKT_ID                  "ROOT ID",
                     MSU.SPEC_ID                "ID",
                   SU.SPEC_DESC                "DESC",
               SU.SPEC_CD          "SPEC CD"
    
                  FROM IPOADM_BATCH.MKT_UV1        MU,
                         IPOADM_BATCH.MKT_SPEC_UV1   MSU,
                 IPOADM_BATCH.SPEC_UV1       SU
    
                   WHERE MSU.MKT_ID  = MU.MKT_ID
               AND MSU.SPEC_ID = SU.SPEC_ID
             AND SU.SPEC_GRP_OR_CMPSTN_CD = 'C';
    in my front end application has some delete operations that removes specific data of the IPOADM_BATCH. MKT_SPEC_UV1 due to which the above query is nor fetch all rows.
    the relationship between the tables is clearly from the above query...

    I have the data in IPOADM_BATCH. MKT_UV1 and IPOADM_BATCH. Table of SPEC_UV1 after the delete operation

    now, I want the query above to retrieve data from IPOADM_BATCH. MKT_UV1 with small changes to the above query even if there is no data in IPOADM_BATCH. MKT_SPEC_UV1.

    I thought that if I use an outer join I can get it, but here I have to join three tables-join condition is based on the table that doesn't have a data...


    so please help me guys how can I change the query to get my desired out put...

    Hello

    There are several different things you could mean by it.

    Here's how to join the tables to get one of them:

    SELECT DISTINCT  mu.mkt_id                  "PAR ID",
                     mu.mkt_id                  "ROOT ID",
                     msu.spec_id                "ID",
                     su.spec_desc               "DESC",
                     su.spec_cd                   "SPEC CD"
    FROM           ipoadm_batch.mkt_uv1        mu
    LEFT OUTER JOIN      ipoadm_batch.mkt_spec_uv1   msu  ON   msu.mkt_id               = mu.mkt_id
    LEFT OUTER JOIN  ipoadm_batch.spec_uv1       su       ON   msu.spec_id              = su.spec_id
                                                  AND  su.spec_grp_or_cmpstn_cd = 'C'
    ;
    

    If it does not matter what it is that you want, and then after a small example of data (CREATE TABLE and INSERT, only relevant columns instructions) for all the tables and the results desired from these data.
    Highlight a few places where the above querry is the production of incorrect results of your sample data and explains how to get the correct results in these places.

  • HELP for the string with the value of waste

    Here, I have attached front and block diagrm and vi. Problem is im get required string displayed and with it, some is not required to chain appears also. Help me edit.

    NOTE: If number: corresponds to 90610003 must be obtained. But in my code im getting

    90610003
    VLPN: KA - 01 I-2000
    Dest ID: 100
    Top speed: 15
    Admin1: 9538991097
    Admin2: 9538991096
    Admin3: 9880899964 (NOT NECESSARY a "BOLD")

    Here is the text of program where I searched for string

    IRU details.txt

    Number: 90610003
    VLPN: KA - 01 I-2000
    Dest ID: 100
    Top speed: 15
    Admin1: 9538991097
    Admin2: 9538991096
    Admin3: 9880899964

    Note: It is also possible that you will get a \n (newline) or a \r\n (CRLF), but since you did not save the actual data you VI, I can't be sure.

  • Help for synchronize Treo90 with Outlook 2003

    I recently changed employers and my very old but faithful Treo90 made the trip with me.  I use my Treo90 with Windows XP Pro and Outlook 2003 SP3 and HotSync Manager 4.0.1.  When I try to complete my first sync on my new laptop, the process begins, and then my system crashes (blue screen).  Do not forget what happens to my employer, I know not what IT done to rememdy, people so I turn here for help.  Is there a later version of HotSync Manager that I should install?  Thanks in advance.

    Hello

    I can't really remember the treo 90

    should I use a port serila and you added a USB converter?

    If so,.

    try switching to another USB port,

    try to update the driver of the USB adapter or your USB on your pc

  • Need help for dependent lists with ADF boxes.

    Hello

    I am doing a project that use dependent list of tree areas.
    E.g. State->
    -> College
    List of courses of the College selected above-->

    The way it should work is when I select the State automatically I want to return to the corresponding list of colleges in that State, and as soon as I clicked on the colleges I want to be able to get all the courses that are given in the order.
    To implement the first two list boxes I create trees on JDeveloper and and SelectOneChoice of the State and the colleges. In the link editor I link the first view with the second, then the second point of view with the third and at this stage if I run the first SelectOneChoice would give me the entire State and the second SelectOneChoice could give me the list of schools that exist.

    Now on the third point of view that I create a variable binding and I put a in which indicate =: TheBindingVariable on the query.
    Also I updated the first SelectOneChoice the outoSubmit set to true, id to StateId property and the property of PartialTrigger CollegeId.
    On pageDef.xml in the bindings, I create action shape where I select the third view of Collection Date and select Action as ExecuteWithParams. And I set the value under the parameters section of #{bindings.state.inputValue}.
    Under executable files in pageDef.xml, I have create an invokeAction and I put links = ExecuteWithParams.
    The first SelectOneChoice on the ChangeValueListener I have create a new ManageBeans that generate me a java class and I create a new method as well to use it to change the binding on the second SelectOneChoice variable.

    Here is the method:
    public void Change_StateId (ValueChangeEvent valueChangeEvent) {}

    String StateId;
    valueChangeEvent.setPhaseId (PhaseId.INVOKE_APPLICATION);
    ADI FacesContext = FacesContext.getCurrentInstance ();
    ValueBinding vb = adi.getApplication ().createValueBinding("#{bindings}");
    DCBindingContainer = (DCBindingContainer) vb.getValue (adi) bc;

    {if (valueChangeEvent.getNewValue (). ToString(). Equals("0"))}
    StateId = 'MA ';
    OperationBinding opBindingCollegeLovIter = bc.get("ExecuteWithParams") (OperationBinding);
    opBindingCollegeLovIter.getParamsMap () .put ("TheState", StateId);
    opBindingCollegeLovIter.execute ();
    } else {}
    DCIteratorBinding statesLovIter = (DCIteratorBinding) bc.get("CollegeProvaView1Iterator");
    Line rw = statesLovIter.getRowAtRangeIndex (((Integer) valueChangeEvent.getNewValue ()) .intValue ());
    StateId = (String) rw.getAttribute ("State");
    OperationBinding opBindingCollegeLovIter = bc.get("ExecuteWithParams") (OperationBinding);
    opBindingCollegeLovIter.getParamsMap () .put ("TheState", StateId);
    opBindingCollegeLovIter.execute ();
    }
    }

    I don't know what I did wrong because I am new in this field and a little help would be really useful.

    I use 10.1.3.1.0 JDeveloper and Oracle SOA Suite 10.1.3.1.0.

    I'd appreciate any help.

    Thank you very much.

    Hello

    Is there a particular reason why you can not implement the simplest solution? :

    -create 3 object view (vo1, vo2 vo3)
    -create 2 show links between <->vo1 vo2 and vo2 vo3<->
    detail - insert the display objects in the application as master - detail - module
    -Drag & drop on the page of the range of data such as lists of navigation control
    -set the ID and partial triggers and autosubmit

    Kind regards

    Branislav

Maybe you are looking for

  • I upgraded to el capitan today and I lost all my photos and videos

    When I updated today to el capitan, I lost all my videos and photos, I have improved on the hoof so to speak because I was helping a friend unlock their iPad disabled (as I did) but I shot myself in the foot in iPhoto on the left side, I had file on

  • Restoration of session at startup

    After an upgrade to ubuntu 12.04, whose firefox upgraded to version 39.0, I always get a 'session restore' at startup, and usually I have to start firefox in twice (i.e. the first time nothing happens).If it's relevant, I use NoScript, and I chose to

  • CD drive on my laptop Satellite 1900 working

    I had a computer portable satellite of 1900. Now my CD player does not work as it does not detect the CD in the drive. I tried to uninstall the material and put it back without help. Any ideas/suggestions please? Post edited by: rrvnd I had a similar

  • White line in the status of timecode window - UI glitch

    Here is a screenshot of what I mean. Anyone else get this UI glitch? (white line across the timeode / share status). Thank you!

  • Why did taking HP so long to release the driver n-trig for windows 7?

    I am very disappointed with HP and how they treat their support for Windows 7. I just hope that the delay is not because they add new gestures touch to their multimedia TouchSmart software. Any ideas?