n by m table: select comma seperated m lines

Dear members,

I have something like this:

Table PEOPLE
PK  NAME
1   JOHN
2   JOE
3   JANE
CATEGORIES table
PK  CATEGORY
1   A
2   B
3   C
Table PERSONS_CATEGORIES
PK  PER_FK  CAT_FK
1   1       1
2   1       2
2   2       2
2   3       3
What I would like to have is thus a view gives me this result:
PERSON  CATEGORIES
JOHN    A, B
JOE     B
JANE    C
Thank you in advance!
Best regards
Johann

None of the [url http://www.oracle-base.com/articles/misc/StringAggregationTechniques.php] make these techniques.

(PS. The forums have a link "Search" - very often, you can try to search for your question and find that many before you have asked the same thing and the responses is available ;-))

Tags: Database

Similar Questions

  • using the function - how to use the values of the input variables on the table select statement names

    Hello community, I have a problem when creating a function. The purpose of this function is to check the table of weather gave yesterday or not. We must check this on different tables on different sachems. We are creating a function with input variables.

    CREATE OR REPLACE FUNCTION IN_SCHEMA.IS_YDAYDATA_TO_TABLE

    (

    in_schema IN VARCHAR2,

    in_tablename IN VARCHAR2,

    in_datefield IN VARCHAR2,

    )

    RETURNS INTEGER

    AS

    -Declaring variables

    v_is_true INTEGER.

    BEGIN

    SELECT

    CASE

    WHEN MAX (in_datefield) = TRUNC(SYSDATE-1)

    THEN 1

    ON THE OTHER

    0

    END

    IN

    v_is_true

    Of

    in_schema.in_tablename

    ;

    RETURN v_is_true;

    END;

    /

    When creating, I got error: [error] ORA-00942 (44:19): PL/SQL: ORA-00942: table or view does not exist

    How to use the values of the input variables on the table select statement names?

    Hello

    Here's a way you can use dynamic SQL statements for this task:

    CREATE OR REPLACE FUNCTION IS_YDAYDATA_TO_TABLE

    (

    in_schema IN VARCHAR2,

    in_tablename IN VARCHAR2,

    in_datefield IN VARCHAR2,

    in_first_date DATE DEFAULT SYSDATE - 1,.

    in_last_date DATE by DEFAULT NULL

    )

    RETURNS INTEGER

    AS

    -IS_YDAYDATA_TO_TABLE returns 1 if in_schema.in_tablename.in_datefield

    -contains all the dates in the in_first_date of the range through included in_last_date

    - and it returns 0 if there is no such lines.

    -If in_last_date is omitted, the search only the data on in_first_date.

    -If in_first_date is omitted, it defaults to yesterday.

    -Time parts of the in_first_date and in_last_date are ignored.

    -Declaring variables

    sql_txt VARCHAR2 (1000);

    v_is_true INTEGER.

    BEGIN

    sql_txt: = 'SELECT COUNT (*).

    || 'FROM ' | in_schema | '.' || in_tablename

    || 'WHERE ' | in_datefield | ' > =: d1'

    || «AND» | in_datefield | '< >

    || 'AND ROWNUM = 1';

    dbms_output.put_line (sql_txt |) '= sql_txt in IS_YDAYDATA_TO_TABLE");  -For debugging

    Sql_txt EXECUTE IMMEDIATE

    IN v_is_true

    With the HELP of TRUNC (in_first_date) - d1

    TRUNC (NVL (in_last_date

    in_first_date

    )

    ) + 1                -- d2

    ;

    RETURN v_is_true;

    END is_ydaydata_to_table;

    /

    DISPLAY ERRORS

    If you must use dynamic SQL statements, put all the SQL statement in a single string variable, such as sql_txt in the example above.  In this way, you can easily see exactly what will be executed.  Comment out the call to dbms_output under test is completed.

    Try to write functions that will address not only the question that you have now, but similar questions that you may have in the future.  For example, now that interest you only to the verification of the data of yesterday, but later, you might want to check another day or range of days.  The above function combines the convenience of a function simple (looks like yesterday data if you don't tell him otherwise) with the power of a more complex function (you can use the same function to check any day or range of days).

  • before the "recalled" in the table selected lines

    12.1.3 JDEV

    It is difficult to explain the problem I see. So, I use a page to explain.

    I have a page with a few fields like these. The Magnifier is related to a taskFlowCall.

    PickListFields.jpg

    When click on the magnifying glass, pilot field, a pop-up screen will appear. The user clicks on search and retrieve a few results. The user selects then a few lines of the output. Click OK to close the pop-up window and return the results selected to pilot field.

    PickListPopup.jpg

    Now, the user clicks the magnifying glass on the field of the expedition. a shortcut for sending screen. Search to retrieve a few lines. Notice: two rows on the result table are highlighted when the first returned search results. They seem to be selected, but not really. Now, if the user selects OK to return, the rows returned are empty. The table of results of research somehow 'remember' the previous index of the selected row.

    If the user selects the other lines of the search results table and click OK, the rows selected by the user are returned correctly.

    PickListPopup2.jpg

    These windows two popup called the taskFlowCall even with different input parameter values.

    No idea how to solve this problem?

    Thank you.

    You can try to clear the selected rows from the table in your managed bean and run this code entering into the taskflow.

    RowKeySet ps = this.dynamicTable.getSelectedRowKeys();
    ps.clear();
    AdfFacesContext.getCurrentInstance().addPartialTarget(this.dynamicTable);

    In addition, mention the similar question previously asked: remove highlighting from the selected line in the table

  • Column in the table emp comm

    Hi team,

    Need for a trigger on the table emp comm column is empty it should be set by default at 100 on insert or update.

    Is the below is valid!

    create or replace trigger trig_emp

    After Insert on emp

    referencing new as in the old new old

    Start

    If: new.comm is null then

    : new.comm: = 100;

    end if;

    end;

    Thank you

    Hi, smile,

    try something like this

    create or replace trigger trig_emp
      before insert or update on emp
      referencing new as new old as old
      for each row
    begin
       if :new.comm is null then
          :new.comm := 100;
       end if;
    end;
    

    concerning

    Kay

  • I can't get my calculations right away, even after the selection "commit selected value immediately" on my drop-down menus. Any ideas?

    I can't get my calculations right away, even after the selection "commit selected value immediately" on my drop-down menus. Any ideas?

    The field calculation order is probably not set correctly. The specific configuration procedure it depends on which version of Acrobat you are using. Acrobat 11, you would go first in forms editing mode (Tools > forms > change), and then select:

    Tasks > other tasks > set field calculation order

  • Export tables selected when running

    Hello

    We expect to write export query table in our database to oracle 11 g 2 using EXPDP. We want to include only a set of tables, in the export dump file. This series of paintings, are stored in the main table.

    So, at any time, we do export tables that are out of select table_name from master_table

    Ex: aa/aa@aa expdp tables = "select table_name from tables_to_exp '...

    Yat - der a way to achieve this?


    Thank you!

    851602 wrote:

    Still the same result...

    You cannot use the parameter TABLES in such a way. Use INCLUDE:

    expdp aa/aa@aa include="table:\" in (select table_name from tables_to_exp_owner.tables_to_exp)\""
    

    SY.

  • Table selection listener

    Hello

    I would like to know if there is anything that I can call him #{bindings.myVO.collectionModel.makeCurrent} bean support. Thank you.

    Kind regards

    K.Hein

    See the blog
    http://www.adftips.com/2010/11/ADF-UI-SelectionListener-example-for.html

    or this
    http://www.Oracle.com/technetwork/developer-tools/ADF/learnmore/23-generic-table-selection-listener-169162.PDF

  • problem with text af:table selection

    Hi, I am using Jdev 11.1.1.4.0.

    I noticed that the text in af:table with the selection of power lines don't get selected in IE8, but in Firefox 3.6.x all right.

    What could be the problem?

    Published by: null on 09.02.2011 06:35

    Hello

    Same problem for me. You can post a topic the issue here: Select/point-highlight / copy line in af:table with rowselection in IE

    Stéphane

  • create table as select the number of lines

    Hi s/n,.

    IM using create table select this option to copy the table of which 400 million rows.is there anyway to watch how many lines it is actually processing (copied) as we do by using a query in import.

    You can see if there is something in v$ session_longops.

    You can also monitor the space consumed as dba_segments or dba_extents.

  • A table does not remove the lines

    I created a tabular presentation. I select one or more lines with the line selector. I click the button Delete and you get a warning/confirmation message. I select OK, then refresh the page. I selected the lines are always present.

    I edited the multi-rang button - remove and found that Action of database has been set no Action database, so I changed it to Action SQL DELETE.

    Still not delete.

    What Miss me?

    Hi mdwyer,.

    I edited the multi-rang button - remove and found that Action of database has been set no Action database, so I changed it to Action SQL DELETE.

    No need for the modification of database SQL DELETE action Action, it is correct with no Action from the database.

    I created a tabular presentation. I select one or more lines with the line selector. I click the button Delete and you get a warning/confirmation message. I select OK, then refresh the page. I selected the lines are always present.

    1. check that the request after clicking on delete...

    For example

    JavaScript:apex.confirm (htmldb_delete_message, 'MULTI_ROW_DELETE');

    Here MULTI_ROW_DELETE is passing as request.

    2. change your ApplyMRD process and check the status

    When you press the button: no condition button

    Condition type: request = Expression1

    Expression 1: MULTI_ROW_DELETE

    Check the request that you place the button Delete is same as a condition of the terms of the Expression 1 or not.

    Or better, you can create examples on apex.oracle.com, which helps the user to study and solved the problem.

    If your problem still persists, then try to recreate the form of tables and check.

    Hope this helps you,

    Reg

  • Is it possible to convert the selected text in javascript lines?

    Hi all

    I put a word to indesign cs 5.5 file is almost in a single table, I need to separate the text of the actual tables, is it possible to convert the selected text in javascript lines?

    If there is no way to do that, someone can help me to make a script to cut selected lines and place it in the right holders of the table pointer to make independent table and then convert to text?

    Hey brother,

    Simply select the rows or cells represent the lines and then run this Javascript code snippet:

    for (var r = 0; r < app.selection.length; r++) {
        for (var t = 0; t < app.selection[r].rows.length; t++) {
            for (var u = 0; u < app.selection[r].rows[t].cells.length; u++) {
                for (var c = 0; c < app.selection[r].rows[t].cells[u].paragraphs.length; c++) {
                    app.selection[r].rows[t].cells[u].paragraphs[0].move (LocationOptions.AFTER, app.selection[r].rows[t].parent.parent.storyOffset);
                    if (c < app.selection[r].rows[t].cells[u].paragraphs.length - 1)
                        app.selection[r].rows[t].parent.parent.storyOffset.contents += "\r";
                }
                if (u < app.selection[r].rows[t].cells.length - 1) {
                    app.selection[r].rows[t].parent.parent.storyOffset.contents += "\t";
                }
                else {
                    app.selection[r].rows[t].parent.parent.storyOffset.contents += "\r";
                }
            }
        }
    }
    for (var r = 0; r < app.selection.length; r++) {
        for (var t = app.selection[r].rows.length - 1; t >= 0; t--) {
            app.selection[r].rows[t].remove ();
        }
    }
    
  • 5.6.1 pages: How to create a table with more than 999 lines?

    5.6.1 pages: How to create a table with more than 999 lines?

    The table on Pages v5.6.1 line selector is limited 3-digit, as it is in Pages ' 09 v4.3. Either use LibreOffice Writer, who does not have any constraint line on processing tables 3-digit, or any application spreadsheet for top 3-digit row needs.

  • What is the right way to commit 100,000 lines?

    Hi guys and girls,

    With the help of JDev 11.1.2.3.0.

    I have 10 000 ranks of the master, gave each of them runs in 9 different algorithms, 90 000 detail lines.  I now need to commit the 100,000 (10 000 masters & 90 000 retail) lines to my database.  What is the best way to accomplish this feat?  I am open to suggestions and ideas.  I'm not married to a particular approach, any strategy and have little experience running such a large DataSet.

    Currently, I iterate through the lines view object 10 000 in my application and for each line module, apply a Prediction algorithm, whose results are inserted into an object of the detail view.  The main line of vo is updated with a reference for the best results in detail, and then all have been committed through getDbTransaction.commit ();

    Is there a way to say, commit 10 000 lines, let the database do its thing and once again the calculations?  Once the database did commit, commit an another 10,000.  In this way the module of the application and the database work in parallel rather than one waiting on the other.

    Thoughts?

    Thank you

    Will be

    It looks like that there. Check the Advanced Techniques of object entity - 11 g Release 1 (11.1.1.7.0)

    As far as I know, there is no parallel work (adf and db). What you can do is to use the PL/SQL to insert the data and calculations on the side of the db. This can be faster than to browse all lines in the adf.

    Timo

  • Could not commit: ORA-00928: lack of creating the table SELECT keyword

    Hello guys.
    I tried to create the table with web interface on oracle 11g.

    I just follow this path on interface: schema-> table-> create-> standard (lot organized)-> SQl select on (set using the)->
    and I just use these scripts to create the table:

    CREATE TABLE suppliers
    (the number (10) of supplier_id not null,)
    supplier_name varchar2 (50) not null,
    Contact_Name varchar2 (50)
    );

    but this error occurred: failed to commit: ORA-00928: lack of SELECT key word!
    Please lock on this picture for more information: http://s17.postimg.org/kgoumzmvz/attachment.jpg

    could you help me please?
    and I could not find any manual for working with the web interface in oracle 11g.
    Please give me somesources to start.
    Thank you.

    1003778 wrote:
    Thank you sybrand_b
    but I already read this document.
    Unfortunately, there is nothing on the creation of table with sql scripts in this document!

    and I really don't understand how to create table with SQL commands! My question has not yet been answered.
    you please give me little details about it?
    for example, how can create table using this sql command:

    CREATE TABLE suppliers
    (the number (10) of supplier_id not null,)
    supplier_name varchar2 (50) not null,
    Contact_Name varchar2 (50)
    );

    Thank you.

    Edited by: 1003778 may 3, 2013 11:43

    When you got to the CREATE TABLE screen, you have selected "set using the--> SQL.
    Did you notice in the window that appears, just above this entry field is this text: "enter a SQL * select * statement below.» ' + This query results will be used to fill the table with Canada.* + "(underlining)
    And hip, just to the left of this field is this text: «CREATE TABLE AS»

    He tries to build a ' CREATE TABLE AS SELECT... ». Creates a table with the same structure as the table in which you SELECT and fills with the results of this SELECT '. With your entry, you create a CREATE TABLE AS CREATE TABLE to read statement...

    If you want to create your tables with a simple CREATE TABLE command, go to sqlplus and do it. You want to have a graphical interface to help build a simple CREATE table, when you get to the CREATE TABLE page, just to stay there with the default "use Define-> column specification." If you want, after completing "build" your table specification here, you will have a "Show sql" option to show you the actual sql statement that will be executed to create your table.

  • Get the rank of the table selected in DialogOKAction

    I use JDeveloper 11.1.1.6

    In my example, I have a page fragment that includes a table reading with the button 'Add Row '. When the user clicks on the button 'Add Row', the following will occur:
    1. create the insertion occurs. The KP for this table is generated DB so that it is marked as not necessary in my model.
    2. a popup in windw dialogue form is created asking required data and not need to be completed.

    Now the user enters data and click on the OK button. The OK button calls a method that does the following.
    1 validates the data user and if OK we continue on another that I have send a message to the user to correct the data.
    2. the new line is posted. I must do this so that I can I hope to add value to the PK that is not created by the DB until the validation.

    I have 2 questions:
    1. I need to get this PK value so that I can write a record in a table of audit and also do something else with this value. I can't get that to work.
    2. After all other work, I want to return to the table with the new selected line. I can't get that to work either.


    I have attached the portion of my method in question below this 2 issues. 3 fault code lines are in bold. Could you please provide guidance as what I might want to try.






    BindingContainer lBindings = getBindings();

    now, I'm doing some validation before committing

    Validation of new line... must start now because the primary key is generated DB
    OperationBinding = lOperationBinding
    lBindings.getOperationBinding ("Commit");
    Object lResult = lOperationBinding.execute ();

    Download the new line
    DCIteratorBinding = lIteratorBindings
    (DCIteratorBinding) lBindings.get ("myTable1Iterator");
    ViewObject lVO = lIteratorBindings.getViewObject ();
    VORowImpl Lrowrequired = (VORowImpl) lVO.getCurrentRow ();

    Create and insert the Audit record
    RowIterator lAuditIterator = lRow.getAudit ();
    AuditVORowImpl = lAuditRow
    (AuditVORowImpl) lAuditIterator.createRow ();
    lAuditRow.setId (lRow.getId ()); _*
    set the other fields on the lAuditRow

    Validate the new line of verification
    lOperationBinding = lBindings.getOperationBinding ("Commit");
    lResult = lOperationBinding.execute ();

    refresh the VO
    DCIteratorBinding = lDciter
    (DCIteratorBinding) lBindings.get ("myTable1Iterator");
    Key lCurrentKey = lDciter.getCurrentRow () .getKey (); _*
    lDciter.executeQuery ();

    Define the new line created as the selected line in the table during update
    lDciter.setCurrentRowWithKey (lCurrentKey.toStringFormat (true)); _*

    refresh the page fragment "store Group view.
    AdfFacesContext.getCurrentInstance () .addPartialTarget (this.getTable ());

    User,
    I see two possible things to try.
    1. check the entity behind the new line and make the key attribute "update after inserting" to ensure that you get the key based on the sex of the db.
    2 use a sequence of db and you get the key before inserting the row into the db. Then you know the key.

    One last thing, you should check for errors after executing an operation...

    Timo

Maybe you are looking for

  • Bulk remove all THE Photos from iPhone

    That's enough for me to leave Apple. It is INCREDIBLY complicated. I spent 1/2 hour scouring the internet for the answer. I don't want to hit select 150 times. I want to just DELETE ALL the photos from my iPhone. It might be an easy answer Apple? I t

  • flow binary film

    Can someone explain the difference between movie flow as displayed in statistics of film for example 135kbs for a mp4 movie and throughput Total of the file when get you his info that could be 9765 kbs' Thank you

  • How to get down a Portege 7010 of W2000 in W98?

    I have a 7010 locked with CD in a docking station, Windows-2000 which is bad. I have a W98 CD to rebuild the OS from scratch, but can not find how to start the machine from the CD.

  • Custom installation folder (LV 2009)

    I was instructed to build an installer from a customer for a base of existing code written in LV2009 (windows XP, Vista, 7). The code is not well written and a LOT of hard-coded paths.  I'm not paid to recode, and I would like to avoid that if possib

  • Windows taking back to an earlier date

    Is it possible to get Vista to an earlier date when everything worked well. I think that problems with an update, but I can't uninstall it.