A hierarchical report query SQL formatting to display the output as a tree

4.2.1

THM:2

Hello world

I have a simple request which when I run it should show in a tree like structure as seen in this link

Hierarchical queries in Oracle SQL

Any ideas on how I can get this output show upward in an area of report page apex? I tried to put it in a classic report, and it shows just all in one line given the length and spacing. I don't want to use the tree for this.

Thank you!

Ryansun-Oracle wrote:

I have a simple request which when I run it should show in a tree like structure as seen in this link

Hierarchical queries in Oracle SQL

Any ideas on how I can get this output show upward in an area of report page apex? I tried to put it in a classic report, and it shows just all in one line given the length and spacing. I don't want to use the tree for this.

I found that the standard reports and report templates are not really useful in this situation.

According to exactly how it should be used, you might want to watch a dynamic list using one of the models of hierarchical list, but I tend to use this Tyler Muth & Rob Van Wijk. This can be used in a region in connection with a column named custom report template.

Tags: Database

Similar Questions

  • SQL: how to display the second string of the function in the Jobs table only if the function has more than one string.

    SQL: how to display the second string of the function in the Jobs table only if the function has more than one string.

    Hello

    You can use REGEXP_SUBSTR Oracle/PLSQL: REGEXP_SUBSTR function

    Select the function double REGEXP_SUBSTR('PUBLIC RELATION REPRESENTATIVE ','[^]+',1,2);

    Do you have any value of the column as no 2nd string?

  • How to use a parameter query to select and display the data in the table of the façade

    Hiiiiii

    I am using Access 2007 database
    I want to select the specific data in the database using control of the chain as 'select product, size, weight of ProductInfo where barcode (chain control) =?'  and also display the same table of façade.

    I use the connected database toolkit.
    I saw the example of the parameterized insert, but it did not help to use parameterized select query, as well as to display data of parameterized select query.

    I looked for example on parameterized select query, but I don't have any.
    So pls guide me how to do this. I would like to know the other method (if any) that the use of parameter query to perform the same thing.
    If possble pls share a vi reference.
    Thank you!!!

    HII szewczak
    Thanks for the reply
    but I did not getsolution in one of your shared links
    My problem is solved. There is no need to use the parameter query to select control values
    In my case I want to display data from database where bar code is even entered by the user
    I use the data function DB TOOL CHOOSE and create the condition of chain based on concatenation of strings

  • Query results pane should display the entire XML following the execution of the query

    Hi, I'm trying to get the xml output results returned in sqldeveloper returned in full.

    they are truncated to.

    I tried the trick / * xml * / but that is implemented in the form xml cdata codes and other structures of nickname.

    Select xmlserialize (DOCUMENT

    XMLELEMENT ("root",

    XMLAttributes ('http://www.millicom.com' as 'xmlns'),

    XMLAGG)

    XMLELEMENT ("line",

    XMLFOREST (U.username,

    U.user_id,

    U.PASSWORD,

    U.ACCOUNT_STATUS,

    U.LOCK_DATE,

    U.EXPIRY_DATE,

    U.DEFAULT_TABLESPACE,

    U.TEMPORARY_TABLESPACE,

    U.CREATED,

    U.PROFILE,

    U.INITIAL_RSRC_CONSUMER_GROUP,

    U.EXTERNAL_NAME,

    U.PASSWORD_VERSIONS,

    U.EDITIONS_ENABLED,

    U.AUTHENTICATION_TYPE)))

    AS CLOB DASH)

    from dba_users U

    CROSS JOIN (select 1 of the double connect by level < = 10);

    Thanks for any help you can offer.


    JM

    Hi jm,

    In the line of query results, did scroll all the way to the right, then click twice on the «...» "at the end of the line to open the cell editor?

    So again, who does not show all the XML, it may be a problem with the version of the ojdb6.jar in use (11.2.0.3 client or later is required), or whether or not the JDBC OCI/thickness is used.  Read the following discussion: retrieve XMLTYPE based on very slow saved schema

    Kind regards

    Gary

    SQL development team

  • How to display the output of query clause?

    Hello. I use Forms Developer 10g. I have a datablock that uses a from_clause_query. In my from_clause_query, I used a WITH AS SELECT.
    I try to view the output of this query in my forms but the first column, V_CUTOFF_TO not displayed, probably because it is not a database element. It was a result of my initial query WITH AS SELECT month. How can I view this with the release of my from_clause_query. Thanks in advance for the help. Moreover, I am trying to post the contents of my from_clause_query here, but it says sorry, this content is not allowed. I don't know why?

    I was able to solve the problem by creating a stored procedure. I insert the records in a table in the procedure, and then I query the table. Thanks for your help.

  • the two equii join and natural join are equall.will both display the output of the same

    the two equii join and natural join are equall.will both display even

    output?

    Hello
    It keeps you a little test and check yourself?

    See the link below.

    http://psoug.org/reference/joins.html

    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> CREATE TABLE parents (
      2  person_id  NUMBER(5),
      3  adult_name VARCHAR2(20),
      4  comments   VARCHAR2(40))
      5  PCTFREE 0;
    
    Table created.
    
    SQL>
    SQL> CREATE TABLE children (
      2  parent_id    NUMBER(5),
      3  person_id    NUMBER(5),
      4  child_name   VARCHAR2(20),
      5  comments     VARCHAR2(40))
      6  PCTFREE 0;
    
    Table created.
    
    SQL>
    SQL> INSERT INTO parents VALUES (1, 'Dan', 'So What');
    
    1 row created.
    
    SQL> INSERT INTO parents VALUES (2, 'Jack', 'Who Cares');
    
    1 row created.
    
    SQL> INSERT INTO children VALUES (1, 2, 'Anne', 'Who Cares');
    
    1 row created.
    
    SQL> INSERT INTO children VALUES (1, 1, 'Julia', 'Yeah Right');
    
    1 row created.
    
    SQL> INSERT INTO children VALUES (2, 1, 'Marcella', 'So What');
    
    1 row created.
    
    SQL> COMMIT;
    
    Commit complete.
    
    SQL>
    SQL> SELECT adult_name, child_name
      2  FROM parents NATURAL JOIN children;
    
    ADULT_NAME           CHILD_NAME
    -------------------- --------------------
    Jack                 Anne
    Dan                  Marcella
    
    SQL> select adult_name,child_name from parents a, children b
      2  where a.person_id=b.person_id;
    
    ADULT_NAME           CHILD_NAME
    -------------------- --------------------
    Jack                 Anne
    Dan                  Julia
    Dan                  Marcella
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  select adult_name,child_name from parents a, children b
      2* where a.person_id=b.parent_id
    SQL> /
    
    ADULT_NAME           CHILD_NAME
    -------------------- --------------------
    Dan                  Anne
    Dan                  Julia
    Jack                 Marcella
    
    SQL>
    

    Kind regards
    Avinash

  • is trace SQL - possible to appoint the output trace file?

    Hello

    I put DBMS_SYSTEM. SET_SQL_TRACE_IN_SESSION in my database. This is the version 10.2 running on Linux.
    Now, I want to display the trace file using tkprof. It is in my directory in $ORACLE_BASE/admin/SID/udump. But there are more tracks and they are all the same: instancename_ora_traceid, is very difficult to find the right one.
    Is it possible to make the sql trace file to be named by any other means?

    Thanks in advance.
    Sousou

    Hello

    Yes, you can change then what is the purpose of this
    ALTER session set tracefile_identifier = trace_file_name

    Add with the tracefile_identifier

    Select c.value | '\' || d.instance_name | "_ora_" | a.SPID | '.trc' trace_file_is_here
    v $ process a, v$ session b, v$ parameter c, v$ instance d
    where a.addr = b.paddr
    and b.audsid = userenv ('sessionid')
    and c.nom = 'user_dump_dest;

    -Pavan Kumar N

    Published by: pounet on December 9, 2008 22:23

  • Unable to display the output of a concurrent program

    Dear members,

    I use Oracle R12.1.3 Vision Instance.

    I ran the program create accounting. When I click on the button to display output, the browser gets displayed and gets immediately closed. I'm unable to view the output.

    Can someone help me please to solve this issue?

    Thanks in advance.

    Kind regards.

    I faced this problem once. That's the problem with the settings of Internet Explorer.
    Check in the settings of IE-> tools - > Internet Options-> Security tab-> the zone (Intranet, for the most part)-> enable downloads.

    By
    VAMSi

  • Unable to display the output in the next block

    Hello
    I tried the next block... But unable to see the output
    Could you suggest me in this...
    0-----)
    
    PL/SQL procedure successfully completed.
    Although made setserverout

    but of no use

    Please help me

    Published by: josh1612 on April 5, 2010 12:14 AM

    Hello

    Check if the script given below will print something...

    DECLARE
      ..
    BEGIN
       DBMS_OUTPUT.PUT_LINE('START OF ANONYMOUS BLOCK');
      ..
       DBMS_OUTPUT.PUT_LINE('END OF ANONYMOUS BLOCK');
    END;
    

    If so, check your logic for the results expected, if not... Check the settings of sqlplus

    * 009 *.

    Edited to take off your real script :) forums

    Published by: 009 April 5, 2010 12:18 AM

  • When I filled a form field using a query SQL result is displayed but not registered in the table.

    I write in the topic, I have created a form and in some of their fields, I used a SQL query to get information from a table based on the user who has been logging.

    The information displayed well, but when I press "Send button" loses information and the field in the table is shown empty.


    Anyone know what is happening?

    I enclose below a picture of the problem

    Concerning

    Problema DB APEX.jpg

    Hi ANTHONY,.

    ANTHONY wrote:

    I give you the credentials of my database, I hope you could do it works and most importantly, showing me what the error care...

    Feel free to change what you want in the application

    https://Apex.Oracle.com/pls/Apex/f?p=4550:1:2838412118981:

    BANCO_PRUEBAS

    ADMIN

    password

    It is interesting that, when I use APEX 5.0.1.00.06, I have some errors form appearing not using APEX 4.1.0.00.32

    Check your 77569 application-> Page 1. I have modified the page element attributes. Now it's working.

    Here are the changes (I will explain for P1_NOMBRE, did the same for the P1_APELLIDOS and P1_CATEGORIA):

    • 'Source' has become article attributed to him include:

    Source: Replacement always, value that exists in session state

    Source type: column database

    Source of value or an expression: NUMBER

    • The "Default" article now the following attributes:

    By default of Type: PL/SQL function body

    Default value:

    DECLARE
    
      L_NOMBRE B_LISTA_EMPLEADOS.NOMBRE%TYPE;
    
    BEGIN
    
      select NOMBRE
      into   L_NOMBRE
      from   B_LISTA_EMPLEADOS
      where  USERNAME = :APP_USER;
    
      RETURN L_NOMBRE;
    
    EXCEPTION
      WHEN NO_DATA_FOUND THEN
      RETURN NULL;
    
    END;
    

    Kind regards

    Kiran

  • query or pl sql block to display the mentioned result

    create table shirt (color varchar2 (10), number Qty., number s, number m, l, xl, xxl number);

    insert into shirt values ('black', 10, 5,2,1,2,0);

    insert into shirt values ('black', 8, 2,1,2,0,3);

    insert into shirt values ('White', 5, 2,1,1,0,1);

    insert into shirt values ('White', 7, 2,1,2,1,1);

    How to get the bottom of output?

    Expected result:

    G1 G2 QUANTITY

    Black s 7

    Black 3 m

    Black           l                 3

    XL Black 2

    XXL black 3

    White s 4

    White m 2

    white            l                2

    XL white 1

    White xxl 2

    Vinodh

    Correction


    with

    shirt as

    (select "black" color, quantity 10, 5 s, 2 m, 1 l, 2-xl, xxl 0 of all the double union)

    Select 'Black', 8, 2, 1, 2, 0, 3 double Union all

    Select 'White', 5, 2, 1, 1, 0, Union 1 double all the

    Select 'White', 7, 2, 1, 2, 1, 1 double

    )

    Select the color of g1, g2, quantity

    (select color, concerned, sum (m) m, sum (l) l, sum (xl) xl, sum (xxl) xxl

    shirt

    Group by color

    )

    UNPIVOT (quantity for g2 in (as ', m mod', 'l' l, xl as "xl", xxl as a 'xxl'))

    order of g1, decode(g2,'s',1,'m',2,'l',3,'xl',4,'xxl',5,6)

    G1 G2 QUANTITY
    Black s 7
    Black m 3
    Black l 3
    Black XL 2
    Black XXL 3
    White s 4
    White m 2
    White l 3
    White XL 1
    White XXL 2

    Concerning

    Etbin

  • Help of query SQL - inner joins and the separate results

    Hello

    ASP VB, SQL Server

    I have a structure of data base with 3 tables - users, albums and photos. each user has a identifier unique, each record has a unique albumid and also contains a column with the user name. each record in the photo has a unique id so that store the user name and the album in which the image belongs.

    I'm writing a query that returns a list of the albums for a particular user (based on a user name query string) and who will also bring back the id of the first record in the table for each of these albums photo.

    the closest I get is to run a query to select albumid albums where userid = varuserid with a join internal on the pictures table to remove the photo ID - problem I then it comes out all the photos from the photos table where userid = varuserid, so when I do a repeat region to display a list of albums for a certain user It produces a list of all the photos where userid = varuserid

    I really want to return just a list of ID album based on the username variable, but also to return the first record in the table of photos for each of these albumids

    I tried different combinations of inner joins, select distinct etc but no joy.

    any suggestion would be appreciated as am floundering here...




    First, you must define 'first' with regard to the photos. Is there a
    timestamp? They are numbered inside the album? Do you really care who is
    "first", or do you want simply a shot? You also neglected to indicate if they are
    empty photo albums have been allowed. I assumed that the empty albums are not
    allowed.

    Whatever you decide, the answer will be similar.
    SQL Server tends to get better results with joins with subqueries. You will have
    See such a written request more often with subqueries, and there isn't
    nothing wrong with that, but I'll use a join on a derived table. I have
    have not all column names (hint, hint), so I made them, but the
    Comments should help out you.

    SELECT A.Title, P.PhotoID, P.Caption, A.AlbumID, P.ImagePath
    FROM dbo. A albums
    -build a table derived, consisting of photo ID lowest for each
    album.
    INNER JOIN (SELECT AlbumID, MIN (PhotoID) AS FirstPhoto FROM dbo. Photos
    AlbumID GROUP) AS PM WE A.AlbumID = PM. AlbumID
    -details of the photo for the photo shown in the table above
    INNER JOIN dbo. Photos P on A.AlbumID = P.AlbumID AND
    H. FirstPhoto = P.PhotoID
    User A.UserID ='some WHERE '

    "tedstar" wrote in message
    News:ee4pfn$de$1@forums. Macromedia.com...
    > I am writing a query that returns a list of the albums for a
    > particular user (based on a user name query string) and also bring
    > return
    > the id of the first record in the table for each of these albums photo.

  • With the help of SQL, need to display the previous year, current year and the year next to single variable

    Hi all

    We have an obligation to state the previous year, current year and values of the year next as a LOV in the ADF page.

    This is the query that retrieves the previous year, current year and next year. But the result of this query displays values in 3 columns:

    Select (Extract(year from sysdate)-1), extract (year sysdate), (extract (year sysdate) + 1) twice;

    Output:

    2012 2013 2014


    But I want to display them in a single with 3 rows as column:

    2012

    2013

    2014


    Please your ideas.

    or in the same way

    SELECT EXTRACT (YEAR FROM ADD_MONTHS (SYSDATE, 12 *(LEVEL-2)))

    OF the double

    connect by level<>

  • Hierarchical Oracle query help needed - path between the crux of two brothers and sisters

    I want to find the path between two nodes of oracle hierarchical Table.

    Consider the following case-
    NodeId - ParentId
    =============
    1 > > > > > > 0
    2 > > > > > > 1
    3 > > > > > > 2
    4 > > > > > > 3
    5 > > > > > > 0
    6 > > > > > > 5
    Here I want to query the database table that if there is a path between nodes 3 and 5?
    The previous query you provided work upwards to the root node.

    Here is my expected result, 3-> 2-> 1-> 0-> 5

    Yet once if I have a query in the table to get the path between 1 and 3, I want to get out of the way - next
    1-> 2-> 3

    Therefore, the query works in both cases. Where ADI root can act as an intermediate or no node.

    Can you please guide me how I can get it?

    Thank you.

    Hello

    user13276471 wrote:
    I want to find the path between two nodes of oracle hierarchical Table.

    Consider the following case-
    NodeId - ParentId
    =============
    1 >>>>>> 0
    2 >>>>>> 1
    3 >>>>>> 2
    4 >>>>>> 3
    5 >>>>>> 0
    6 >>>>>> 5
    Here I want to query the database table that if there is a path between nodes 3 and 5?
    The previous query

    What application is this? If you're referering to another thread, then post a link, such as {message identifier: = 10769125}

    you provided work upwards to the root node.

    Here is my expected result, 3--> 2--> 1--> 0--> 5

    Yet once if I have a query in the table to get the path between 1 and 3, I want to get out of the way - next
    1--> 2--> 3

    Therefore, the query works in both cases. Where ADI root can act as an intermediate or no node.

    Can you please guide me how I can get it?

    I think you want something like this:

    WITH     bottom_up_from_src    AS
    (
         SELECT     nodeid
         ,     parentid
         FROM     table_x
         START WITH     nodeid      = :src_nodeid
         CONNECT BY     nodeid   = PRIOR parentid
    )
    ,     bottom_up_from_dst     AS
    (
         SELECT     *
         FROM     bottom_up_from_src
        UNION ALL
         SELECT     parentid     AS nodeid
         ,     nodeid          AS parentid
         FROM     table_x
         WHERE     nodeid     NOT IN (
                                          SELECT  nodeid
                                   FROM    bottom_up_from_src
                                      )
         START WITH     nodeid        = :dst_nodeid
         CONNECT BY     nodeid        = PRIOR parentid
    )
    SELECT      :src_nodeid || SYS_CONNECT_BY_PATH (parentid, '-->')     AS display_path
    FROM       bottom_up_from_dst
    WHERE       parentid     = :dst_nodeid
    START WITH  nodeid     = :src_nodeid
    CONNECT BY  nodeid     = PRIOR parentid
    ;
    

    This will show how you can get it from: src_nodeid at dst_nodeid, moving to the top or to the bottom of a hierarchy at a time step. This will work regardless of the fact that


    • : src_nodeid is the ancestor of the: dst_nodeid, or
    • : src_nodeid is a descendant of: dst_nodeid, or
    • both: src_nodeid and: dst_nodeid are the descendants of another node (e.g. 0).

    I hope that answers your question.
    If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements) and also publish outcomes from these data.
    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). It is always important, but particularly so with CONNECT BY queries, because each version since Oracle 7 had significant improvements in this area.
    See the FAQ forum {message identifier: = 9360002}

  • How to display the output of PL/SQL and difficulty package below error (please help)

    -PACKAGE SPECIFICATION AND met with success, but I see no way out, an error is also here... Please help. How do I solve this problem
    -with the code

    CREATE OR REPLACE PACKAGE package_variables
    -Declare the components of a package.
    Established PROCEDURE (VARCHAR2 value);
    Public FUNCTION get RETURN VARCHAR2;
    END package_variables;
    /



    CREATE OR REPLACE PACKAGE BODY package_variables
    -Declare the package-scoped variable.
    variable VARCHAR2 (20): = "initial value";
    -Define the function
    Get function RETURN VARCHAR2 IS
    BEGIN
    RETURN variable;
    END get;
    -Define the procedure.
    PROCEDURE set(value VARCHAR2) IS
    BEGIN
    variable: = value;
    The END value;
    END package_variables;
    /



    Result VARIABLE VARCHAR2 (20)
    CALL package_variables.get () IN: result;
    SELECT: result AS result FROM dual;


    RUN package_variables.set ("new value '");
    CALL package_variables.get () IN: result;
    SELECT: result AS result FROM dual;

    /*

    OUTPUT


    PACKAGE compiled package_variables.
    PACKAGE compiled package_variables BODY.

    Error at startup on line 2 of the command:
    CALL package_variables.get () IN: results
    Error report:
    SQL error: ORA-01008: not all variables
    01008 00000 - "not all variables.
    * Cause:
    * Action:
    RESULTS
    --------------------------------


    1 selected lines

    anonymous block filled

    Error at startup on line 2 of the command:
    CALL package_variables.get () IN: results
    Error report:
    SQL error: ORA-01008: not all variables
    01008 00000 - "not all variables.
    * Cause:
    * Action:
    RESULTS
    --------------------------------


    1 selected lines

    */

    The package name is package_variables (note the 's'. Plural.) But using package_variable (in the singular) in your call.
    Also select in as a SQL statement seems to be not valid. You encapsulate a begin - end around her block.

    SQL> begin
      2  select package_variables.get into :outcome from dual;
      3  end;
      4  /
    
    PL/SQL procedure successfully completed
    outcome
    ---------
    Initial Value
    

Maybe you are looking for

  • Tecra A4 Audio Jack sizes

    Hi all I recently bought a Tecra A4. My plug stereo audio 3.5 mm (that I used with my laptop computer players and previous music) can not get into the audio jack of the Tecra. There seems to be a sort of "obstruction" in decision-making. I've had the

  • Do not receive messages from sms for voice mail notifications - problem apple ID

    Hello For a while I have not received the text notifications for voicemails left on my phone. I did a factory reset and then configure the phone as a new phone, and I received notifications of text. I then registered in my apple ID and stop notificat

  • Duplex not recognized under Vista 64-bit printing accessory

    I recently had to replace my old computer with an HP Pavilion a6700f running Windows Vista Home Premium 64 - bit SP1. I got my 7410 HP all-in-One printer connected and operating, the latest software HP installed and checked for updated drivers, firmw

  • Create loadable preset parameters

    Hello I'm trying to create a loadable presets for my controls.  I wasn't sure of the best method so I started by allowing the user to save the preset to a text file.  The problem I have is how to load presets from the text file.  I thought I could tr

  • Adding a second HD to my 8700

    I spend my second HD from my old PC to my new 8700.  It's a 1 TB SATA hard drive.  I can see it in the BIOS, but Windows doesn't see it.  What I am doing wrong?