Fusion of multiple lines in a string without loop

Hello

Wanted to know if there is a way we can merge the result set for a query (single column) in a string?
For example, I have the following query, which returns many rows:

SELECT organization_code
OF mtl_parameters
WHERE oganization_id IN (1,2,3)

Lets say the result set for this is:
A
B
C

I want data such as A, B, C

Basically I will be get the organization_ID leave a void diff request. I know that I can do this by using the loop and keep adding the values.
But I wanted to know if there is an easier way to do it.

Hello

You are looking for the aggregation of the chain.
Many examples on this forum and a good summary here:
http://www.Oracle-base.com/articles/Misc/StringAggregationTechniques.php

Tags: Database

Similar Questions

  • Simple question: how to divide the string into multiple lines concatenated?

    Hi people,

    Maybe it's an easy question.

    How to split a string that is concatenated into multiple lines by using the SQL query?

    ENTRY:
    select 'AAA,BBB,CC,DDDD' as data from dual
    Delimiter = ', '.

    Expected results:
    data
    ------------
    AAA
    BBB
    CCC
    DDDD
    I'm looking for something nice to feature "an opposite to «sys_connect_by_path»»

    Thank you
    Tomas
    with t as (select 'aaaa,,bbbb,cccc,dddd,eeee,ffff' as txt from dual)
    -- end of sample data
    select REGEXP_SUBSTR (txt, '[^,]+', 1, level)
    from t
    connect by level <= length(regexp_replace(txt,'[^,]*'))+1
    
    REGEXP_SUBSTR(TXT,'[^,]+',1,LE
    ------------------------------
    aaaa
    bbbb
    cccc
    dddd
    eeee
    ffff
    
  • How to add multiple lines when the button is clicked

    How to add multiple lines when the click on button now is just add a row .plz give me idea how... waiting for answer

    / public final class screen extends MyScreen
    {
    /**
    * Creates a new object of MyScreen
    */
    ObjectChoiceField obj1 obj2, obj3, obj4.
    Table of String() = {'101 ', ' 102'};
    String of shadow [] = {"Shade1", "Shade2"};
    Rolls of string [] = {'101 ', ' 102'};
    String cutting [] = {"100-150", "150-200"};
    Chain of selectedindex1, selectedindex2, selectedindex3, selectedindex4;
    LabelField lbl1 lbl2, lbl3, lbl4;
        
    GFM LinedGridFieldManager;
    HFM HorizontalFieldManager, hfm1, hfm2 hfm3;
    VerticalFieldManager vfmMain;
        
    public MyScreen()
    {
        
    Set the displayed title of the screen
    hfm1 = new HorizontalFieldManager (HorizontalFieldManager.NO_VERTICAL_SCROLL |) HorizontalFieldManager.NO_VERTICAL_SCROLLBAR);
    hfm2 = new HorizontalFieldManager (HorizontalFieldManager.NO_VERTICAL_SCROLL |) HorizontalFieldManager.NO_VERTICAL_SCROLLBAR);
    hfm3 = new HorizontalFieldManager (HorizontalFieldManager.NO_VERTICAL_SCROLL |) HorizontalFieldManager.NO_VERTICAL_SCROLLBAR);
    HFM = new HorizontalFieldManager (HorizontalFieldManager.FIELD_RIGHT);
    vfmMain = new VerticalFieldManager (Manager.NO_VERTICAL_SCROLL |) Manager.NO_HORIZONTAL_SCROLLBAR);
            
    obj1 = new ObjectChoiceField ("", graph, 0, FIELD_LEFT);
    obj2 = new ObjectChoiceField ("", blind, 0, FIELD_LEFT);
    Obj3 = new ObjectChoiceField ("", rolls, 0, FIELD_LEFT);
    Obj4 = new ObjectChoiceField ("", cuts, 0, FIELD_LEFT);
            
    LBL1 = new LabelField("");
    LBL2 = new LabelField("");
    lbl3 = new LabelField("");
    lbl4 = new LabelField("");
            
    ButtonField btnAdd = new ButtonField ("ADD", FIELD_RIGHT);
            
    GFM = new LinedGridFieldManager (4, LinedGridFieldManager.VERTICAL_SCROLL);
            
    hfm1.setMargin (20, 0, 10, 0);
    hfm1. Add (new LabelField ("Chart"));
    hfm1. Add (obj1);
    hfm1. Add (new LabelField ("Shade"));
    hfm1. Add (obj2);
            
    hfm2. Add (new LabelField ("Rolls"));
    hfm2. Add (Obj3);
    hfm2. Add (new LabelField ("Cuts"));
    hfm2. Add (Obj4);
    HFM. Add (btnAdd);
            
    GFM. Add (new LabelField ("Chart"));
    GFM. Add (new LabelField ("Shade"));
    GFM. Add (new LabelField ("Rolls"));
    GFM. Add (new LabelField ("Cuts"));
            
    vfmMain.add (hfm1);
    vfmMain.add (hfm2);
    vfmMain.add (hfm3);
    vfmMain.add (hfm);
    vfmMain.add (new SeparatorField());
    vfmMain.add (gfm);
    Add (vfmMain);
            
    btnAdd.setChangeListener (new FieldChangeListener()
    {
    ' Public Sub fieldChanged (field field, int context) {}
    TODO self-generating method stub
    selectedindex1 = chart [obj1.getSelectedIndex ()];
    selectedindex2 = shade [obj2.getSelectedIndex ()];
    selectedindex3 = rolls [obj3.getSelectedIndex ()];
    selectedindex4 = cuts [obj4.getSelectedIndex ()];
                    
    While (LBL1. GetText(). Equals("") | LBL2. GetText(). Equals("") | lbl3. GetText(). Equals("") | lbl4. GetText(). Equals(""))
    {
    LBL1. SetText (selectedindex1);
    LBL2. SetText (selectedindex2);
    lbl3. SetText (selectedindex3);
    lbl4. SetText (selectedindex4);
                    
    GFM. Add (LBL1);
    GFM. Add (LBL2);
    GFM. Add (lbl3);
    GFM. Add (lbl4);
                    
    }
    }
    });
    }
    }

    Hi Piya,

    I run your code, and according to your logic that it works correctly.

    It's adding that line only once because according to your logic that one line can be added to MDT, if you do not want to add line on each click on the button, follow these steps:

    selectedindex1 = chart [obj1.getSelectedIndex ()];
    selectedindex2 = shade [obj2.getSelectedIndex ()];
    selectedindex3 = rolls [obj3.getSelectedIndex ()];
    selectedindex4 = cuts [obj4.getSelectedIndex ()];

    Lbl1 LabelField = new LabelField("");
    Lbl2 LabelField = new LabelField("");
    LabelField lbl3 = new LabelField("");
    LabelField lbl4 = new LabelField("");
    If (LBL1. GetText(). Equals("") | LBL2. GetText(). Equals("") | lbl3. GetText(). Equals("") | lbl4. GetText(). Equals(""))
    {
    LBL1. SetText (selectedindex1);
    LBL2. SetText (selectedindex2);
    lbl3. SetText (selectedindex3);
    lbl4. SetText (selectedindex4);
                    
    GFM. Add (LBL1);
    GFM. Add (LBL2);
    GFM. Add (lbl3);
    GFM. Add (lbl4);
                    
    }

  • Problem with drag and drop multiple lines of ListView

    I work on an example application with 2 views of list that is the players and the team and implement drop and drop as players can be deposited to one list to the other. Everything works as expected when there is selection unique model is enabled in the source list view. However, if I have activated several model selection and drag 2 or more lines of source target list view list view, see the following exception after that the decline is over.

    Exception:

    java.lang.IllegalArgumentException: only objects serializable or ByteBuffer can be used as data with the format of data [subListPlayers]

    at com.sun.javafx.tk.quantum.QuantumClipboard.putContent(QuantumClipboard.java:513)

    at javafx.scene.input.Clipboard.setContent(Clipboard.java:230)

    (1) what should be the DataFormat used to be able to drag and drop multiple lines? Looks like we don't have for the type of object, so I created the following which does not solve the problem.

    private DataFormat dataFormat = new DataFormat ("subListPlayers");

    (2) I made changes to support serialization on the data object that seems no more to solve the problem. Tried by implementing the interface Serializable, as well as the implementation of the Externalize interface.

    Can someone Guide please if there is an easy way to implement this behavior?

    Code:

    
    

    public class player

    {

    private String name;

    public player (String name)

    {

    myIdName = name;

    }

    public String getName()

    {

    return the name.

    }

    public void setName (String name)

    {

    myIdName = name;

    }

    @Override

    public boolean equals (Object o)

    {

    If (this == o) return true;

    If (o == null | getClass()! = o.getClass ()) return false;

    A player = o (player);

    If (name! = null? name.equals (player.name): player.name! = null) return false;

    Returns true;

    }

    @Override

    public int hashCode()

    {

    return the name of! = null? name.hashCode (): 0;

    }

    }

    SerializableAttribute public class JavaFXDnDApplication extends Application

    {

    private final static ListView < drive > playersListView = new ListView < drive > ();

    private final static ObservableList < drive > /playerslist is FXCollections.observableArrayList ();.

    private final static ListView < drive > teamListView = new ListView < drive > ();

    private final static GridPane rootPane = new GridPane();

    private DataFormat dataFormat = new DataFormat ("subListPlayers");

    Public Shared Sub main (String [] args)

    {

    Launch (args);

    }

    @Override

    public void start (point primaryStage)

    {

    primaryStage.setTitle ("Drag and Drop Application");

    initializeComponents();

    initializeListeners();

    buildGUI();

    populateData();

    primaryStage.setScene (new scene (rootPane, 400, 325));

    primaryStage.show ();

    }

    Private Sub initializeListeners()

    {

    playersListView.setOnDragDetected (new EventHandler < MouseEvent >)

    {

    @Override

    public void handle (event MouseEvent)

    {

    System.out.println ("setOnDragDetected");

    Dragboard dragBoard = (TransferMode.MOVE) playersListView.startDragAndDrop;

    ClipboardContent content = new ClipboardContent();

    content.putString (playersListView.getSelectionModel () .getSelectedItem () .getName ());

    Content.put (dataFormat, playersListView.getSelectionModel () .getSelectedItems ());

    dragBoard.setContent (content);

    }

    });

    teamListView.setOnDragOver (new EventHandler < DragEvent >)

    {

    @Override

    public void handle (DragEvent dragEvent)

    {

    dragEvent.acceptTransferModes (TransferMode.MOVE);

    }

    });

    teamListView.setOnDragDropped (new EventHandler < DragEvent >)

    {

    @Override

    public void handle (DragEvent dragEvent)

    {

    String player = dragEvent.getDragboard () .getString ();

    ObservableList < drive > drive = dragEvent.getDragboard () .getContent (dataFormat) (< drive > ObservableList);

    String player = dragEvent.getDragboard () .getString ();

    teamListView.getItems () .addAll (New Player (player));

    playersList.remove (new Player (player));

    dragEvent.setDropCompleted (true);

    }

    });

    }

    Private Sub buildGUI()

    {

    rootPane.setGridLinesVisible (true);

    rootPane.setPadding (new Insets (10));

    rootPane.setPrefHeight (30);

    rootPane.setPrefWidth (100);

    rootPane.setVgap (20);

    rootPane.setHgap (20);

    rootPane.add (playersListView, 0, 0);

    rootPane.add (teamListView, 1, 0);

    }

    Private Sub populateData()

    {

    () playersList.addAll

    New Player("Adam"), New Player("Alex"), Player ("Alfred") New Player("Albert") new,.

    New Player("Brenda"), New Player("Connie"), Player ("Derek") new new Player ("Donny").

    Player ("Lynne") new, New Player ("Myrtle"), Player ("pink") New Player("Rudolph") new,.

    Player("Tony") new, New Player ("Trudy"), Player ("Williams") New Player ("Zach") new

    );

    playersListView.setItems (playersList);

    }

    Private Sub initializeComponents()

    {

    playersListView.setPrefSize (250, 290);

    playersListView.setEditable (true);

    playersListView.getSelectionModel () .setSelectionMode (SelectionMode.MULTIPLE);

    playersListView.setCellFactory (new reminder < < drive > ListView, ListCell < drive > > ())

    {

    @Override

    public call for ListCell < drive > (ListView < drive > playerListView)

    {

    return again ListCell < drive >)

    {

    @Override

    protected void updateItem (player, boolean b)

    {

    super.updateItem (reader, b);

    If (player! = null)

    {

    setText (player.getName ());

    }

    }

    };

    }

    });

    teamListView.setPrefSize (250, 290);

    teamListView.setEditable (true);

    teamListView.getSelectionModel () .setSelectionMode (SelectionMode.MULTIPLE);

    teamListView.setCellFactory (new reminder < < drive > ListView, ListCell < drive > > ())

    {

    @Override

    public call for ListCell < drive > (ListView < drive > playerListView)

    {

    return again ListCell < drive >)

    {

    @Override

    protected void updateItem (player, boolean b)

    {

    super.updateItem (reader, b);

    If (player! = null)

    {

    setText (player.getName ());

    }

    }

    };

    }

    });

    }

    }

    
    

    Yes, it is a pain. I filed https://javafx-jira.kenai.com/browse/RT-29082 earlier. Go ahead and vote in favour if you're inclined...

    I think that the problem in your case, it is the observable list provided by MultipleSelectionModel.getSelectedItems () is not serializable. So even if you make your player Serializable class, the list is not. The first thing I would try, I think, is to make player implements Serializable and pass in an ArrayList instead of the observable list. If you can do

    content.put(dataFormat, new ArrayList(playersListView.getSelectionModel().getSelectedItems()));
    

    and

    List player = (List) dragEvent.getDragboard().getContent(dataFormat);
    teamListView.getItems().addAll(player);
    

    If it does not, a solution is simply to store the "slipped" into a property list:

    final ListProperty draggedPlayers = new SimpleListProperty();
    //...
    // Drag detected handler:
    content.putString("players");
    draggedPlayers.set(playersListView.getSelectionMode().getSelectedItems());
    
    // Drag dropped handler:
    if (dragboard.hasString() && dragboard.getString().equals("players")) {
         teamListView.getItems().addAll(draggedPlayers.get());
         draggedPlayers.set(null);
    }
    
  • Table column name wants to be on multiple lines

    Hello

    My requirement is the name of the column in the table should be displayed in multiple lines.

    (Ex: * "FirstName" * is the name of the column, I want to show that in the)

    *' First *.
    Name of '

    instead of "first name")

    And we must not change the width of the table or column.

    Can someone give me suggestion on this subject?

    Thanks in advance.

    Hello

    Can we have somewhat without changing the column width?

    -Why. ? is your getting any question...

    Set the column width, there is no point property width...@column in the page.

    Concerning
    Meher Irk

    Published by: Meher Irk December 30, 2010 19:24

  • Frame content with multiple lines of text

    Hello

    In Indesign CS5 (Mac) is possible to get the same behavior as 'To adapt to the content Frame' pieces on a single line of text, to work with multiple lines?

    In other words, to adapt the framework to the height AND width of the text.

    We have black text and the text block has a fill and a stroke. What we are trying to achieve is to be able to quickly and accurately, resize it framework for however many lines it takes place in. By using the default behavior, so that we can use "mount the frame to the content" to get the height, but we need to manually drag the width.

    Thank you

    Try this (CS4/CS5):

    // Your Settings:
    var X_PRECISION = .1;     // pts
    
    // Some constants
    var     INNER = CoordinateSpaces.INNER_COORDINATES,
         MULTIPLY = ResizeMethods.MULTIPLYING_CURRENT_DIMENSIONS_BY,
         ADDTO = ResizeMethods.ADDING_CURRENT_DIMENSIONS_TO,
         AP_LEFT = AnchorPoint.TOP_LEFT_ANCHOR,
         AP_RIGHT = AnchorPoint.TOP_RIGHT_ANCHOR;
    
    function fitHorizontal(/*TextFrame*/ tf, /*str*/xRef)
    //----------------------------------------------------------
    // Fits a textframe width to its content
    // = adjusts the frame width to the optimal value without changing the height
    // xRef (opt.) is the reference pt: 'left'(default) | 'right' | 'center'
    // * You may invoke first tf.fit(FitOptions.FRAME_TO_CONTENT), i.e. fitVertical
    // * This routine supports rotated text frame
    // * Also, unlike the InDesign UI, this supports *multicolumn* TF
    //----------------------------------------------------------
    {
         // Default width multiplier. This value is only used if
         // tf overflows in its initial state. 1.5 is fine, usually.
         var X_FACTOR = 1.5;
    
         var ovf = tf.overflows,
              dx;
    
         xRef = AnchorPoint['TOP_'+(xRef||'left').toUpperCase()+'_ANCHOR'];
    
         // If tf originally overflows, we need to increase the width
         while( tf.overflows ) tf.resize(INNER,xRef,MULTIPLY,[X_FACTOR,1]);
    
         // Now, let's compute the maximal width variation (dx)
         dx = tf.resolve(AP_RIGHT, INNER)[0][0]-tf.resolve(AP_LEFT, INNER)[0][0];
         if( ovf ) dx *= (1-1/X_FACTOR);
    
         // Dichotomy on dx
         while( dx > X_PRECISION )
              {
              dx*=.5;
              tf.resize(INNER,xRef,ADDTO,[dx*(tf.overflows?1:-1),0]);
              }
    
         // Last step, if needed
         if( tf.overflows ) tf.resize(INNER,xRef,ADDTO,[dx,0]);
    }
    
    //----------------------------------------------------------
    // Sample code
    //----------------------------------------------------------
    
    // Assuming the user has selected a text frame
    var tf = app.selection[0];
    
    // Vertical fit (if you want it first --but not needed)
    tf.fit(FitOptions.FRAME_TO_CONTENT);
    
    // Horizontal fit (from the left edge)
    fitHorizontal(tf, 'left');
    

    @+

    Marc

  • Data in multiple lines concatenated into a single line to separate id

    Hello

    I have a t1 like this table:

    create table t1
    (number of c1,
    number of C2,
    C3 number (4.2)
    );

    Data in the table are such as:

    ----------------------------------------
    C1 | C2 | C3 |
    -----------------------------------------
    102. 1. 1.1 |
    102. 1. 1.2 |
    102. 2. 2.1 |
    103. 2. 2.1 |
    103. 2. 2.2 |
    -----------------------------------------

    How to display data by using a query above?

    ------------------------------------------------------
    C1 | C2 | C3 |
    -------------------------------------------------------
    102. 1, 2 | 1.1, 1.2, 2.1 |
    103. 2. 2.1, 2.2.
    ------------------------------------------------------

    Thank you

    So you're after what we call 'Aggregation in the chain.'

    Check this link as it highlights several techniques:

    Aggregation of string techniques

    A Re: Concat ranks of the values in a single column Michael

    At Re: multiple lines in a single line in the 'single column Table' followed by reason of Billy on the conduct of a stragg first.

    In addition, 11 GR 2 has the LISTAGG function.

  • multiple lines of text on a command button

    Is it possible to get multiple lines of text on a command button.  Instead of a large button with the text "start the Test System".  I would like a big button with 3 lines.

    Beginning

    Test

    System

    If you change the label of the button control in IUR editor you can split the text into lines with Ctrl + Enter.

    If you programmatically set the label, "\n" code integration in the text of the label.

    Both methods work for all types of control, not only for the command buttons.

  • Display multiple lines of data collection defined by the user in an e-mail message

    I created a collection defined by the user that displays several lines of data. I created a custom rule and have linked this collection set by the user to this rule and configure an e-mail action. Variable Seveity, I have defined it in the rule to contain the column values. But it will only contain the first line of data. How can I display multiple lines of data in the alarm itself as well as the e-mail? Any help is appreciated.

    The example query in the collection defined by the user is less;

    Select the type, status, queuename, count (*) from PSAPMSGPUBHDR

    Union

    Select the type, status, queuename, count (*) from PSAPMSGPUBCON

    Union

    Select the type, status, queuename, count (*) from PSAPMSGSUBCON

    Result:

    Number of status type Queuename

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

    HDR profil_utilisateur error 1

    PUB                  PERSON_BASIC                    New                                 4

    PUB WORKFORCE_SYNC error 1

    -3 rows

    I have defined the variables of gravity and the alarm message is something like this; (It is fetching only the first row of data) how do I loop through to get all the rows of data and display it in the message of alarm/email (alert) action must be written of the groovy script code to achieve this goal? If Yes can you please provide me examples?

    Alarm message:

    "Request message queue is:

    Type: @UDC_type

    QueueName: @UDC_queuename

    Status: @UDC_status

    County: @UDC_count

    Thanks in advance

    JAI

    Hi Jay,.

    fine I could help you. Please mark the thread as "Answered" when the issue has been resolved and do not hesitate to open a new thread for questions.

    Concerning

    Jochen

  • Arrange the tiles in a column, but multiple lines

    When you have the tiles on The start screen of Metro , you can set the group / block a tile only, but when you want to add the second tile to this group / block, you can put only horizontally (from left or right tile existed), in other words, you can add the column within that group, but you can put the new Tile vertically , under a tile already existence.

    I want to define group / block of tiles with a single column, but multiple lines.
    For example, instead of this:
    xx xx xx    xx
    xx          xx    xx
    to get this:
    xx x xx    xx
    xx x xx    xx
    Screenshot:

    Hi Mike b. II.

    It's normal. You cannot have tiles in groups vertically. Now in your case, if you change the tiles to large tiles, they will stack vertically.

  • Combine multiple lines into one line (from two tables / result sets)

    Hello experts,

    I would like to know how to combine multiple lines/records in a single record. Here are the DDL and DML to tables:

    create table test_table)

    client_name varchar2 (50 char),

    login_time timestamp (6).

    logout_time timestamp (6).

    auto_type varchar2 (10 char)

    )

    create table root_table)

    navigation_time timestamp (6).

    client_name varchar2 (50 char),

    VARCHAR2 (50 char) nom_du_groupe

    )

    Insert into test_table

    values ("John", TO_TIMESTAMP ('2013-12-05 17:04:01.512 ',' YYYY-MM-DD HH24:MI:SS.)) FF'), TO_TIMESTAMP ('2013-12-05 17:27:31.308 ',' YYYY-MM-DD HH24:MI:SS.) FF'), 'SIMPLE');

    Insert into test_table

    values ('David', TO_TIMESTAMP ('2013-12-05 06:33:01.308 ',' YYYY-MM-DD HH24:MI:SS.)) FF'), TO_TIMESTAMP ('2013-12-05 06:45:01.112 ',' YYYY-MM-DD HH24:MI:SS.) FF'), 'SIMPLE');

    insert into root_table

    values (TO_TIMESTAMP ('2013-12-05 17:04:01.512 ',' YYYY-MM-DD HH24:MI:SS.)) FF'), 'John', "invalid");

    insert into root_table

    values (TO_TIMESTAMP ('2013-12-05 17:14:22.333 ',' YYYY-MM-DD HH24:MI:SS.)) FF'), 'John', "GROUP_1");

    insert into root_table

    values (TO_TIMESTAMP ('2013-12-05 17:27:31.308 ',' YYYY-MM-DD HH24:MI:SS.)) FF'), 'John', "GROUP_1");

    insert into root_table

    values (TO_TIMESTAMP ('2013-12-05 06:33:01.308 ',' YYYY-MM-DD HH24:MI:SS.)) FF'), "David", "invalid");

    insert into root_table

    values (TO_TIMESTAMP ('2013-12-05 06:45:01.112 ',' YYYY-MM-DD HH24:MI:SS.)) FF'), 'David', 'GROUP_5');

    game results test_table

    client_name

    login_time logout_time auto_typeJohn05/12/2013 5:04:01.512000 PM05/12/2013 5:27:31.308000 PMSIMPLEDavid05/12/2013 6:33:01.308000 AM05/12/2013 6:45:01.112000 AMSIMPLE

    root_table result set

    navigation_time client_name GroupName
    05/12/2013 5:04:01.512000 PMJohnNot valid
    05/12/2013 5:14:22.333000 PMJohnGROUP_1
    05/12/2013 5:27:31.308000 PMJohnGROUP_1
    05/12/2013 6:33:01.308000 AMDavidNot valid
    05/12/2013 6:45:01.112000 AMDavidGROUP_5

    And here is the SQL code I'm writing:

    Select a.customer_name, a.login_time, a.logout_time, a.auto_type, Max (b.group_name)

    from test_table a, b root_table

    where a.customer_name = b.customer_name

    Group of a.customer_name, a.login_time, a.logout_time, a.auto_type

    As the 'invalid' value is greater than the value "GROUP_1" (based on the number of letter in English), the GroupName is returned as 'invalid '. I want to bring the GroupName based on the navigation_time column in the root_table so that it always returns a valid GroupName. Please help me.

    Output current:

    Client_name.      Login_Time.     Logout_Time |     Auto_Type |     GroupName

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

    John |     05/12/2013 5:04:01.512000 PM |     05/12/2013 5:27:31.308000 PM |     SIMPLE |     Not valid

    David |     05/12/2013 6:33:01.308000 AM |     05/12/2013 6:45:01.112000 AM |     SIMPLE |     Not valid

    Expected results:

    Client_name.      Login_Time.     Logout_Time |     Auto_Type |     GroupName

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

    John |     05/12/2013 5:04:01.512000 PM |     05/12/2013 5:27:31.308000 PM |     SIMPLE |     GROUP_1

    David |     05/12/2013 6:33:01.308000 AM |     05/12/2013 6:45:01.112000 AM |     SIMPLE |     GROUP_5

    Thank you!

    Adding INSERT statements, current and planned outputs.

    This...

    SELECT client_name

    login_time,

    logout_time,

    auto_type,

    GroupName

    Of

    (select a.customer_name,

    a.login_time,

    a.logout_time,

    a.auto_type,

    b.group_name,

    ROW_NUMBER() over (PARTITION BY a.customer_name, a.login_time, a.logout_time, a.auto_type ORDER BY b.group_name) rn

    from test_table a, b root_table

    where a.customer_name = b.customer_name)

    WHERE rn = 1;

    OUTPUT:-

    =========

    David DECEMBER 5, 13 06.33.01.308000000 AM DECEMBER 5, 13 06.45.01.112000000 AM SIMPLE GROUP_5
    John DECEMBER 5, 13 05.04.01.512000000 PM DECEMBER 5, 13 05.27.31.308000000 PM SIMPLE GROUP_1

    Thank you

    Ann

  • View multiple lines inside a loop

    Hi all

    I have a question.

    My table xx_test_table has 10 columns, 3 of which are status, error_message and request_id.

    Now, after some validations on querying the table with the request_id it gives 3 rows.

    I have to post this in a loop. The code I used is the following.

    BEGIN

    SELECT COUNT (*)

    IN lv_error_count

    OF xx_test_table

    WHERE request_id = 5920135;

    IF(lv_error_count > 0) THEN

    fnd_file. Put_line (fnd_file. OUT, 'xx_test_table error information Table');

    FOR lv_disp_data in 1... lv_error_count LOOP

    SELECT column_name,

    ERROR_MESSAGE,

    request_id,

    table-name

    BY lv_column_name,

    lv_error_message,

    lv_request_id,

    lv_table_name

    OF po_interface_errors

    WHERE request_id = lv_req_id;

    fnd_file. Put_line (fnd_file. OUT,' request ID: ' | lv_request_id);

    fnd_file. Put_line (fnd_file. OUT,' column name: ' | lv_column_name);

    fnd_file. Put_line (fnd_file. OUT, "Error Message: ' |" lv_error_message);

    fnd_file. Put_line (fnd_file. OUT,' the name of the Table: ' | lv_table_name);

    END LOOP;

    END IF;

    . This loop is inside a separate procedure and all the variables have been declared. Problem is when the API is run at the front end it illustrates TOO_MANY_ROWS exceptions to this procedure.

    Is there another way to display multiple lines of data in a table when we Select in the statement?

    This should make the necessary

    BEGIN
           SELECT COUNT(*)
             INTO lv_error_count
             FROM xx_test_table
            WHERE request_id = 5920135;
    
           IF(lv_error_count > 0) THEN
    
              fnd_file.PUT_LINE(fnd_file.OUTPUT,'Error Information from xx_test_table Table');
    
              FOR rec IN ( SELECT column_name,
                                  error_message,
                                  request_id,
                                  table_name
                             FROM po_interface_errors
                            WHERE request_id = lv_req_id
                         )
              LOOP
                   fnd_file.PUT_LINE(fnd_file.OUTPUT,'Request ID:    '||rec.column_name);
                   fnd_file.PUT_LINE(fnd_file.OUTPUT,'Column Name:   '||rec.error_message);
                   fnd_file.PUT_LINE(fnd_file.OUTPUT,'Error Message: '||rec.request_id);
                   fnd_file.PUT_LINE(fnd_file.OUTPUT,'Table Name:    '||rec.table_name);
              END LOOP;
           END IF;
    END;
    /
    

    Concerning

    Arun

  • Is possible to write the INSERT statement that fills two columns: 'word' and 'sense' of the file text with multiple lines - in each line is followed word that is the meaning?

    Is possible to write the INSERT statement that fills two columns: 'word' and 'sense' of the file text with multiple lines - in each line is followed word that is the meaning?

    Hello

    2796614 wrote:

    Is possible to write the INSERT statement that fills two columns: 'word' and 'sense' of the file text with multiple lines - in each line is followed word that is the meaning?

    Of course, it is possible.  According to what the text file looks like to, you can create an external table that treats the text file as if it were a table.  Otherwise, you can always read the file in PL/SQL, using the utl_file package and INSERT of PL/SQL commands.

    You have problems whatever you wantt?  If so, your zip code and explain what the problem is.

    Whenever you have any questions, please post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and the exact results you want from these data, so that people who want to help you can recreate the problem and test their ideas.  In this case, also post a small sample of the text involved file.

    If you ask about a DML operation, such as INSERT, then INSERT statements, you post should show what looks like the tables before the DML, and the results will be the content of the table changed after the DML.

    Explain, using specific examples, how you get these results from these data.

    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: Re: 2. How can I ask a question on the forums?

  • Compare the column values for multiple lines

    I am new to oracle and I have a requirement to compare the values of column across multiple lines.  If all column values are the same, I want to display that value, if the columns are not the same, I need to display 'no match' as value.   I need id to group values and display a status value based on the above logic.   Can anyone offer assistance with dispalying the result expected below?

    Sample

    Table

    State ID

    1         S

    2         L

    1         S

    2          S

    expected results

    State ID

    1         S

    2 no match


    Hello

    That's what you asked for:

    SELECT id

    CASE

    WHEN COUNT (DISTINCT status) > 1

    THEN "no match."

    For ANOTHER MIN (status)

    The END as status

    T

    GROUP BY id

    ;

    Want that if each State ID is NULL?  The CASE expression above returns NULL in this situation.

  • merge multiple lines in a row (but multiple columns)

    How to merge multiple lines in a row (but several columns) effectively.

    For example

    IDVal IDDesc Id_Information_Type Attribute_2 Attribute_3 Attribute_4 Attribute_5 Attribute_1 IdNum
    23 asdc 1 location USA NM ABQ four seasons 87106
    23 asdc 1 Stats 2300 91.7 8.2 85432
    23 asdc 1 Audit 1996 June 17 1200
    AAFC 65 2 location USA TX AUS Hilton 92305
    65 AAC 2 Stats 5510 42.7 46 9999
    AAFC 65 2 Audit 1996 July 172 1100


    where different attributes mean different for each Information_type.
    For example, for Information_Type = location
    Attribute_1: countries
    Attribute_2: State and so on.


    For example, for Information_Type = Stats
    Attribute_1 designates the Population
    Attribute_2: percentage of ethnicity American and so on.

    I want to create a view that shows as below:

    IDVal IDDesc IDNum country state city hotel ZipCode American Population % other % area Audit year Audit AuditMonth Type AuditTime
    23 asdc 1 USA NM ABQ reviews 87106 2300 91.7 46 85432 1996 June 17 1200
    AAFC 65 2 USA TX AUS Hilton 92305 5510 42.7 46 9999 1996 July 172 1100


    Thank you

    Hello

    This is called pivoting . The FAQ forum has a section on this subject: {message identifier: = 9360005}

    I hope that answers your question.
    If not, post your best attempt, as well as some examples of data (CREATE TABLE and INSERT, only relevant columns instructions) and also publish outcomes from these data. (See you the desired results, but they are very difficult to read because they are not formatted. Use \.

     tags, as described in the forum FAQ, below.)
    Explain, using specific examples, how you get the results you want from the data given.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).  This is always important, but especially so with pivots.
    See the forum FAQ {message:id=9360002}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    

Maybe you are looking for

  • Satellite M30-chip Bios - where to buy?

    HelloI have a really serious problem. A few days ago I tried to do an update of the BIOS with the intent to fix some bugs. Unfortunately, there was a power failure that crashed my phone. I am shure that I have ki * led Bios... The problem is, that my

  • Windows 7 and 8 dual boot

    Hi, I receive a TouchSmart from HP Envy 15-j023sa for Christmas. http://www.johnlewis.com/hp-envy-touchsmart-15-j023sa-laptop-intel-core-i5-4gb-ram-1tb-15-6-touch-sc.... If I had to choose between Windows 7 and 8, I would prefer 8 to the Appstore, an

  • product registrationunable for register AXC - 603G

    For the past 2 days, I tried to register my computer AXC - 603G with windows 8.1 with no result. Had no problem with my AXC - 605G with Windows 7 above. When I try something else, he said that SN is not placed on the record. I have no account ny prob

  • Windows 7 Professional installation CD on the old windows xp machine

    How long does it take? is there some intervals where the data should be entered in the machine? thing that the product key must be put in?  I appreciate any help, I am familiar with this process.

  • My Toshiba laptop webcam does not work.

    Original title: WEB CAM MY TOSHIBA LAP TOP WEBCAM DOES NOT. PLS HELP ME SOLVE THIS PROBLEM