ApEx 4.2 - Table query on a report

Hi all

Recently, I approached to ApEx 4.2 under my Institution, please be patient!

I developed a short application to questions of quality control, I have a few problems on the recovery of a summary table.

I created a report form for a section of the Customer Satisfaction: the shape has 13 questions and users can answer using numeric values '1-5 '.

Please find attached a screenshot of the table of the report where you can see the answers for each user.Report.jpg

In the same report page, I would like to create another table (below the current) with 5 fixed lines (corresponding to choices '1-5') and 13 columns (corresponding to the 13 questions, R14, and R15 are optional). The new table should show the value of frequency (for example COUNT (R1)) for each response per year.

Just for example, I've created a LOOP to retrieve the results of the 1st column:

declare

V_c number (2);

Start

I'm in 1.5 LOOP

Select COUNT (R1) in v_c

of QC_CS_RISPOSTE

where R1 = i

AND ANNO = 2014;

DBMS_OUTPUT. Put_line (V_c);

END LOOP;

end;

/

Results:

2 3 1 1 1  Statement processed. 

0.01 seconds

I apologize for my inexperience, hope you understand.

Thanks, best regards

K

Jesse wrote:

I apologize for the previous mail format, here information & code:

Thanks for providing the information and sample data.

With Oracle 11 g, we can use the PIVOT and UNPIVOT operators to perform this type of transformation/aggregation quite easily:

SQL > with qc_unpivot like)

Select

Anno

r_val

r

Of

QC

UNPIVOT)

r_val for r (r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13)))

Select

*

Of

qc_unpivot

pivot)

Count (r) n (r) in ("R1" r1, "R2" r2, r3 'R3', 'R4' r4 'R5' r5, r6 "R6", "A7" r7 "R8" r8, r9 "R9", "A10" r10, r11 "R11", "R12" r12, r13 "R13"))

order by

Anno

r_val;

ANNO R_VAL R1_N R2_N R3_N R4_N R5_N R6_N R7_N R8_N R9_N R10_N R11_N R12_N R13_N

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

2014 1 2 0 1 0 1 1 1 1 2 3 1 1 1

2014 2 3 5 0 1 0 3 2 3 1 1 1 4 1

0 2014 3 1 1 2 3 2 0 1 0 1 2 3 1

2014 4 0 1 2 3 2 3 1 3 2 0 0 1 3

2014 5 1 0 2 0 2 0 2 0 1 1 2 0 2

Tags: Database

Similar Questions

  • the SQL for apex 4.2 with 'apex_item.text' region report renders incorrectly

    In the APEX 4.2 page, I created region "report data.

    Type = "SQl query".

    'User interface'-> 'Template '=' area of reports.

    "Area Source 'is' select apex_item.text (1, '111') as double c1".
    The select query is actually much more complex, but generally simplified it is such, that it uses the function "select apex_item.text" construction HTML textfield.

    If I run in query Sql Developer
    select apex_item.text(1, '111') as c1 from dual;
    Then it results in:
    <input type="text" name="f01" size="20" maxlength="2000" value="111"  />
    But in APEX 4.2 the report is rendered thus:
    <td  headers="c1">&lt ;input type=&quot ;text&quot ; name=&quot;f01&quot; size=&quot;20&quot; maxlength=&quot;2000&quot; value=&quot;111&quot;  /&gt ;</td>
    ("for this forum poster correctly I had to put extra spaces between ' ' & gt ' and ';' and so on)

    And APEX 4.2 shows ugly html inside the cell of report/slot for me, showing characters/symbols ">". The reason is that APEX source HTML of the page has no symbol ">" but has "' & gt; '."

    The APEX 3 I have a similar query works fine, without such an anomaly.

    What attribute should I change in APEX 4.2 region to display the result of my query as needed?

    I need this 'apex_item.text' function, I can't remove it.

    Published by: CharlesRoos on 13.02.2013 15:28

    Published by: CharlesRoos on 13.02.2013 15:29

    Published by: CharlesRoos on 13.02.2013 15:29

    CharlesRoos wrote:
    In the APEX 4.2 page, I created region "report data.

    Type = "SQl query".

    ' UI '-->' model '=' area of reports.

    "Area Source 'is' select apex_item.text (1, '111') as double c1".
    The select query is actually much more complex, but generally simplified it is such, that it uses the function "select apex_item.text" construction HTML textfield.

    If I run in query Sql Developer

    select apex_item.text(1, '111') as c1 from dual;
    

    Then it results in:

    
    

    But in APEX 4.2 the report is rendered thus:

    < ;input type=" ;text" ; name="f01" size="20" maxlength="2000" value="111"  /> ;
    

    ("for this forum poster correctly I had to put extra spaces between ' & gt' and ';' and so on)

    And APEX 4.2 shows ugly html inside the cell of report/slot for me, showing characters/symbols ">". The reason is that APEX source HTML of the page has no symbol ' > ' but '& gt;'.

    The APEX 3 I have a similar query works fine, without such an anomaly.

    What attribute should I change in APEX 4.2 region to display the result of my query as needed?

    Make sure the column attribute display as for column C1 is Standard report column.

  • foreign key ALTER TABLE QUERY PROBLEM

    HAI ALL,

    ANY SUGGESTION PLEASE?

    UNDER: foreign key ALTER TABLE QUERY PROBLEM

    I want TO CREATE AND ALTER TABLE foreign key:

    1.TABLE:HAEMATOLOGY1
    COLUMN: HMTLY_PATIENT_NUM
    WITH
    TABLE: PATIENTS_MASTER1
    COLUMN: PATIENT_NUM (THIS IS THE KEY PRIMARY AND UNIQUE)

    1.TABLE:HAEMATOLOGY1
    COLUMN: HMTLY_TEST_NAME
    WITH
    TABLE: TESTS_MASTER1
    COLUMN: TEST_NAME ((C'EST LA CLÉ UNIQUE))
    ---------------


    SQL + QUERY DATA:
    -----------
    ALTER TABLE HAEMATOLOGY1
    Key constraint SYS_C002742_1 foreign (HMTLY_PATIENT_NUM)
    references PATIENTS_MASTER1 (PATIENT_NUM);

    ERROR on line 2:
    ORA-01735: invalid option of ALTER TABLE

    NOTE: THE NAME OF THE CONSTRAINTS: SYS_C002742_1 TAKEN FROM ORACLE ENTP TABLE DETAILS. MGR.
    ---------
    ALTER TABLE HAEMATOLOGY1
    Key constraint SYS_C002735_1 foreign (HMTLY_TEST_NAME)
    references TESTS_MASTER1 (TEST_NAME);

    ERROR on line 2:
    ORA-01735: invalid option of ALTER TABLE

    NOTE: THE NAME OF THE CONSTRAINTS: SYS_C002735_1 TAKEN FROM ORACLE ENTP TABLE DETAILS. MGR.

    ==============

    4 TABLES OF LABORATORY CLINIC FOR DATA ENTRY AND GET REPORT ONLY FOR THE TESTS CARRIED OUT FOR PARTICULAR

    PATIENT.

    TABLE1:PATIENTS_MASTER1
    COLUMNS: PATIENT_NUM, PATIENT_NAME,

    VALUES:
    PATIENT_NUM
    1
    2
    3
    4
    PATIENT_NAME
    BENAMER
    GIROT
    KKKK
    PPPP
    ---------------
    TABLE2:TESTS_MASTER1
    COLUMNS: TEST_NUM, TEST_NAME

    VALUES:
    TEST_NUM
    1
    2
    TEST_NAME
    HEMATOLOGY
    DIFFERENTIAL LEUKOCYTE COUNT
    -------------

    TABLE3:HAEMATOLOGY1
    COLUMNS:
    HMTLY_NUM, HMTLY_PATIENT_NUM, HMTLY_TEST_NAME, HMTLY_RBC_VALUE, HMTLY_RBC_NORMAL_VALUE

    VALUES:
    HMTLY_NUM
    1
    2
    HMTLY_PATIENT_NUM
    1
    3
    MTLY_TEST_NAME
    HEMATOLOGY
    HEMATOLOGY
    HMTLY_RBC_VALUE
    5
    4
    HMTLY_RBC_NORMAL_VALUE
    4.6 - 6.0
    4.6 - 6.0
    ------------

    TABLE4:DIFFERENTIAL_LEUCOCYTE_COUNT1
    COLUMNS: DLC_NUM, DLC_PATIENT_NUM, DLC_TEST_NAME, DLC_POLYMORPHS_VALUE, DLC_POLYMORPHS_

    NORMAL_VALUE,

    VALUES:
    DLC_NUM
    1
    2
    DLC_PATIENT_NUM
    2
    3
    DLC_TEST_NAME
    DIFFERENTIAL LEUKOCYTE COUNT
    DIFFERENTIAL LEUKOCYTE COUNT
    DLC_POLYMORPHS_VALUE
    42
    60
    DLC_POLYMORPHS_NORMAL_VALUE
    40-65
    40-65
    -----------------


    Thank you
    RCS
    E-mail:[email protected]
    --------

    ALTER TABLE HAEMATOLOGY1
    ADD Key constraint SYS_C002742_1 foreign (HMTLY_PATIENT_NUM)
    references PATIENTS_MASTER1 (PATIENT_NUM);

  • Q: very simple you can add more than 1 table to a Word report? -If Yes, how

    Hi all

    As described in the topic, is it possible to add more than 1 table to a Word report?

    Very simply, I have some test data in a table and added to my report with the addition of the report table vi.

    I have the same thing again to send data to a different table which I would like to insert in my report in table form. I placed a second addition table report vi directly after the previous vi, but it doesn't work.

    ... Am I stupid? or this function is only meant to be used at the same time? Maybe I need an another vi after adding table vi before you can add another?

    Feel free to enlighten me because I am confused,

    Thank you!

    Change the width of two column Table add to Report.vi from 10 to 1. Setting the value to 10 (unit are inches) will throw an error.

    Ben64

  • Elapsed time for the materialized view vs Master table query

    Hello all;

    Small confusion about time up for the vs Master materialized view table query

    SQL > select count (*), sum (quan_sold), sum (amt_sold) of the sale;
    COUNT (*) SUM (QUAN_SOLD) SUM (AMT_SOLD)
    6000000 12000000 720480000
    Elapsed time: 00:00:30.54
    SQL > create materialized view mv1
    2 activate the rewrite of the query as
    3. select count (*), sum (quan_sold), sum (amt_sold) of the sale;
    Materialized view created.
    Elapsed time: 00:00:01.45
    SQL > select count (*), sum (quan_sold), sum (amt_sold) of the sale;
    COUNT (*) SUM (QUAN_SOLD) SUM (AMT_SOLD)
    6000000 12000000 720480000
    Elapsed time: 00:00:00.01

    Please see the three cases "Elapsed Time"...

    When comparing other cases.
    1. my query takes long time (30.54), extraction of data from the sale
    2. create a materialized view takes less time (01:45) why?

    Source: http://uhesse.com/2009/07/08/brief-introduction-into-materialized-views/

    >
    Small confusion about elapsed time for the materialized view vs Master table query

    SQL > select count (*), sum (quan_sold), sum (amt_sold) from the sale.

    COUNT (*) SUM (QUAN_SOLD) SUM (AMT_SOLD)
    6000000 12000000 720480000
    Elapsed time: 00:00:30.54

    SQL > create materialized view mv1
    2 activate the rewrite of the query as
    3. select count (*), sum (quan_sold), sum (amt_sold) of the sale;
    Materialized view created.
    Elapsed time: 00:00:01.45

    SQL > select count (*), sum (quan_sold), sum (amt_sold) from the sale.

    COUNT (*) SUM (QUAN_SOLD) SUM (AMT_SOLD)
    6000000 12000000 720480000
    Elapsed time: 00:00:00.01

    Please see the three cases "Elapsed Time"...

    When comparing other cases.
    1. my query takes long time (30.54), extraction of data from the sale
    2. create a materialized view takes less time (01:45) why?
    >
    Many queries take less time the second time you run them. After the first performance, there may be many, if not all, lines in the buffer cache. Then the second round will not make any or all e/s physical but will obtain data from the buffer cache.

    Also, you haven't checked that the MV was even used for the second run.

    Drop the MV and make the query several times and means of the time. Then create the MV and do the same thing.

  • Unique problem with selction on the table (Query Page)

    Unique problem with selction on the table (Query Page)

    I have a VO data Bulletin Board, with a transitional attribute for selction unique column.
    My requirement is that I need to identify the line that was selected in the table.

    I associated with fireAction singleSelection column, such that whenever the user selects the line
    I'm looking for that VO using some rowIterator.
    But when running the loop of the transient VO that is mapped to the singleSelection variable is the show as "n" / NUll
    for all the lines...

    So how do you identify the selected line in singleSelection to a table.

    -Sasi

    In the property inspector of the element for which you've put firePartialAction, you can find a property named "parameters". That mention primary key as your setting.

    You can get the arameter using pageContext.getparameter ();

    -Anand

  • Forms and reports on apex 4.0 table

    Hi all

    I have installed 4 Apex in RDBMS 11R2 based on Linux, created a workspace, all went well.
    Now when I try to create a simple form and a report based on a table that I am running into problems.
    (I think I do something wrong, because I don't see any similar thread) Here's what I did:

    Table: master_hierarchy_level
    LEVEL_ID NUMBER (8.0) No.
    LEVEL_NAME VARCHAR2 (20 CHAR) NO.
    Yes LEVEL_DESC VARCHAR2 (320 BYTES)
    CREATION_DATE TIMESTAMP (0) WITH ZONE No.
    CREATED_BY VARCHAR2 (20 CHAR) NO.
    UPDATE_DATE TIMESTAMP (0) WITH ZONE Yes
    UPDATED_BY VARCHAR2 (20 CHAR) Yes
    VALID_FROM TIMESTAMP (0) WITH ZONE No.
    VALID_UNTIL TIMESTAMP (0) WITH ZONE Yes

    After you have created the 2 pages, I have change the data fields to the form page to display by default the date and time:
    one) mask format: DD-MON-YYYY HH24:MI:SS
    (b) source Type: SQL query...
    (c) value source: SELECT TO_CHAR(SYSDATE, 'DD-MON-YYYY HH24:MI:SS') FROM dual;

    For the created_by and updated_by fields, I did:
    (a) source Type: PL/SQL Expression or a function...
    (b) value source: APP_USER

    Nothing else, when I run the report and click on the button create, all goes well after having filled in the required fields and pushing the record button I get following error:

    ORA-01400: cannot insert NULL into ("MASTERDB_V01". "" "" MASTER_HIERARCHY_LEVEL '. "" CREATION_DATE')
    Error failed to process row in the MASTER_HIERARCHY_LEVEL table.

    I tried to find out why now already several hours and have no nails more to search,.
    can someone give me a hint :-)?

    Thanks in advance, Olaf

    OLAF,

    When you have changed the value of type/source of your date fields you deleted the connection of the page item in the database table/column.

    In other words APEX doesn't know that your date fields must be stored in the table.

    Please define the type of source to database column and use the default setting to set a default value for the date fields.

    brgds,
    Peter

    -----
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    Work: http://www.click-click.at

  • selection of a query as a table name in the reports

    Greedings,

    an example to explain what im trying to do

    allows said
    Query1: = table1. Name | | ' _Nom ';
    This result will be for example "citizen_code".

    what im trying to do is to select the specific query to obtain the required data

    Select code in: Code_P of query1@seconddatabase where...

    is it possible to do something like that?

    Thanks for your time,
    dem

    Hello

    Try to create a query such as this

    SELECT &P_COLUMN_1 COLUMN_1,
    &P_COLUMN_2 COLUMN_2,
    &P_COLUMN_3 COLUMN_3,
    &P_COLUMN_4 COLUMN_4
    FROM &table_name
    

    Note You must create the user settings before you create the query, and also all the column setting and the name of the table must have the valid default value.

    Best regards

    Arif Khadas

  • Apex 4.2, display image in the report.

    Hi all

    I'm a noob here Apex. I came across some problems with image display in a report. When I tried to have a report on a form of simple image download, it works perfectly with dbms_lob.getlength("IMAGEFILE") 'IMAGEFILE', workaround. Interactive report based on my table structure, already established the appropriate sections in report page for make my life easy.

    Problem when I tried to create the report of a SQL query combining three tables (Image3, CustomerDB, PATMAN2). The report now generates a page where I can not have any selection of BLOB. The textual part, appears perfectly.  I think my sql code is fine, but my generation of form Apex is faulty, but I need help to solve the problems.

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

    Here's the SQL code of the image gallery that works very well.

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

    Select "PUBLICATION_NO."

    "FILENNAME,"

    DBMS_LOB. GetLength ("IMAGEFILE") "IMAGEFILE",.

    "MIME TYPE"

    'PDFNAME '.

    DBMS_LOB. GetLength ("pdflink") "PDFLINK."

    "LASTUPDATED"

    "ID".

    of ' #OWNER # '. " IMAGE3.

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

    And here is the one which does not show correctly the BLOB type.

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

    Select PATMAN2.ID as ID,

    PATMAN2.PA as PA,

    PATMAN2. SUCH as TITLE,

    PATMAN2. OTHERS like the OTHERS,

    PATMAN2. TYPE as the TYPE,

    PATMAN2. PATENT_FAMILY as PATENT_FAMILY,

    CUSTOMERDB.COMPANY_ID as COMPANY_ID,

    PATMAN2. PUBLICATION_NO as PUBLICATION_NO,

    IMAGE3. FILENNAME as FILENNAME,

    DBMS_LOB. GetLength (IMAGEFILE) do IMAGEFILE,

    IMAGE3. PDFNAME as PDFNAME,

    DBMS_LOB. GetLength (pdflink) as PDFLINK,

    IMAGE3. MIMETYPE as MIMETYPE,

    PATMAN2. CUSTOMER_ID as CUSTOMER_ID

    of IMAGE3 IMAGE3.

    CUSTOMERDB CUSTOMERDB,

    PATMAN2 PATMAN2

    where PATMAN2. CUSTOMER_ID = CUSTOMERDB. CUSTOMER_ID

    and PATMAN2. PUBLICATION_NO = IMAGE3. PUBLICATION_NO (+)

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


    avman wrote:

    Interactive report based on my table structure, already established the appropriate sections in report page for make my life easy.

    Sorry, no idea what you mean by that.

    Problem when I tried to create the report of a SQL query combining three tables (Image3, CustomerDB, PATMAN2). The report now generates a page where I can not have any selection of BLOB.

    Still, it is far from clear what you mean by "that the report now generates a page where I can't have no matter what selection for BLOB".

    The textual part, appears perfectly.  I think my sql code is fine, but my generation of form Apex is faulty, but I need help to solve the problems.

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

    Here's the SQL code of the image gallery that works very well.

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

    Select "PUBLICATION_NO."

    "FILENNAME,"

    DBMS_LOB. GetLength ("IMAGEFILE") "IMAGEFILE",.

    "MIME TYPE"

    'PDFNAME '.

    DBMS_LOB. GetLength ("pdflink") "PDFLINK."

    "LASTUPDATED"

    "ID".

    of ' #OWNER # '. " IMAGE3.

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

    And here is the one which does not show correctly the BLOB type.

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

    Select PATMAN2.ID as ID,

    PATMAN2.PA as PA,

    PATMAN2. SUCH as TITLE,

    PATMAN2. OTHERS like the OTHERS,

    PATMAN2. TYPE as the TYPE,

    PATMAN2. PATENT_FAMILY as PATENT_FAMILY,

    CUSTOMERDB.COMPANY_ID as COMPANY_ID,

    PATMAN2. PUBLICATION_NO as PUBLICATION_NO,

    IMAGE3. FILENNAME as FILENNAME,

    DBMS_LOB. GetLength (IMAGEFILE) do IMAGEFILE,

    IMAGE3. PDFNAME as PDFNAME,

    DBMS_LOB. GetLength (pdflink) as PDFLINK,

    IMAGE3. MIMETYPE as MIMETYPE,

    PATMAN2. CUSTOMER_ID as CUSTOMER_ID

    of IMAGE3 IMAGE3.

    CUSTOMERDB CUSTOMERDB,

    PATMAN2 PATMAN2

    where PATMAN2. CUSTOMER_ID = CUSTOMERDB. CUSTOMER_ID

    and PATMAN2. PUBLICATION_NO = IMAGE3. PUBLICATION_NO (+)

    Did you specify IMAGE DOWNLOAD and BLOB format masks for the IMAGEFILE and PDFLINK columns? Select "BLOB" in the column of the number/Date Format attribute, then fill the section attributes of Blob column as requires it.

    We cannot solve what we cannot see. We do not have your tables or data so we can not replicate this for ourselves. Please reproduce the problem with an example on apex.oracle.com and developer comments login information for the workspace here.

  • Query on hierarchical query in interactive report!

    Hello

    In Apex Oracle 5.1, I tried to use an interactive report to view details of employee based on a hierarchy. I used the query to display data below:

    SELECT last_name, employe_id, manager_id, LEVEL

    Employees

    START WITH employee_id = 100

    CONNECT BY PRIOR employee_id = manager_id

    Brothers and SŒURS of ORDER BY last_name;

    The output was as below:

    LAST_NAME EMPLOYEE_ID MANAGER_ID LEVEL

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

    King                                100                                                       1

    Cambrault                        148                                 100                 2

    Bates                              172                                 148                 3

    Bloom                             169                                  148                3

    Fox                                 170                                  148                3

    Kumar                             173                                  148                3

    Ozer                                168                                  148               3

    Smith                               171                                  148              3

    De Haan                           102                                   100             2

    Hunold                              103                                   102             3

    Austin                               105                                   103             4

    Ernst                                 104                                   103             4

    Lorentz                              107                                   103             4

    Pataballa                           106                                    103            4

    Errazuriz                           147                                   100              2

    Ande                                 166                                    147             3

    Banda                               167                                     147             3

    ...

    Now, I would like to display data based on the connection of employees.

    For example (based on above request): If an employee named - Cambrault is the login, only employees under him (Bates, Bloom, Fox, Kumar, Smith, Ozer) and its own contact information should appear in the report.

    Please advise.

    Kind regards

    mebu

    Mebu wrote:

    I used a hierarchical query. But based on Login, I want to display only members under him.

    For example: If Cambrault LOGIN, only employees under him (Bates, Bloom, Fox, Kumar, Smith, Ozer) and its own coordinates must display in Oracle Apex.

    SELECT last_name, employe_id, manager_id, LEVEL

    Employees

    START WITH employee_id = 100

    CONNECT BY PRIOR employee_id = manager_id

    Brothers and SŒURS of ORDER BY last_name;

    See what/when/where? How to get the answers from the forum

    Describe the requirements clearly and completely, using the APEX, Oracle and terminology of web standard.

  • APEX in a table, add 3 default empty lines

    Hello

    I created a tabular presentation on my APEX page.

    Whenever he has some data in the table, it is displayed as below:

    I have to add 3 empty rows by default to the same when the first page load.

    In the dynamic actions, I tried to add a Java Script that add 3 blank lines by default on the page load event.

    JavaScript:apex.widget.Tabular.AddRow(); -This text is written by three times.

    However, the problem is when the page is loaded 2nd, 3rd time whenever 3 more empty lines gets added to the tab.

    I just WAN t 3 fault lines added only the first time when the page loads.

    Help please..!

    Capture.JPG

    Hi David,

    Step 1:

    Create branch on the Page that deals

    Type: Branch to the page or URL

    Branch point: present now (after calculation, Validation and treatment)

    Target type: Application Page

    Page: same number of pages / / assume that you create the branch on page 2 and then give 2.

    for example:

    Page: 2

    Application: APPLY_REQ / / here you can write the query that you want to pass after clicking on the button apply.

    Step 2: Change your dynamic action and put this request in the part of the State as suggested in previous post

    Change the dynamic Action

    Conditional - > select "ask!" = Expression1.

    Under Expression1-> APPLY_REQ

    If you still not able to solve so please create the sample on apex.oracle.com?

    and share the workspace name credentials and connect with the name of the application.

    that won't be easy for us to solve your problem.

    Kind regards

    Jitendra

  • Table of different status report

    Hello

    I need my report to show two situations in table form. A part of the table should show only the rows where inside the table database STATUS is 'Success' First table shows a few columns:

    Number_ID, name, surname, sex, etc...

    If there is a line with error in the STATUS column inside the table, second output table of report must show that, but only with the columns first name, last name and Message.

    Now, I had this arranged with GROUP BY, so that the word inside its group by STATUS, then table is divided into two parts, the first "success" and then if errors exist - lines with ERROR are grouped in the "second table". But this is not good, because both sides of table will have the same columns. For example, for the ERROR lines - Number_ID should not shown because these lines are not because they do not have spend in another table.

    I also think it would be good to show only what exists, the so no lines/table error if there is no error lines in the table.

    I know that I can show the conditional regions, as table based on <? If: >

    But I do not know how to implement this to display the output I want.

    I extract data from definition of XML data in the document, XML contains the SQL query that selects the lines in elements.

    Any ideas?

    Two tables one success and another for design error.

    Control data to help if (or) for each of the filters as below

    Table1:

    Table2

    (GOLD)

    Simply design dashboards and personalize your statements for each

    Here is an example of xml ROW structure.

    If you are not successful with this approach, thanks for posting your xml data

  • Multi table query with key foreign null.

    Consider the following tables

    create table student (
     id number not null,
     name varchar2(80),
    primary key(id)
    );
    
    create table course(
      id number not null,
      subject varchar2(120),
      primary key(id)
    );
    
    create table class(
     id number not null,
     name varchar2(80),
     day number,
     course_id number not null,
     primary key(id),
     foreign key(course_id) references course(id)
    );
    
    create table student_course(
      id number not null,
      student_id number not null,
      course_id number not null,
      class_id number,
      primary key(id),
      foreign key(student_id) references student(id),
      foreign key(course_id) references course(id),
      foreign key(class_id) references class(id)
    );
    

    The student may enroll in a course and then a Professor assign to a class, that's why foreign class_id key isn't a constraint not null.

    What I want is to write a query so that the student can see all courses, it is registered for the class, that he has been assigned and the day of the class, but the report should include courses where the student is not assigned to a class again.

    I wrote the following query.

    select
     course.subject,
     class.name,
     class.day
    from
      course,
      class,
      student_course,
      student
    where course.id = student.course_id
    and class.id = student_course.class_id
    and student_course.foititis_id = get_foititis_id
    

    However, I only get the lines where the student_course.class_id is not null.

    I tried various combinations of coalesce, nvl, decode in both the select statement and where statement, but the results where garbage.

    No idea if such a request is possible?

    Thanks in advance for any help.

    Hello

    Thanks for posting the instructions CREATE TABLE.  Don't forget to display instructions INSERT for a litle sample data and the results desired from these sample data.

    odysam wrote:

    ... I wrote the following query.

    1. Select
    2. race. Subject,
    3. Class.Name,
    4. Class.Day
    5. Of
    6. Of course
    7. class,
    8. student_course,
    9. Student
    10. where course.id = student.course_id
    11. and class.id = student_course.class_id
    12. and student_course.foititis_id = get_foititis_id

    However, I only get the lines where the student_course.class_id is not null.

    I tried various combinations of coalesce, nvl, decode in both the select statement and where statement, but the results where garbage.

    No idea if such a request is possible? ...

    It's logical.  The condition on line 11

    Class.ID = student_course.class_id

    will not be TRUE is student.course.class_id is null.

    As Someoneelse said, looks like you need an Outer Join.

    Inner joins, as you use above, produce results only when a row in a table has one matching row in another table.

    In this case (as far as I can tell without data sample or results), you want to display the rows in a table with their matching rows When THERE is a MATCHING ROWS, but you want to show each row of the first table in any case, if corresponding lines.  This is an outer join.

  • SQL query for the report?

    Hi all
    I have a large table with column:
    the code, street, data_type, credit, debt, saldo, date

    I created query as

    sum (saldo), code of Select tableA where data_types = 1 and date < ' 201010 "group by code

    but cannot develop this request to be in the report as

    COLUMN1 COLUMN2 COLUMN3 COLUMN4
    Sum (saldo) - where type = 1 and date = '201201', sum (saldo) where type = 2, sum (saldo) If date = '201205', code

    What is the best solution for sums of report for diferent data_types on a single line with just one code per lines?
    concerning
    Gordan

    Published by: useruseruser on May 14, 2013 10:52

    Hello

    useruseruser wrote:
    Hi all
    I have a large table with column:
    the code, street, data_type, credit, debt, saldo, date

    I created query as

    sum (saldo), Select tableA where data_types = 1 and date code<'201010' group="" by="">

    but cannot develop this request to be in the report as

    COLUMN1 COLUMN2 COLUMN3 COLUMN4
    Sum (saldo) - where type = 1 and date = '201201', sum (saldo) where type = 2, sum (saldo) If date = '201205', code

    What is the best solution for sums of report for diferent data_types on a single line with just one code per lines?
    concerning
    Gordan

    Published by: useruseruser on May 14, 2013 10:52

    You can use CASE what

     
    
    sum(saldo) -, sum(saldo) where type=2, sum(saldo) where date ='201205' , code
    
    select code,
      sum(case when type=1 and date = '201201' then saldo else 0 end) AS COLUMN1,
      sum(case when type=2 then saldo else 0 end) AS COLUMN2,
      sum(case when  date ='201205' then saldo else 0 end) AS COLUMN3,
      sum(saldo)
     from tableA
    group by code
    

    Concerning
    Mr. Mahir Quluzade

  • Access APEX_APPLICATION. G_F01 in a SQL query for a report

    APEX 4.0.2.00.07

    I have a standard report with check boxes. The SQL along the lines of:
    SELECT APEX_ITEM.CHECKBOX(1,empno,'CHECKED') " ",
           ename,
           job
    FROM   emp
    Then I have another report below, I want to drive based on the items checked in the first report. I know that the values of the checkbox in the APEX_APPLICATION. Collection of G_F01. Normally, these are accessible using pl/sql such as:
    FOR I in 1..APEX_APPLICATION.G_F01.COUNT LOOP
        DELETE FROM emp WHERE empno = to_number(APEX_APPLICATION.G_F01(i));
    END LOOP;
    But is it possible that I can access the collection from the sql for my second report.

    that is, I want my sql to be something like:
    SELECT empno, day_of_service
    FROM   emp_timesheet
    WHERE emp_no in <get access to the collection here>
    I was hoping that the collection box would be available in the APEX_COLLECTIONS view, but it doesn't seem to be there.

    Thank you
    John

    John,

    If the goal is to keep the values checked for another treatment then you could add them to a collection yourself.

    create a process on your page that looks like this:
    This will create your collection if not exist or don't delete everything currently in it if it exists and then insert your new selections.

    DECLARE
       l_col_name varchar2(30) := 'EMP_SELECTED';
    BEGIN
        apex_collection.create_or_truncate_collection(l_col_name);
        FOR I in 1..APEX_APPLICATION.G_F01.COUNT LOOP
            apex_collection.add_member(
                l_col_name,
                to_number(APEX_APPLICATION.G_F01(i))
            );
        END LOOP;
    END;
    

    your second question might look like this:

    SELECT empno, day_of_service
      FROM emp_timesheet
     WHERE empno in (select C001 empno
                       from apex_collections ac
                      where ac.collection_name = 'EMP_SELECTED')
    

    Edit
    Some people choose to create a view of some collection queries ontop that will be repeated throughout the application so we can just

    create view selected_emps as
    select C001 empno
      from apex_collections ac
     where ac.collection_name = 'EMP_SELECTED'   
    

    and your new query will look like:

    SELECT empno, day_of_service
      FROM emp_timesheet
     WHERE empno in (select empno
                       from selected_emps)
    

    See you soon,.

    Janet Tyson

    Published by: Tyson Janet on April 6, 2011 10:37

Maybe you are looking for

  • Helps the Possible Flash Player Solution

    My system is a 21.5 ", end of 2012 with 3.1 GHz processor I-7 and 16 GB of memory, with El Capitan 10.11.6 I had a problem with the spinning wheel of death and the freezing system in Safari.  I followed him there down to Adobe Flash Player.  Whenever

  • HP Pavilion 2312 G6 AX RAM upgrade

    I want to add an additional 4 GB RAM module with my existing 4 GB. I called HP support and they said that the product could not be improved beyond 4 GB. I did a search online and found that the product does support up to 8 GB of RAM. How to spend it?

  • Why is my Final Cut Pro in 'french '?

    I installed Final Cut Pro on my iMac and now I installed it on my MacBookAir and it is in the French language?

  • Unable to remote connect to another computer on the network home

    Greetings, I have a Windows 7 desktop computer and a laptop Windows Vista Edition full.  I am able to connect using the program of remote connection to the laptop from the desktop, but not the laptop on the desk.  I getan error that says "Remote Desk

  • To connect to a network projector search

    When a user launches the connect to a network projector there so the auto search function and enter the projector address. When you use the function of automatic search he finds nothing. Our company offers 2 spotlights the network with a wired connec