Loop lines in the SQL report.

Hi all

I have created a very different application, and I ran into quite the roadblock.
Let me give you a brief on the problem.
I have a form that must be dynamic and therefore is created during execution.
I used the APEX_ITEM and a SQL SELECT CASE to create a dynamic report.

For example if the DATATYPE column in my table shows the DATE, I create an APEX_ITEM. DATE_POPUP, if it says CHAR I create a text box, and if a column called
LOV is filled APEX_ITEM. SELECT_LIST_FROM_QUERY using the numerical value of the LOV to query a list of values from a different table.

Now, this leads me to say in a single column of there could be different data_types. which means that the update feature several lines with apex will not work.
It's easy to get the data to display. However to save updates is another story.

Which brings me to my question. Does anyone know way in which you can loop through each row in a SQL on APEX report and evaluate each line individually.
I would like to accomplish something like that

LOOP
MyUpdateProcedure (currentrow_id, currentrow_datatype, currentrow_value)
Go to the next line in the report
END LOOP;

Quite simple in theory? We have an APEX expert out there that could give me a hand with this?

Codes,

It seems to me that you could add a hidden field to tell you what you need to know in order to determine the column update.

Assuming that it has been created using the parameter p_idx = 50 and contained the names you have provided (for example DATA_DATA) and your primary key is created using p_idx = 1, then you could add the logic of the update in a suite submit process something like this

BECAUSE me in 1... apex_application.g_f01. COUNTY
LOOP
CASE apex_application.g_f50 (i)
WHEN "DATA_DATA" THEN
-Run the update on the data column
WHEN "CHAR_DATA" THEN
-Run the update on the column of char type

etc.

If the multi-type column is created with the api apex_item by using p_idx = 2 then you just reference it in the loop as apex_application.g_f02 (i) and the primary key is apex_application.g_f01 (i).

I hope this helps.

Greg

Tags: Database

Similar Questions

  • How we get enough space for a column in the SQL report?

    How did one reserves enough spaces for a column in the SQL report?

    Ex: 2 columns defined as follows

    projectNo varchar2 (10)
    ProjectName varchar2 (50)

    When creating a sql, the report header report will show below. If my project name is 'Tire force Test site R987654'. I need to show in a single line, since it has been defined as varchar2 (50)
    projectNo     ProjectName
    A0001         Tire Strength
                  Test At Site
                  R987654 
    It have a way to get around here. Thanks in advance.

    Tai

    You can enter "space: nowrap;" in the CSS Style of the column, or, better yet, to set a CSS class to it.

    HTH,
    Chris

  • End of the characters on the line in the SQL worksheet

    Hello

    All of a sudden end of characters on the line in the SQL in SQL Developer worksheet.

    Can someone please advice how to hide those?

    It looks like 2 ' < ' characters followed by a mathematical symbol Pi.

    Thank you
    Sagay

    Tools | Preferences | Code editor | Display | Show the white space characters

  • Change the SQL report to Intractive report

    Dear friend


    I created the SQL report.

    Could you tell me please, there is a way to change the SQL report to Intractive report.

    How can I do that.

    Thank you

    Under the Definition of the region of the report; look over to the right margin and you will see interactive report-migrate under tasks .

    The f

  • Line break in the SQL report

    Hello
    I use APEX 4.0 worm. I created SQL report with 1 column and his looks good but problem is this column has a huge amount of data for example 1000 words and in the report, it is the display as *.

    so I don't want to show continuous words and I want to display the data as a *.
    ********************
    ********************

    How could I break the line of contonous and the same display on multiple lines.

    Thanks in advance.


    Concerning
    Veronica B

    {: identifier of the thread = 2386749}

  • Select the line of the classic report to pass the value to another classic report on the same page

    Hello

    First a few details about the environment - I use the image of the last download oracle VM developer days to oracle.com. This includes DB version 12.1.0.2 and version 4.2.5.00.08 Apex. For the question although I don't know the specifics of the versions that are relevant.

    What I want to do an apex page which includes an analytical section at the top, followed by a section of retail slot - a line is selected / highlighted at the top which causes the relevant lines in this summary line is displayed. Its screen basically a master-detail - however the source of these two sets of data is just a query - is not a table.

    The query at the top of the page is something like

    Select * summary

    and the section below is

    Select * from details where id = (the value of the id clicked in the summary above)

    This feels like it should be really easy (and indeed, it is for the tables through the apex of master-detail Wizard) - but I can't understand when the two sets of data are the result of queries.

    I can't seem to make reference to the elements of the page when it comes to a report and I think that I might need to go down a kind of dynamic route of actions and jquery, but I don't get very far very fast. I found some notes that seem similar, but nothing which does exactly what I want. The function APEX_APPLICATION to browse a table also doesn't seem to be possible for the output report that I could see (tags are not there) - what is relevant for the forms?

    I hope that I have explained that quite simply.

    Can anyone help?

    See you soon,.

    Rich

    You link column can be just a null value in the sql code, if you want. Change the column and head down to the link attributes.

    Text link: "Click me" (source of sql using #MY_COL columns or #)

    Target: URL

    URL: javascript: $s ('P1_ITEM', #ID);

    Then have onChange dynamic action on P1_ITEM which updates the State. Do not forget to present the value of session state (either property right under the sql or pl/sql prior to update action report). The database needs to know the value of browser before running the query.

  • Highlight a line in the classic report based on condition

    HI all the gurus

    Apex 4.1.1 using oracle 11g linux oc4j

    I want to emphasize a line where #column_value #= 'Y' to keep gray others like normal report parameters.

    I have a simple sql query

    SELECT PK_ID,
      FIRST_NAME,
      LAST_NAME,
      INITIAL_REG_DATE,
      MAIL_DATE,
      BEGIN_DATE,
      END_DATE,
      END_DATE-BEGIN_DATE as "#days",
      BEGIN_STATUS,
      END_STATUS,  
      COMMENTS,
      DELETE_FLAG,
     case when  DELETE_FLAG='Y' then 'GREY' else '#f0f0f0' end  DELETE_FLAG ,
    INITIAL_REG_DATE+(END_DATE-BEGIN_DATE) "New Reg end date"
    FROM SOR_TRACKING_DEL
    where pk2_id =:P216_Detail
    order by mail_Date desc
    
    
    
    

    I created a dynamic action

    who will be the tree on load, LINK on this classic report

    $("input[name=f29]").each (function () {}

    var lThis = $(this);

    {if (lThis.is("Y"))}

    lThis.parents("tr:eq(0)").children("td").css({"background-color":"GREY"});)

    } else {}

    lThis.parents("tr:eq(0)").children("td").css({"background-color":"#f0f0f0"});)

    }

    });

    But it doesn't change color as expected...

    Kindly help me!

    Thank you

    Scott and Tom

    Thank you guys for looking into this.

    Pls ignore my incorrect explanation and my inexperience with jquery.

    I read some blog and trying to do the same on the classic report, but all blogs, I found to this day called interactive report or tabular report, that none of them mentions classic report.

    I assume that using the classic report will not be a good idea to start with. :/

    I don't know if this is the proper syntax and logic to highlight the line

    $(function(){

    varDELETE_FLAG = $(this);

    If DELETE_FLAG.is("Y"))

    {

      DELETE_FLAG.parents("tr").children("td").css({"background-color":"GREY"});).

    }});

    I also created app here

    http://Apex.Oracle.com/pls/Apex/f?p=35155

    get out of the workspace

    Tester/testing

    request 35155

    Thanks again.

  • Highlight the line in the sql statement

    Using APEX 3.2

    How can I highlight a row (changing fonts colors or change the background color) on a sql report based on a value in a column? If the BALANCE_AMT column is negative, I would like to point out the line.

    Thanks for your suggestions offered!

    Sandie

    Just a guess but I think your column #BALANCE_AMT column data # are not quite a number. There is a comma in the Oracle error: error parsing of expression PLSQL. -388,200<>

  • Remove the line from the Excel report when generating reports

    Hi all

    I try to delete whole lines of the report excel during the generation of the report in excel, but I'm not able to do this. Here I am attaching an excel template, in that I want to delete line no 3 to 5 How can I do this. I'm using LabVIEW 8.6 Report Generation Toolkit for Microsoft Office 1.1.3

    Thanks and greetings...

    If there is no function to generate report for simple operations like this, then use the palette of VBA macros to run this code snippet:

    'remove all lines between two rows inclusive '.
    Void DeleteRows (intTopRow As String, intLastRow As Integer)
    Range (cells (intTopRow, 1), (intLastRow, 1)). EntireRow.Delete xlShiftUp
    End Sub

    Import Excel module allows to load the .bas file then run Excel Macro with parameters 3 and 5.  Check your security settings if you get an error in the macro.

  • highlighting of lines in the classic report

    I have a classic report with a disabled checkbox that I check a program.

    Using the 25 Standard - apex 4.2.1 report theme

    Only alternate lines are changed by the JavaScript below. Don't know what I have to do

    for all verified ranks has highlighted.

    I created an example on the website of oracle apex.

    user name: [email protected]

    password: whiskers

    http://Apex.Oracle.com/pls/Apex/f?p=36690:2:112760870106921:

    LOCATE THE REPORT * CODE

    Select ename, empno, mgr, hiredate, sal, comm, deptno, job,

    apex_item. CheckBox2 (p_idx = > 29, p_value = > empno,)

    p_attributes = > DECODE (deptno, 10, "checked")

    30, 'checked', NULL)

    || "disabled = disabled") action.

    apex_item. RadioGroup (p_idx = > 30, p_value = > empno,)

    p_attributes = > rb DECODE(deptno,10,'disabled=disabled',))

    WCP

    ******************************CODE ****************************

    I'm trying to highlight the lines when the boxes are ticked and used the code depending on what can be found here:

    onLoad = "javascript:changeTableColor();" »

    ******************************CODE ****************************

    < script type = "text/javascript" >

    var szColorTo = "#F5D0A9";

    var szColorOriginal = "#CCCCCC";

    function changeRowColour (pTarget)

    {

    pTR var = pTarget.parentNode.parentNode;

    If (pTR.nodeName.toLowerCase ()! = 'b')

    {

    return;

    }

    if(pTarget.Checked == true) {}

    pTR.style.backgroundColor = szColorTo;

    } else {}

    pTR.style.backgroundColor = szColorOriginal;

    }

    }

    function changeTableColor() {}

    var columnArray = document.getElementsByName ("f29");

    for (i = 0; i < columnArray.length; i ++)

    {

    changeRowColour ([i] columnArray);

    }

    }

    < /script >

    Hello

    Here is an example of use of jQyery

    $("input[name=f29]").each(function(){
    var lThis=$(this);
    if(lThis.is(":checked")){
      lThis.parents("tr:eq(0)").children("td").css({"background-color":"#F5D0A9"});
    } else {
      lThis.parents("tr:eq(0)").children("td").css({"background-color":""});
    }
    });
    

    Create a dynamic action that fires after the region refresh JavaScript execution. Place above in the code.

    Kind regards

    Jari

  • Disorder by displaying all the lines in the classic report

    Hello

    I have a classic report coming out data based on the variable binding element (which is a selection list). Some entries should have about 200 lines, but the page shows only 15 lines.

    I tried assign none to paging still don't see all the lines. Here is my setup for the pagination of the table: http://i.imgur.com/iQoG0.png

    If I get my pagination back, then I have the chance to see all the lines by clicking next but I need to show all the lines in the page. Is this what I need to do besides assign none to paging?

    Apex 4.1.1

    See you soon

    Hello
    >
    I have a classic report coming out data based on the variable binding element (which is a selection list). Some entries should have about 200 lines, but the page shows only 15 lines.

    I tried assign none to paging still don't see all the lines. Here is my setup for the pagination of the table: http://i.imgur.com/iQoG0.png
    >
    The question of the number of lines determines the number of lines on the page. You have set to 999, which seems correct.
    >
    If I get my pagination back, then I have the chance to see all the lines by clicking next but I need to show all the lines in the page. Is this what I need to do besides assign none to paging?
    >

    Add a paging process reset point treatment "before areas" (or anywhere before this) and you will be ok.
    The browser cache does not clear the paging alone sometimes.

    See you soon,.

  • Column headings missing when the SQL report runs Oracle Conc ask

    Why the column headers for a sql report do not disappear when I try to run Oracle Manager of competing application work? If I copy and paste work in SQL * more and run it, the topics show on the report. Is there a setting I can update to allow these column headers to display?
    Example of what I get (No Headings)
    
    TOM SMITH          12345
    JANE DOE           34355
    
    Example of what I expect (with Headings)
    
    EMPLOYEE           EMPLOYEE NO
    TOM SMITH          12345
    JANE DOE           34355
    Thank you

    More likely:

    SET THE POSITION

    into force or / and

    SET PAGESIZE 0

    is in effect.

    SY.

  • Background color of the current line in the interactive report

    Hello
    Sobebody could tell me if there is anyway simple changing of style in IR to set up the background color of the current line. In the Standard report, it is easy. Just click for the shared components > models > modify a report model
    and in the section line pointing out it is an attribute to change a color.

    Can someone tell me how to do in interactive report?

    I want to just split one row of the other using a line color.

    Thanks :)

    Published by: rafix 2009-11-23 09:42

    Cool. Where is my correct score then: P

    Mike

  • You have no lines for the SQL query to select

    Dear Sir.

    I don't want to choose these lines in the second query, please guide me how to do.

    Request-> 1

    (SELECT ID_NO, ATTND_DATE
        FROM ATTND_REGISTER 
        WHERE ATTND_DATE BETWEEN :FD AND :TD
        ORDER BY ID_NO, ATTND_DATE
    )AT
    

    A query result.

    ID_NOATTND_DATE
    E1FEBRUARY 1, 14
    E1FEBRUARY 2, 14
    E13 FEBRUARY 14
    E14 FEBRUARY 14
    E1FEBRUARY 5, 14
    E1FEBRUARY 6, 14
    E1FEBRUARY 7, 14
    E1FEBRUARY 8, 14
    E1FEBRUARY 9, 14
    E110 FEBRUARY 14
    E1FEBRUARY 11, 14
    E1FEBRUARY 12, 14
    E1FEBRUARY 13, 14
    E114 FEBRUARY 14
    E115 FEBRUARY 14
    E116 FEBRUARY 14
    E117 FEBRUARY 14
    E118 FEBRUARY 14
    E119 FEBRUARY 14
    E120 FEBRUARY 14
    E4FEBRUARY 1, 14
    E4FEBRUARY 2, 14
    E43 FEBRUARY 14
    E44 FEBRUARY 14
    E4FEBRUARY 5, 14

    Request-> 2

    : VALUE OF THE VARIABLE FD = 1 FEBRUARY 14

    : VALUE OF THE VARIABLE TD = FEBRUARY 28, 14 '

    SELECT A.ID_NO,B.DATES,A.EMP_NAME, A.DESG_NAME
    FROM
      (
        SELECT  ROWNUM - 1 + TO_DATE(:FD, 'DD/MM/RR') DATES
        FROM ALL_OBJECTS
        WHERE ROWNUM < TO_DATE(:TD, 'DD/MM/RR') - TO_DATE(:FD, 'DD/MM/RR') + 2
      )B,
    
    
      (
        SELECT ID_NO, INITCAP(FL_NAME) AS EMP_NAME, INITCAP(UBN.DESG_NAME(DESG_ID)) AS DESG_NAME
        FROM PERSONAL
        WHERE (STATUS = 'A')
        AND (COMPANY_CODE = :COMPANY_CODE)---COMPANY CODE=6
        AND (ID_NO = :ID_NO OR :ID_NO IS NULL)
      )A
    ORDER BY A.ID_NO,B.DATES;
    


    Solved

    I changed in the second query with using the first query.

    in Where Clause

    WHERE B.DATES | A.ID_NO NOT IN (SELECT ATTND_DATE |) NBI ID_NO. ATTND_REGISTER

    WHERE ATTND_DATE BETWEEN: FD AND: TD)

    Thank you Allah (SWT).

  • Add the check box for each line in the classic report

    Hello

    I created the report classic with checkboxes in each row and added the On-Submit process, BUTTON CONDITIONAL, to determine the behavior of the boxes. The process of PL/SQL is suppose to delete the selected row from the database.

    I get the success message, but when I check the database, the line is still present in the database.

    PLSQL CODE:

    FOR i IN 1.. apex_application . g_f01 . County LOOP

    DELETE
    Of
    Registry
    WHERE
    reg_id
    = apex_application. g_f01 (i); END LOOP ;




    ORACLE APEX: 4.2

    Thank you

    ApexNewLearner wrote:

    I tried the above solution, but I get the error message.

    Don't see no error message (maybe someone else was modulate the application). As I found it, the problem was the property view as of the column being Simple Checkboxvalue box. This type of display should be used only by generated by the wizard tabular forms, not with a apex_item.checkbox2 column. When the display type is changed to Standard report column, the row is deleted if necessary.

Maybe you are looking for

  • I have accidently synced my gmail account to another with a similar name

    I have accidentally synced a new account with a similar to FireFox. I got the window that said that a confirmation email was sent to this email address. What worries me is this individual with this account can access my synchronized content? I have a

  • Best computer upgrade and save options

    Couple of questions different but first background with what I use our computer to my work. We produce 2 large catalogs a year, deal with TONS of images to create our range of products with our own unique designs created in-house. Large files with a

  • Satellite L850-161 starts * recovery * mode after I turn it off sleep

    I bought this laptop there are a little more than two months, and the first time that something unusual has happened was when I put the laptop to sleep and when I flipped open the screen stayed black and would not turn on, but I could hear the sounds

  • Printer detects problems

    I have an officejet pro 8500 a Win7 running. The printer will lose the connection with the computer. In this case, the power light will fade back. I can unplug the power to the printer, plug it in again and the printer will reconnect with the compute

  • the wiring of the array of build service

    Hello I'm currently editing a labview VI that uses the function 'building the table '.  I want to delete one of the elements of the environment, but so far I've been able to remove items from the upper or lower part.  Since there are a lot of element