Strange SQL report requirement

Hi team,

I have a requirement in the APEX to create a SQL statement such as:

Col1

Col2

COL3

COL4

Col5

Col6

Col7

1

2

3

4

1

2

3

4

1

2

3

4

5

The result should be

Col2, col6, col7

Col1, col3, col5

Col2, col3

Col1, col2, col3, col4, col5 col6

either all columns null for every row must be returned. Is this feasible?

-Sunil Bhatia

Sunil Bhatia wrote:

I have a requirement in the APEX to create a SQL statement such as:

Col1

Col2

COL3

COL4

Col5

Col6

Col7

1

2

3

4

1

2

3

4

1

2

3

4

5

The result should be

Col2, col6, col7

Col1, col3, col5

Col2, col3

Col1, col2, col3, col4, col5 col6

either all columns null for every row must be returned. Is this feasible?

SQL > with unsupplied_test_data like)

Select 1 col1, col2 null, 2, 3 col3 col4, 4 col5 col6 null, null col7 double

Union of all the

Select col1, 1 col2, col3 null null, col4 col5 null, col6 3, 4 double col7, 2

Union of all the

Select 1 col1, col2 null, null, col3, 2 col4, col5 3, 4 col6, col7 5 double

Union of all the

Select col1 null null col2, col3 null, null col4, col5 col6, col7 double null null, null)

Select

Trim)

',' of

regexp_replace)

nvl2 (col1, null, 'col1') | ','

|| nvl2 (col2, null, 'col2') | ','

|| nvl2 (col3, null, 'col3') | ','

|| nvl2 (col4, null, 'col4') | ','

|| nvl2 (col5, null, 'col5') | ','

|| nvl2 (col6, null, 'col6') | ','

|| nvl2 (col7, null, 'col7')

, ',{2,}'

', ')) strange_requirement

Of

unsupplied_test_data

STRANGE_REQUIREMENT

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

col2, col6, col7

col1, col3, col5

col2, col3

col1, col2, col3, col4, col5, col6, col7

Tags: Database

Similar Questions

  • Please help - value of the long column of SQL report required in a separate cell

    Hello.

    I need to create a SQL report with the structure as below:

    Country city vertical Business details for the State (detail desc)
    MY Quincy Healthcare US
    It is a detailed desc value that is displayed in a different cell.
    It is a detailed desc value that is displayed in a different cell.
    It is a detailed desc value that is displayed in a different cell.
    It is a detailed desc value that is displayed in a different cell.
    US MY Braintree, HE
    It is a detailed desc value that is displayed in a different cell.
    It is a detailed desc value that is displayed in a different cell.
    It is a detailed desc value that is displayed in a different cell.

    I came across a solution where you can hide/show the column value in another cell. But my requirement is that it should be displayed when the page opens, and the user will not have to click a button to see the value. This is mainly for their presentations, and printing. so its very annoying for them to click on the buttons so much to see the value of desc of detail for each record. I'm new to Java script, please help

    I'm not sure to understand your needs - you are showing us 2 data lines, lines 7 or 9? You want the long description of detail on the same line, or below?

    I'll go on the assumption that you are showing us two rows, and long descriptions in this example are found along 3 to 4 lines, and you want long descriptions under the details. In this case, I suggest using "column name" models They are much easier to use as they appear when you look at everything first, so bear with me.

    Under 'shared components', select 'Models' and click then on create yellow > button. You create a report model, from scratch. On the last page of the wizard, select "Named column (model line)" for the type of model. This will create a model rather generic (and useless), which you'll have to edit; I don't know why they chose to not send you directly in the editor. When you change it, you will see that the single field whose value is 'Model line 1', and it is set to:

    #1##2##3##4##5#
    

    To meet your needs with basic features, change it to something in the sense of:

    #COUNTRY##STATE##CITY##VERT#
    #DETAILS#
    

    Then, you probably want to put something in the position of the column model, such as:

    CountryStateCityVertical Business
    Details
    

    Applies to whatever you want, of course the CSS styles.

    Using the model is simple: If your report, select the model and make sure that your SQL returns values using the column names specified in your model. Otherwise, you will see "#COUNTRY #" literal text in your report.

    You can get fancy with these, of course, as the application of different styles for alternating rows, but I'll leave that as pretty good to help you get started (I hope).

    -David

  • How to adjust column widths individual classic SQL report

    Hello

    I use Oracle APEX v4.2 with IE8 browser and basically tries to adjust widths of individual columns in my classic SQL report. Basically, I have three columns I want to spacing, so that the width of the entire region for the report is used, but am not sure how to proceed.

    I drilled in individual columns and specified the column widths as the element, but in vain.

    Would appreciate help on how to do this for each column and hope that I do not need to change the model of report (if possible).

    Thank you.

    Tony.

    Tony F. says:

    I use Oracle APEX v4.2 with IE8 browser and basically tries to adjust widths of individual columns in my classic SQL report. Basically, I have three columns I want to spacing, so that the width of the entire region for the report is used, but am not sure how to proceed.

    There is an element of uncertainty in what we suggest as well, because you have not specified the theme and the report of model that is used. This information is required for any question of formatting or the visual layout.

    I drilled in individual columns and specified the column widths as the element, but in vain.

    Report in some themes templates may be missing in the #COLUMN_WIDTH substitution string # required for use of the declarative column widths, as shown here: Re: width of column in reports

    I don't know why it would be missing from a theme of so-called "modern" (perhaps the lack of documentation affects even the Oracle theme designers), but you can add it to the models listed in this thread.

    Width of the element applies only to controls on a form in a table.

    Would appreciate help on how to do this for each column and hope that I do not need to change the model of report (if possible).

    This can be done using selectors CSS attribute (for the themes of quirks mode non-traditional, because you are using a legacy version of IE). Add a style sheet in CSS Inline property page:

    #ALIAS,
    td[headers="ALIAS"] {
    width: 40%;
    }
    

    where the ALIAS value in the attribute selector matches the required column alias, and the width property specifies the column dimension required and the units.

    Note that the percentage widths will be compared to the width of the report table. Therefore, it may be necessary to also specify widths (100%) for the table of report and its components. Exactly how is based on the report, the region and the page templates and theme used, information that was not provided.

  • SQL Reporting Services license

    Working on explodes a separate instance of SQL 2014 Reporting Server from a normal SQL 2014 database server. If I run SQL reporting services on an area where the SQL engine is not installed does this burn a separate license of SQL?

    Hi Khellian,

    We have a dedicated forum for SQL queries. You can post the question here:

    http://social.msdn.Microsoft.com/forums/SQLServer/en-us/home

    Thank you

    Waseemulla S

  • I have trouble to install SCOM 2007 reporting, SQL reporting services validation error. I checked everything suggested to resolve the error and everything is correct. I don't know what to do next.

    Of fact steps:

    1. group name change and taken out the _50

    2 enabled sql reports configuration manager and everything is set up correctly

    3. of course I can get the description of the url, which is also OK

    4. There is no SSL

    5. There is no Proxy configuration

    6. I have installed SQL 2008 r2 and I want to install Operations Manager reporting from the same drive

    7. There is no value 3 in the journal of reports

    Hello

    The question you posted would be better suited in the TechNet Forums. I would recommend posting your query in the Technet Forums.
    http://social.technet.Microsoft.com/forums/en-us/operationsmanagerreporting/threads

  • Problem with Top SQLs report

    Hello

    I have a big problem with Top SQLs reports, when I generate a report of high SQLs, SQL, the value text is not end, I know that there is a "The SQL text size" setting on the properties of the agent (this configuration is also on the collections setting ' Ta maximum size in characters of the short collects text of the SQL statement is ") on the two options , I've incremented the value of 256 (default) 1500, but when I generate the Top SQLs postpones continue it problem, once the changes I restarted the agent but the problem persists, I generate the report on the different formats, but result is the same, could you help me please.

    Thank you.

    Best regards.

    I see this in support KB article https://support.software.dell.com/kb/109536

    "

    • Title

      SQL in DB2 Top instructions are truncated in the delivered report of Top SQL

    • Description

      SQL in DB2 Top instructions are truncated in the delivered report of Top SQL

    • Resolution

    • Resolution A DDB-3673 request improvement with Support software Dell to show the full text of SQL high in the report Top SQL for DB2.

      Workaround At this point you should be able to make a custom report by cloning the Top SQL existing and then customizing report. »

    I know that this is not the solution, more of an explanation and guidance on how to solve this problem by using customizations.

    Golan

  • How to convert sql report interactive report

    Hi all

    I have a Sql report and I want to convert in interactive report. I found the option at the top to the right side "Interactive report migrate" but only 3 option to pass parameters.

    In my SQL report (Edit button) is here and I'm passing 6 values through this button change, how can I migrate my SQL report interactive report? Please suggest me...

    Thank you

    Xandot wrote:

    In the report links SQL query looks like:

    1. case Type
    2. When 3 then
    3. (select the T_STYLE Style where STYLEID =?)
    4. When 1 then
    5. 'Edit'.
    6. else '||','|| ||','|| ||','|| ||',30>Edit'
    7. end
    8. When 2 then '| «, » || ||','|| ||','|| ||',30>Edit'
    9. When 1 then '| «, » || ||','|| ||','|| ||',30>Edit'
    10. end as change

    How to implement above interactive links, until now that I created the link on interactive using links like report:

    But here its me allow only a single URL, how to put different URLS of in accordance with the condition, please suggest me.

    There is no declarative support for generating links conditionally to line level in interactive reports (or indeed in the standard reports). Set the IR link column property to exclude the link columnand generate the link in the request in the original report. Set the Type of display attribute for the column Edit to report Standard column.

  • SQL report

    How can I make the Apex SQL report that follows (two versions)?

    Thank you very much.

    Participation of students in the meetings.

    Students = Aris, Maria

    Meetings = 1, 2, 3 (2014-1-5, 15-1-2014 and 2014-1-25 respectively).

    Participation = 0/1 (absent/present).

    __________________________________________

    Report version 1

    Meeting 1 meeting 2 3

    1 1 ARIS 0

    Maria 1 0 0

    __________________________________________

    Report version 2

    Meeting 1 meeting 2 3

    2014 1-5 15-1-2014 2014-1-25

    1 1 ARIS 0

    Maria 1 0 0

    __________________________________________

    Here's the diagram:

    create table students

    (

    primary key not null ID number,

    name varchar2 (80)

    );

    create table meeting

    (

    primary key not null ID number,

    date of meeting_date

    );

    create the table student_meeting

    (

    primary key not null ID number,

    student_id number of non-null reference student (id),

    meeting_id number of non-null reference meeting (id),

    number of presences,

    check (presence in (0, 1))

    );

    insert into values student (11, "Aris");

    insert into values student (12, 'Maria');

    Insert in the encounter of the values (1, '' 2014-01-05);

    insert into values of meeting (date 2, '' 2014-01-15).

    Insert in meeting values (3, '' 2014-01-25).

    insert into student_meeting values (101, 11, 1, 1);

    insert into student_meeting values (102, 11, 2, 1);

    insert into student_meeting values (103, 11, 3, 0);

    insert into student_meeting values (104, 12, 1, 1);

    insert into student_meeting values (105, 12, 2, 0);

    insert into student_meeting values (106, 12, 3, 0);

    commit;

    What you want is called a matrix or pivot table dynamic PivotTable report... Take a look at this link RPF (as long as you eon ar 11g for a database...) for example: Vishal blog: methods of creating matrix in Oracle APEX report

    Thank you

    Tony Miller
    Software LuvMuffin
    Ruckersville, WILL

  • SQL report should look to the updating of the continuous element

    Hello

    I have a question about how it is possible to do a SQL report that looks like the element continuous is changed in the browser.

    I now have this SQL query:

    Select x.first_name, x.Last_name, it. Nom_element, ui.user_item_ID, ui.item_ID, ui.employee_number

    of APEX_EBS_ACTIVE_LIST x,.

    USER_ITEMS ui,

    ELEMENT that she

    where x.employee_number = ui.employee_number

    and it.item_id = ui.item_id

    and ui.employee_number =: p7_employee_number

    ORDER BY x.last_name

    I have Apex page 7 a popup lov (P7_employee_number. When selection here the employee_number I want that the SQL query displays at the same time the report below on the page with the information on the employee.

    Does anyone know how this is possible? I use APEX 4.2

    Thank you!


    Concerning
    ELCO

    ELCO

    On point page p7_employee_number have a dynamic action with the event 'change '.

    Have an action "Refresh" with as affected the region of you're sql statement.

    Make sure that the p7_employee_number element is declared as "Elements of Page to submit" to the region.

    Which will refresh the report whenever the item is changed.

    It is with the section of the page and the report are not on the same page apex.

    Nicolette

  • Change the line color of the standard SQL report

    Hello

    I'm trying to follow this post to change the color of a line in the APEX SQL report. Change the color of line - report SQL Oracle APEX

    It is a little outdated and trying to figure out how to get to this page: http://img7.imageshack.us/img7/4782/columntemplate.jpg 4.2 APEX where I can put under condition of background color.


    I use Theme 13 (inheritance) and make a copy of the report area. Published, but could not find an equivalent section of this screenshot of the apex 3.1.

    Any help appreciated.

    William Wallace says:

    I'm trying to follow this post to change the color of a line in the APEX SQL report. Change the color of line - report SQL Oracle APEX

    It is a little outdated and trying to figure out how to get to this page: http://img7.imageshack.us/img7/4782/columntemplate.jpg 4.2 APEX where I can put under condition of background color.

    I use the theme 13 (legacy)

    Ugh.

    and make a copy of the report area. Published, but could not find an equivalent section of this screenshot of the apex 3.1.

    This suggests that you look at the definition of region page, or even simply the definition of region model. What you need here is a copy of the report model.

    1. go in Home > Application Builder > Application > shared components > models.

    2. Select theme 13 theme filter, the Filter Type reports and click OK.

    3. create a copy of the Standard report model by using the icon copy in the list.

    4. Select the new report template and edit it as shown in the thread linked to above, paying special attention to the content of the second post. (It is of generic column template definition page that contains the section in the screenshot).

  • Change the width of the columns in Sql report

    Hello

    I use Apex 4.1

    Can someone tell me how we can change the width of the Sql report. For report IR we can do this by using the following code,

    < style >
    table.apexir_WORKSHEET_DATA td [headers = "Name of the pass"] {}
    _width: 500px;
    min-width: 400px; < / style >

    Please help me with Sql Report.

    Thank you
    Shoaib

    Published by: Shoaib581 on January 21, 2013 03:05

    Shoaib581 wrote:
    Hello

    I use Apex 4.1

    Can someone tell me how we can change the width of the Sql report. For report IR we can do this by using the following code,

    Always zip code using .

    ...\
    

    Tags:

    
    

    Please help me with Sql Report.

    Either use the same CSS approach by adding a static region ID in the report area and adding the style sheet in the header HTML page: