Need advice on how to create the report

I don't know how to do this, so I ask for advice from the gods apex...

Here is the question, I have two tables I need to combine the info from. not a problem in his car. I can do it. but here's the question. in table A, I have some data such as title, theids, disc_id, etc... Table B contains fullname, theid, emplid

now in the table A column "theids" is filled with apex as a multi select list. the values in the column is therefore something like 48; 3; 88

He got these identification numbers of the Table B (popup lov) query that returns theid of the one of the person.

now, I need to create a report that will be used in an excel download and what they want is a line by disc_id and they want the most useful "cost" in the field where to run the "theids." It is instead of:

disc_id title theids
101 the 48 test; 3; 88

they want:

disc_id title Theids
101 N33456, N3457, try N43562

so I'm a bit stuck, I can understand how to write a sql using instr to get something like this:
101 N33456 of test
101 N3457 of test
etc.

but this isn't what they want. so I think I need to create a package to do this and some sort of return values. the problem is that I can't figure out how I can replace the 48; 3; 88 to N33456, N3457, N43562

I'm still new to this kind of things pl/sql and apex sorry if this appears to be an obvious answer.

If you have a look at this example:

http://HTMLDB.Oracle.com/pls/OTN/f?p=31517:138

You'll see there

SELECT empno, ename, job, mgr, sal
  FROM emp
 WHERE INSTR(':'||:p138_select_empno||':', ':'||empno||':') > 0

and

p138_select_empno is a multiple selection list displaying the names of the employees and containing the string of nosm as 7888; 8900; 3499.

This info is enough to get to a function like this:

CREATE OR REPLACE FUNCTION get_string (p_string IN VARCHAR2)
   RETURN VARCHAR2
IS
   v_string   VARCHAR2 (4000);
BEGIN
   FOR c IN (SELECT ename
               FROM emp
              WHERE INSTR (':' || p_string || ':',
                           ':' || empno || ':'
                          ) > 0)
   LOOP
      v_string := v_string || ', ' || c.ename;
   END LOOP;

   v_string := LTRIM (v_string, ', ');
   RETURN v_string;
END;

and use this function in a report like this:

SELECT get_string (:p138_select_empno)
  FROM DUAL

Denes Kubicek
------------------------------------------------------------------------------
http://deneskubicek.blogspot.com/
http://www.Opal-consulting.de/training
http://Apex.Oracle.com/pls/OTN/f?p=31517:1
------------------------------------------------------------------------------

Tags: Database

Similar Questions

  • How to create the report using the procedure.

    Hi all

    I want to create the report in the apex. But I don't have a sql code. I have a single procedure. Is it possible to create the report using this procedure in the apex.

    CREATE OR REPLACE PROCEDURE headcsv_prc2

    AS

    CURSOR cr_header

    IS

    SELECT ood.organization_code, fm.formula_no AS "FORMULA_NAME."

    FM.formula_vers AS "FORMULA_VERSION."

    FM.formula_desc1 AS "FORMULA_DESC."

    DECODE (fm.formula_status,

    100, 'new ',.

    400, "approved for use in the laboratory."

    700, "allow the general."

    800, "We Hold."

    900, "frozen."

    1000, "obsolete/archived.

    ) AS "FORMULA_STATUS."

    DECODE (fd.line_type, '1', msib.segment1).

    DECODE (fd.line_type, '-1', msib.segment1 ') ingrediant.

    DECODE (fd.line_type, '2', msib.segment1) AS "BY_PRODUCT."

    DECODE (by_product_type,

    "W', 'waste."

    "R',"rework. "

    "Y', 'Yield."

    The of ', 'Sample. "

    NULL VALUE

    ) AS "BY_PRODUCT_TYPE".

    Of org_organization_definitions ood,.

    fm_form_mst fm,

    fm_matl_dtl fd,

    mtl_system_items_b msib

    WHERE ood.organization_id = fm.owner_organization_id

    AND fm.owner_organization_id = msib.organization_id

    AND msib.organization_id = fd.organization_id

    AND fd.organization_id = ood.organization_id

    AND fm.formula_id = fd.formula_id

    AND msib.inventory_item_id = fd.inventory_item_id

    - and fm. FORMULA_NO like '% THE % '.

    AND fd.line_type IN ('1 ', ' 2', '-1' ")

    Ood.organization_code GROUP,

    FM.formula_no,

    FM.formula_vers,

    FM.formula_desc1,

    FM.formula_status,

    FD.line_type,

    MSIB. Segment1,

    by_product_type

    ORDER BY fm.formula_no, fm.formula_vers;

    BEGIN

    Dbms_output.put_line (INITCAP ('the ORGANIZATION CODE')

    || ','

    || INITCAP ('NAME FORMULA')

    || ','

    || INITCAP ('FORMULA VERSION')

    || ','

    || INITCAP ('FORMULA DESC')

    || ','

    || INITCAP ('FORMULA STATUS')

    || ','

    || INITCAP ('PRODUCT')

    || ','

    || INITCAP ('INGREDIANT")

    || ','

    || INITCAP ("PER PRODUCT")

    || ','

    || INITCAP ('PER TYPE OF PRODUCT")

    );

    FOR ch IN cr_header

    LOOP

    Dbms_output.put_line (ch.organization_code

    || ','

    || ch.formula_name

    || ','

    || ch.formula_version

    || ','

    || '"'

    || ch.formula_desc

    || '"'

    || ','

    || ch.formula_status

    || ','

    || ch. Product

    || ','

    || ch.ingrediant

    || ','

    || ch.by_product

    || ','

    || ch.by_product_type

    );

    END LOOP;

    EXCEPTION

    WHILE OTHERS

    THEN

    Dbms_output.put_line (' No error: ' |) SQLCODE. "Error Msg: ' '.

    || SQLERRM

    );

    END;

    EXEC HeadCSV_Prc2



    Thank you

    Rambeau

    Hi Christian,

    In addition to the fact that the Oracle database has an internal Java engine and it would be possible for Apex call a Java stored procedure, the Apex really has nothing to do with Java. To create a report, you discovered, you specify a SQL query. In certain circumstances, you can embed a query in a PL/SQL function, but the incorporation of an arbitrary Java application and waiting for it to be called from Apex for a kind of security is there with the fairies.

    I recommend you research the Apex and then enter your so-called "higher authorities" how things work.

    Concerning

    André

  • How to create the report of this style?

    Hello

    I have a problem when creat a report using obiee, this is a monthly report, the layout like calendar,.

    There is a quick baseed on the month, if I choose 201109, the report will be poster of daily sales and the number of customers in September.

    Every day have the sale and every day must be listed, first line display name of 7 days, second row shows sales and number of customer information,

    third row display name of 7 days, and all the following steps.

    1 sep | 2 sep | 3 sep | 4 sep | 5 sep | 6 sep | 7 sep
    Sales: sales: 10 sales: 10 sales: 10 sales: 10 sales: 10 sales 10,10
    : No.10 No.: No. 10: No. 10: No. 10: No. 10: 10 no: 10

    8 sep | 9 sep | 10 sep | 11 sep | 12 sep | 13 sep | 14 sep
    Sales: sales: 10 sales: 10 sales: 10 sales: 10 sales: 10 sales 10,10
    : No.10 No.: No. 10: No. 10: No. 10: No. 10: 10 no: 10

    15 sep | 16 sep | 17 sep | 18 sep | 19 sep | 20 sep | 21 sep
    Sales: sales: 10 sales: 10 sales: 10 sales: 10 sales: 10 sales 10,10
    : No.10 No.: No. 10: No. 10: No. 10: No. 10: 10 no: 10

    22 sep | 23 sep | 24 sep | 25 sep | 26 sep | 27 sep | 28 sep
    Sales: sales: 10 sales: 10 sales: 10 sales: 10 sales: 10 sales 10,10
    : No.10 No.: No. 10: No. 10: No. 10: No. 10: 10 no: 10

    29 sep | 30 sep
    Sales: sales 10: 10
    No: 10 no: 10

    Thank you! waiting for your response.

    So you're a user same as below:
    How to view the report by using the style of calendar in obiee

    Follow my instructions. Also, give a look at this http://bischool.wordpress.com/2010/10/22/calendar-view-in-obiee-and-applications/

    You can have dates instead of the name of the day, but you must ensure that your definition is very clear in your time dimension i.e. each week week 7 days. You table looks like his week to jump and you have each month as 30.31 or 28 days...

    Come and play and you're done... hope its helpful

  • How to create the report in the following form?

    Hi all

    How I use studio EN to create reports.
    I want to create a report that will show me accounts and accounts of each entity, which means I want to keep the entity in the size of the page in the dimension of the line. The report should be done in such a way that if I take an entity in the dimension of the page then it will show a few accounts in the dimension line that
    are specific for this entity and in the same way, if I take another entity in the dimension of the page then it should show me another different set of accounts in
    the dimension of the row corresponding to this specific entity.
    How can I do this in my report?


    Thank you

    There are two ways that you can achieve this goal.

    You have never given in combinations of entity/account disabled? If this isn't the case, I would like to delete missing lines.

    Is there the potential for existing data in invalid combinations of entity/account, then I would create a specific account that defines the valid combinations. Think of it as a Boolean, a value of 1 for the valid combinations or 0 for invalid combinations. I would then use the 'Advanced Options' en to delete values based on this account.

    Hope this helps,
    -Jake

  • Need advice on how to analyze the integrated calculation

    Hello

    I have a following problem:

    I have a table1 where I have the list of parameters to their current values;

    I have a table2 where I have a list of calculations that use these input parameters; the formula is stored as a string in a field

    I also have a table 3 where I have a list of calculations with the corresponding parameters, which are used by them;

    I also have 4 table, which must contain the result of a calculation according to the formula of table2 with values of parameters from table1

    requirement: procedure that will populate the table 4.

    my original idea was to do the following:

    1 call the procedure with the id of calculation

    2 extract the list of parameters for calculating id

    3 assign the values from table1 to the parameters of the step 2

    4. run the formula with the assigned values-> new procedure called with the formula and table of variables/parameters? dynamic SQL?

    can you please advise me what will be the best approach here?

    Thank you for the advice

    Some examples of data

    / * remove the table TEST_PARAMS;

    drop table TEST_CALC;

    drop table TEST_CALC_PARAM; * /

    /

    create the table TEST_PARAMS

    (

    param_id varchar2 (10),

    varchar2 value (50)

    )

    /

    insert into TEST_PARAMS values('param1',15);

    insert into TEST_PARAMS values('param2',25);

    /

    create the table TEST_CALC

    (

    CALC_ID varchar2 (10),

    CALC_FORMULA varchar2 (50)

    )

    /

    insert into TEST_CALC

    values ("CALC1",'(param1 + param2) / (param1 * param2)')

    /

    create the table TEST_CALC_PARAM

    (

    CALC_ID varchar2 (10),

    CALC_PARAM VARCHAR2 (10)

    )

    /

    insert into TEST_CALC_PARAM values ("CALC1", "param1");

    insert into TEST_CALC_PARAM values ("CALC1", "param2");

    COMMIT;

    /

    Thank you very much

    Rgds

    XQUERY + MODEL:

    with t as)

    Select calc_id,

    calc_formula,

    Expr,

    r

    of test_calc c,.

    test_params p

    model

    partition (c.calc_id calc_id)

    dimension by (row_number () over (partition by order of 1 c.calc_id) r)

    measures)

    calc_formula,

    Replace (calc_formula, ' /', 'div') expr.

    param_id,

    value

    )

    rules)

    expr [any] order of r desc = regexp_replace (nvl (expr [cv () + 1], expr [cv ()]), param_id [cv ()], value [cv ()])

    )

    )

    Select calc_id,

    calc_formula,

    result xmlcast (xmlquery (expr content return) under the number)

    t

    where r = 1

    /

    CALC_ID CALC_FORMULA RESULT
    ---------- -------------------------------------------------- ----------
    CALC1 (param1 + param2) / (param1 * param2).106666667

    SQL >

    SY.

  • How to create the report using pass-in parameters

    Hi all

    I want to create a report using the parameters passed from the previous page. Let's take an example:

    Now in page B, he got 2 parameters P1_Table, P1_column, from Page A, I want to get the report:

    Select * from P1_Table, where P1_column like 'test % ';

    This means that I want to get the date in the P1_Table table and its P1_column begins with the character 'test'.

    I tried to use dynamic sql in the source of the region, but failed.

    Please help me

    Thanks in advance.


    PPMonkey

    Published by: PPMonkey on January 4, 2009 12:53 AM

    Hello

    Ensure that the report is a "SQL (body of function from PL/SQL returning the SQL) query. Then, use a source of something like:

    DECLARE
     vSQL VARCHAR2(4000);
    BEGIN
     vSQL := 'SELECT * FROM ' || v('P1_TABLE') || ' WHERE ' || v('P1_COLUMN') || ' LIKE '''test%''';
     RETURN vSQL;
    END;
    

    Andy

  • How to create the report with check box (Update, Delete) operations

    Hi all

    I want to create report with check boxes.

    I created it based on the user's manual. But do not delete records. Please help me

    Apex. Oracle.com

    workspace: APPSGURU

    RAMBEAU. [email protected]

    P.W:rag$ 123

    Application:36232

    Page: 14

    Thank you and best regards,

    Rambeau

    Raghu,

    Request for check line deleted successfully.

    made some changes in the removal process.

    Leave.

  • Need advice on how to recover the Aero theme

    I lost the theme Aero Windows Vista Edition Home Premium. Have you tried everything to bring him back, but the "themes" is no longer the same figure as in services.msc. Any ideas on how to get that back? Do not appear as an option in customize. Desktop window manager is launched and running, etc.
    Thank you

    Maybe this might help you:

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_vista-desktop/Aero-theme-is-no-longer-working-in-Windows-Vista/9f384572-df25-4d13-a825-9082dcfa266a

    LC

  • BlackBerry Smartphones Hi all need advice on how to transfer the address of .ipd fileon list my PC to the torch.

    Hi my name is Rema. Just got my 2nd BB, a torch to replace my old Bold.Am of 2 years already having problems and I hope someone can help.

    first of all, when I do a backup of sync, I get an error Ox80040057 Gael. I have no ide what it means

    Secondly, I can't transfer the address list in the file .ipd of my "BOLD" on my PC to the torch.

    I tried to use magicberry read and check if the .ipd document is readable.

    Please notify. Thank you.

    Have you tried using the BlackBerry Desktop Manager's restore function to transfer contacts? Check the below section of the knowledge base for more details.

    KB10339  How to use BlackBerry Desktop Manager to restore the data to a BlackBerry smartphone from a backup file

  • Need help on how to create the transformation of the Park by using the MathScript node?

    Hello

    I want to generate a transformation of the Park by using the MathScript node. But there is an error message which confused me. Please can someone help me to have a look of my program? Thank you!

    The error message is "error-90011 occurred in error in the function mail to line 1.  The sizes of the input matrices are incompatible.
    Check that the matrices have the same size or one is a scalar.

    Possible reasons:

    LabVIEW: Sizes of the input matrices are incompatible.  Check that the matrices have the same size or that one is a scalar".

    Hello

    The problem is that all of your entries to the MathScript node are vectors.  All entries of the vector to the MathScript node becomes vector lines.  A multiplication of two vectors lines generates a size mismatch error.  If you really want a scalar of this multiplication of output (by calculating the dot product of vectors), then you have to bring your 'a', 'b' and 'c' vectors or your vector of 'x '.  If you want everything just multiply your elementwise vectors and produce an output vector, you must use the elementwise multiplication operator '. *' (time point).  Use this operator between your 'a', 'b' and 'c' vectors and your calculation of fishing.  For example, on your first line,
    d = (2/3)*a.*(sin(x))+(2/3)*b.*(sin(x-(2*pi/3)))+(2/3)*c.*(sin(x+(2*pi/3)));

    Don't forget to also change your output to a 1 d of DBL array variables.  You can do this by right-clicking on the output variable and selecting "Choose Data Type."

    Grant M.
    Staff software engineer | LabVIEW Math & Signal Processing | National Instruments

  • How to create the report when your shared drive is full?

    I want to see the owner, size and date.for of the internal purposes.

    Hello

    • Work on the domain network?

    If the computer is not on the domain, you must use a third-party tool to use this feature.

    Note:

    Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

  • How to create the snap shot report of multiple Vcenters.

    Hi all

    How to get the report of several VC in html file snapshot. , I am attaching the out put the HTML file and the script I used.

    Get the consolidation SP report I'm missing the name of VC. In the out put 1 rank is the SP of Vcserver 1 & 2nd row is to serve as a VC 2

    I need to get the name of VC in the corresponding column.

    Thanks in advance.

    SIV

    You can try this:

    
    # Adding PowerCLI Snapin
    if(!(get-pssnapin | where {$_.name -eq "vmware.vimautomation.core"})) {
            try {
                add-pssnapin VMware.VimAutomation.Core| out-null
            } catch {
                throw "Could not load PowerCLI snapin"
            }
    }
    $VIServer = "vcenter1","vcenter2"
    $Report = @()
    foreach($VCserver in $VIserver){
        $currentVC = Connect-VIServer -Server $VCserver -Protocol https -User administrator -Password Pass@123
        $Header = @"
                
                Snapshot Report - $VcServer
    "@
    $a = Get-VM -Server $currentVC | Get-Snapshot | Select VM,@{N="VCname";E={$currentVC.Name}},Name,Description,Created,SizeMB,SizeGB
        If (-not $a){
            $a = New-Object PSObject -Property @{
            VCname = "No snapshots found on any VM's controlled by $($currentVC.Name)"
            VM = ""
            Name = ""
            Description = ""
            SizeGB = ""
            Created = ""
            }
        }
    Disconnect-VIServer $currentVC -Force -Confirm:$false
    $Report += $a
    }
    $Report = $report | Select VCname,VM,Name,Description,SizeGB,Created | ConvertTo-Html -Head $Header -PreContent "

    Snapshot Report


    " $Report | Out-File "C:\VM-operations\dailyreport\SnapShotReport.html"
  • How to create a report based on the item selected from the list of selection?

    Hello

    I created a tables_LOV based on:

    Select table_name table_name user_tab_cols r, d

    where column_name like '% _type % '.

    Then I created a ListOfTables page element, display in a selection list and pointing to tables_LOV.

    I run the page, and I can choose the table I want in the drop-down list.

    How to create a report based on the selected element? (ex: select * from selected_table)

    Thanks in advance

    Salah

    Hi Salah,

    Allright, take a look at this page: http://apex.oracle.com/pls/apex/f?p=vincentdeelen:collection_report

    I think that simulates what you are trying to accomplish. I've implemented the simplest method I could think of.

    The report is based on a collection of apex. If you are not familiar with this, you should study the documentation: APEX_COLLECTION

    To recreate my example, you should:

    (1) create a report (interactive) on your collection

    SELECT *
       FROM APEX_collections
     WHERE collection_name = 'MY_COLLECTION'
    

    (2) create a selection list page_item for the tables that you want to display (in my case, this is called "P38_TABLES")

    (3) create a dynamic action that triggers on the evolution of your selection list page_item. Dynamic action must be a parade of PL/SQL procedure the following code:

    declare
      l_query varchar2(4000);
    begin
      l_query := 'select * from '||:P38_TABLES;
      if apex_collection.collection_exists
            ( p_collection_name => 'MY_COLLECTION' )
      then
        apex_collection.delete_collection
          ( p_collection_name => 'MY_COLLECTION' );
      end if;
    
      apex_collection.create_collection_from_query
        ( p_collection_name => 'MY_COLLECTION'
        , p_query           => l_query
        );
    end;
    

    Make sure that you add your page_item 'Page to send items' section.

    (4) add a real extra action that makes an update of the report area.

    Here are two photos describing the da:

    http://www.vincentdeelen.com/images/OTN/OTN_COLLECTION_REPORT_DA1.PNG

    http://www.vincentdeelen.com/images/OTN/OTN_COLLECTION_REPORT_DA2.PNG

    Good luck and greetings,

    Vincent

    http://vincentdeelen.blogspot.com

  • How to create editable report manually even as a default with on report send the page


    Hello

    Is it possible to create the report updatable manully would even editable report by default.

    I created 4 report can be updated in a single page, but submits the entire page when adding empty lines.

    I need to add additional blank lines using dynamic measurements or any otherwise with the page request.

    Thank you

    RJ

    Thank you Lakshmi,

    His work!

  • How to create a report page by using the Web layout editor

    Hi Experts,

    I use wcc11.1.1.7, I need to create the report page by using the Web layout editor, but in this applet (editor), there are only 3 types of link to the page: local page, external page, query, it must be of type of the active report (historical), why I can't see them? y at - it components should I activate this?

    Best regards

    It doesn't have to be in the link on the Page, but in the Page Type.

    See the documentation for http://docs.oracle.com/cd/E28280_01/doc.1111/e26694/e02_weblayout_edit.htm#i1068085 for more details.

Maybe you are looking for