APEX_APPLICATION. G_F01. COUNT returns 0

Hello

I had trouble with checkboxes in an interactive report. I have an Application where the user should be able to see whether or not a given letter is sent. Information for these letters are stored in a table, with an id, an internal number and a column that contains 0, if the letter is not sent and a 1 if it is sent. So now, I'm trying to compile a report interactive APEX shows the values, which is a box that is checked if the letter is sent (in the column 1) or disabled (0 in the column).

The SQL query looks like this:

Select

...

APEX_ITEM. CheckBox (1, smells, Decode(sent,1,'CHECKED',null)) "sent."

...

It works very well. Now, the user must be able to check a box if he sent a letter and save the data in the table. Now, this is where I have some problems. I tried to loop through all the lines that are checked and uptdate in the table.

The PL/SQL code for dynamic action looks like this:

BECAUSE me IN 1.APEX_APPLICATION. G_F01. COUNTING LOOP

Update...

END LOOP;

Now, if I press the button nothing happens, if I output the value for APEX_APPLICATION. G_F01. Consider it always returns 0. I watched if the value of name for the checkbox control is correct, so the source code looks like this:

< input type = "checkbox" name = "f01" value = "1" >

I hope that you can explain to me why the value of PEX_APPLICATION. G_F01. COUNT is always zero.

Hello

When you submit the page, APEX_APPLICATION. Table G_Fxx collect only checked the values checkbox.

If no box is checked, then the array is empty.

Kind regards
Jari

Tags: Database

Similar Questions

  • Problem with apex_application.g_f01

    HII...
    I have a table with a column 10.
    How I would come to know which column has received what a picture...
    like apex_application.g_f01, apex_application.g_f02, apex_application.g_f03...
    I want to write a validation on slot form of table, then...
    Please answer...

    Hello

    Run the page and inspect the HTML source of the page

    Kind regards
    Jari

  • Multiple count() returns the same table?

    Hi all
    I have to count number of invoices (several million) related to contracts (aprox. 75000 entries). When I try

    Select contract.number, count (bill.id), count (a.id)
    contract, invoice, charge a
    where bill.contractid = contract.id
    and bill.type = 0
    and a.contractid = contract.id
    and a.type = 1

    the result of count (a.id) is always the same as count (bill.id). Knowing well that this is wrong, I tried to change the count() in own - select statements, but this does not help and the performance is less than mediocre.

    Does anyone have an idea to get the correct inventory results with a decent return?

    Thank you Carsten

    You need a group by, not a join double...

    select contract.number,bill.type, count(0)
    from contract,bill
    where bill.contractid = contract.id
    and bill.type in (0,1)
    group by contract.number,bill.type
    

    Or if you want the two types on the same line:

    select contract.number,sum(decode(bill.type,0,1,0)) TYPE0, sum(decode(bill.type,1,1,0)) TYPE1
    from contract,bill
    where bill.contractid = contract.id
    and bill.type in (0,1)
    group by contract.number
    

    Max

    Published by: Massimo Ruocchio on November 30, 2009 15:12
    Second option added

  • Trigger the error message if APEX_APPLICATION. G_F01. COUNT is set to null (box in report)

    APEX 4.2

    Hello

    If I have a report and using

    Check in there as follows:

    SELECT APEX_ITEM. "Select", CheckBox(1,ID)

    CNAME, age

    FROM table1

    and then on display report button Delete is placed for deletion, if a check box is selected.

    All these work very well, but I just want to know if no checkbox is enabled and but press the delete button and then

    success message shows that I don't want? I tried to put certain conditions but does not work.

    so, if APEX_APPLICATION. G_F01. COUNT is 0 or null, then it should display the error message?

    Any idea please?

    Thank you.

    RI

    Irha10 wrote:

    so, if APEX_APPLICATION. G_F01. COUNT is 0 or null, then it should display the error message?

    Any idea please?

    Create a validation of Expression PL/SQL using the expression

        apex_application.g_f01 is not null
    and apex_application.g_f01.count > 0

    Subordinate validation on the delete key.

  • Problem with APEX_APPLICATION. G_F01. COUNTY

    I'm on 5 APEX and trying to loop through the lines of an interactive report with a after submit process Page.

    I added an item hidden in my SQL IR:

    Select empno,

    "' < input type ="hidden"value =" "|" EmpNo | "" "name ="f01">"as "STUDENT_LIST"

    WCP

    I created a button on the page with the Submit Page action

    I create a Page process (Point after Submit - once a page visit) who uses apex_application.g_f01. COUNTY, but for some reason apex_application.g_f01. COUNTY is not defined. So my if LOOP don't process (see code below). Something was changing in APEX5 with apex_application.gxx.count that would prevent this from working?

    DECLARE

    l_dcid emp.empno%TYPE;

    BEGIN

    If apex_application.g_f01. COUNT > 0 then null;

    BECAUSE me in 1... apex_application.g_f01. COUNTING LOOP

    l_dcid: = apex_application.g_f01 (i);

    insert into mytable (DCID) values (l_dcid);

    END LOOP;

    on the other

    null;

    end if;

    END;

    Hi bobmagan,

    First edit this query:

    Select empno,

    '"like"STUDENT_LIST"

    WCP

    to something like this:

    SELECT EMPNO
        , APEX_ITEM.HIDDEN(1,EMPNO)||ENAME AS ENAME
    FROM EMP
    

    As you use a tag of entry in your query above, APEX will not be able to save it with APEX_APPLICATION session. G_FXX berries.

    Reference: See the example of application and treatment of samples given below the API APEX_ITEM. HIDDEN

    Change the column with APEX_ITEM attribute. HIDDEN, display as-> Standard report column

    Reference: If you do not find the column attribute Standard report see the following thread: APEX_ITEM. Question CHECKBOX2 in apex 5

    Finally, change your process of:

    DECLARE

    l_dcid emp.empno%TYPE;

    BEGIN

    If apex_application.g_f01. COUNT > 0 then null;

    BECAUSE me in 1... apex_application.g_f01. COUNTING LOOP

    l_dcid: = apex_application.g_f01 (i);

    insert into mytable (DCID) values (l_dcid);

    END LOOP;

    on the other

    null;

    end if;

    END;

    to do this:

    BEGIN
    
        FOR i in 1 .. apex_application.g_f01.COUNT LOOP
    
           insert into mytable (DCID) values (apex_application.g_f01(i));
    
        END LOOP;
    
    END;
    

    See the example for treatment in documentation APEX_ITEM. HIDDEN api.

    I hope this helps!

    Kind regards

    Kiran

  • Remove the table if the value not in APEX_APPLICATION. G_f01?

    Hello again!

    I have an apex_application.g_f01 that contains the values in the boxes, now I want apex to remove rows from the table that contains values that are not present in the G_f01 (what are disabled) on submit.

    I can't understand the sql code to do this, could someone give an example?

    This can be a simple thing, but I'm getting confused a lot with sql, maybe because I just php and java.

    EgaSega wrote:

    I have an apex_application.g_f01 that contains the values in the boxes, now I want apex to remove rows from the table that contains values that are not present in the G_f01 (what are disabled) on submit.

    I can't understand the sql code to do this, could someone give an example?

    This can be a simple thing, but I'm getting confused a lot with sql, maybe because I just php and java.

    One possibility would be to create a collection of APEX containing key checked values and use that as the source of the lines to be kept in the SQL delete. Something like:

    begin
    
      apex_collection.create_or_truncate_collection('CHECKED_VALUES');
    
      for i in 1..apex_application.g_f01.count
      loop
        apex_collection.add_member(
            p_collection_name => 'CHECKED_VALUES'
          , p_c001 => apex_application.g_f01(i));
      end loop;
    
      delete from t
      where not exists (select
                           null
                       from
                            apex_collections c
                       where
                           collection_name = 'CHECKED_VALUES'
                       and c.c001 = t.id);
    
    end;
    
  • 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

  • Referring to APEX_APPLICATION values. G_F (n) table without a process OnSubmit.

    I have box implemented as a column of report on an APEX report page. I try to access control values in a PLSQL process using APEX_APPLICATION. G_F01. It works very well in an OnSubmit Page process, but does not return a value if used in dynamic action. I think that APEX_APPLICATION. G_F01 returns the values checked only on the page. Is it all work around I can extract the values checked in dynamic action that is triggered by the change of box event.

    Thanks in advance

    Hina

    Hi HIna,

    I created an example for you

    https://Apex.Oracle.com/pls/Apex/f?p=245:11

    Steps are below:

    1. report query

    Select

    apex_item. CheckBox2 (1, empno) empno, ename, sal from emp;

    2 dynamic Action:

    var arr_f01 = [];

    () $("input[name='f01']:checked").each

    function() {}

    arr_f01.push ($(this).) Val());

    });

    Alert (arr_f01);

    (apex). Server.Process

    'PROCESS_CHECKED '.

    , {f01: arr_f01}

    , {dataType: "text"}

    , success: {function (pData)}

    Alert ('data inserted into the Temp Table');

    } }

    );

    3. the application process:

    Start

    I'm looping 1.apex_application.g_f01.count

    insert into temporary values (APEX_APPLICATION. G_F01 (i));

    commit;

    end loop;

    end;

    It works for me. The only change I see in my and your query is of the Data Type in apex.server.process.  I assume that the default is JSON, you need to change to 'text '.

  • Session g_f01 State

    Hello

    Apex 4.2

    I have a standard report. I want to access the values in this report of pl/sql using the table in apex_application.g_f01. However, apex_application.g_f01.count will return as 0.

    I'm clearly missing something, the column probably not interested stores its values in session state, even when I put the column "Show as text (save session state)", it is indifferent.

    Please can someone point me in the right direction?

    Thank you

    Ralph

    Hi Richard,

    Well. I can see that your works. Mine, not so much. I created a new page, copy exactly what you had (changes in names of tables and columns in the query). The only thing that is different is the model of the report where you have "standard region" and I "reporting area"... I don't have the option for a 'standard' region But when I got it as 'Empty Region' the dynamic event refused to fire at all...

    But alas the .count will return as 0... yet.

    Now a big difference seems to be that real output in the report for you perfect where you concatenated the apex_item.hidden. However, mine is full tags. for example

    H

    Source of the request is

    Select

    subject_id,

    apex_item. Hidden(1,subject_id) | subject_type as subject_type,

    subject_name

    topics

    That is generated by this query. So this may be something to do with it? I don't know how to get those not hidden tags to display. Maybe its to do with the model of region of report...

  • validations in APEX_APPLICATION. G_Fxx (i)

    Hello
    I use APEX 3.2. There is a column in a table with the fields: number of statement Date (Calendar), Amount (number), (varchar2).
    I'm doing some validations my slot shape:
    In order to avoid nulls for the column amoutn, so I used, validation of levels Page-> PL/SQL-> function returns the error text

    BEGIN
    BECAUSE me in 1.APEX_APPLICATION. G_F05. COUNTY
    LOOP

    IF APEX_APPLICATION. G_F05 (i) is null
    THEN
    RETURN to "Please enter a valid amount";
    END IF;
    END LOOP;
    END;

    The above is a simple validation palin and it works for me. But I don't know how I can validate the date, the user will not be able to enter a date that is greater than the current date. This is the calendar only, to assume that if they enter manually, this date must be in this format DD-MON-YYYY.
    Similarly, amount and report number cannot be zero, one or more negative numbers.

    Please help me with the validation.

    Thank you

    Published by: Suzi Sep 21, 2010 12:02 AM

    Hi Suzi,

    This must be a level of Page validation, no question of level.

    I have not test the code before posting, then there are a few typos. But I guess you fixed them as you did run.
    The basic logic is correct in my opinion. I'm writing again code not tested once again, see if it works.

    DECLARE
       v_date         date;
       v_num         number;
       v_msg          varchar2(4000) := null; -- new variable
    BEGIN
        --FOR i in 1..APEX_APPLICATION.G_F05.COUNT  LOOP
      FOR i in 1..APEX_APPLICATION.G_F01.COUNT  LOOP  -- using f01 in place of f05
    
        BEGIN
             SELECT TO_DATE(APEX_APPLICATION.G_F01(i),'DD-MON-YYYY') INTO V_DATE
             FROM DUAL;
             IF V_DATE > TRUNC(SYSDATE) THEN
                 --RETURN 'Date cannot be in the future.';
                 v_msg := 'Date cannot be in the future.';
                 exit;
             END IF;
        EXCEPTION
            WHEN OTHERS THEN
                  -- RETURN 'Please enter a date in valid format ';
                 v_msg := 'Please enter a date in valid format ';
                 exit;
        END;
        BEGIN
             SELECT TO_NUMBER(NVL(APEX_APPLICATION.G_F02(i),'0')) INTO V_NUM  -- added the missing right parenthesis
             FROM DUAL;
             IF V_NUM <= 0 THEN
                 -- RETURN 'Enter an amount greater then zero.';
                v_msg := 'Enter an amount greater then zero.';
                exit;
             END IF;
        EXCEPTION
            WHEN OTHERS THEN
                 --RETURN 'Please enter a valid number in Amount ';
                 v_msg := 'Please enter a valid number in Amount ';
                 exit;
        END;
      END LOOP;
      RETURN v_msg;
    END;
    

    Kind regards

    Published by: Dominique 23 Sep, 2010 14:11

  • Problem with APEX_APPLICATION. G_F02 (i)...

    Hello

    I'm having problems with my report. I put an extra column with checkboxes in my report. The meaning of these checkboxes must send an e-mail to all employees who are activated. And it works. He sends me emails on the right. But I put data in my email that comes from the report itself. I also have a column with a list of selection based on a lov with the language of the employee.

    APEX_ITEM. SELECT_LIST_FROM_LOV (4, "TBL_WERKNEMERS". "LANGUAGEID", "lov_taalkeuze") 'LANGUAGE' "

    In the report, the employee's language is automatically selected in the select list and it works too. (I need a select list so that the user can change the language, if necessary, otherwise I could get it to my database). But when I want to my value to determine the language to use, it is not always fair. When I select all ranks, it works. But when I check for example that the first and the fifth line, then the first language is correct, but for the fifth line, it takes the value of the second row in my report (which has not been verified).
    That is how I call these values

    BECAUSE me in 1.APEX_APPLICATION. G_F01. COUNTING LOOP
    SELECT v_emailid FROM TBL_EMAIL where report = 'Test' and taalid = APEX_APPLICATION emailid. G_F04 (i);
    END LOOP;

    So I think that the values in my APEX_APPLICATION. G_F01 are right, because I get emails on the right. But the APEX_APPLICATION values. G_F02, APEX_APPLICATION. G_F03, APEX_APPLICATION. G_F04,... are not because I think that all the values are stored when I loop through them the value according to the variable 'i' is returned.
    Someone know how I can get the right value?

    Any help would be greatly appreciated.

    Bram.

    Hello

    The only way I can see that this work is have hidden instances of the EMPNO (or whatever the column that contains the user ID) and check these against the elements checked - the value of the check boxes would also EMPNO.

    For example: [http://apex.oracle.com/pls/otn/f?p=267:97]

    The SQL code for this is:

    SELECT EMPNO,
    ENAME,
    APEX_ITEM.HIDDEN(1, EMPNO) || APEX_ITEM.HIDDEN(2, ENAME) || APEX_ITEM.CHECKBOX(3, EMPNO) TEST
    FROM V_EMP
    

    ENAME and EMPNO are hidden as I want to use in the code in the process.

    and the code of the process is:

    DECLARE
     vSELECTED VARCHAR2(1000);
    BEGIN
     vSELECTED := ':';
     FOR x IN 1..APEX_APPLICATION.G_F03.COUNT
     LOOP
      FOR y IN 1..APEX_APPLICATION.G_F01.COUNT
      LOOP
       IF APEX_APPLICATION.G_F03(x) = APEX_APPLICATION.G_F01(y) THEN
        vSELECTED := vSELECTED || APEX_APPLICATION.G_F02(y) || ':';
       END IF;
      END LOOP;
     END LOOP;
     :P97_SELECTED := vSELECTED;
    END;
    

    P97_SELECTED shows just the ENAME values for checked items. The code loops through the checkboxes and then loops through the hidden elements of EMPNO - when it finds a match, it creates a string of the values of ENAME.

    Andy

  • APEX_APPLICATION. Issue of G_Fxx for APEX_ITEM. SELECT_LIST

    Hello

    I am trying to build a report from SQL query using the query below:

    ------------------------
    Select
    APEX_ITEM. SELECT_LIST (1, 'NULL',' Yes;) Y, no.; Select approval; NULL') "approve."
    INT_ADJ_SK,
    JOURNAL_ID,
    CUSTOMER_TYPE
    of REV_INTERNAL_ADJUSTMENT
    where APPROVE_IND is NULL;
    ------------------------

    My present after process is as below:

    ------------------------
    DECLARE
    Article NUMBER;
    BEGIN
    BECAUSE me in 1.APEX_APPLICATION. G_F01. COUNTY
    LOOP
    agenda: = to_number (APEX_APPLICATION. G_F01 (i));
    IF APEX_APPLICATION. G_F01 (i) = "Y" THEN
    UPDATE REV_INTERNAL_ADJUSTMENT
    SET APPROVE_IND = 'Y' where INT_ADJ_SK = APEX_APPLICATION. G_F02 (Item);
    END IF;

    IF APEX_APPLICATION. G_F01 (i) = n THEN
    UPDATE REV_INTERNAL_ADJUSTMENT
    SET APPROVE_IND = ' no where INT_ADJ_SK = APEX_APPLICATION. G_F02 (Item);
    END IF;
    END LOOP;
    COMMIT;
    END;
    ------------------------


    However, I get the error message: ORA-06502: PL/SQL: digital or value error: character of number conversion error

    Please help as I am unable to find a solution to this.


    Thanks in advance,
    Rahul

    Hello

    Just a hidden column can help you that the value of INT_ADJ_SK:

    select
    APEX_ITEM.SELECT_LIST(1,'NULL','Yes;Y,No;N,Select Approval;NULL') "Approve",
    APEX_ITEM.HIDDEN(2,INT_ADJ_SK) || INT_ADJ_SK,
    JOURNAL_ID,
    CUSTOMER_TYPE
    from REV_INTERNAL_ADJUSTMENT
    where APPROVE_IND is NULL
    

    Note that any value you give for the attribute p_idx for functions in package APEX_ITEM that they are used in APEX_APPLICATION. G_Fxx refer.
    For example:

     APEX_ITEM.SELECT_LIST(1,'NULL','Yes;Y,No;N,Select Approval;NULL') 
    

    will designate as an array of:

    APEX_APPLICATION.G_F01(i)
    

    Reference:
    APEX_ITEM:

    http://download.Oracle.com/docs/CD/E17556_01/doc/apirefs.40/e15519/apex_item.htm#CACEEEJE

    APEX_APPLICATION:

    http://download.Oracle.com/docs/CD/E17556_01/doc/apirefs.40/e15519/apex_app.htm#CHDDADIE

    Your after submit the process would be:

    BEGIN
      FOR i in 1..APEX_APPLICATION.G_F01.COUNT
      LOOP
    
        IF APEX_APPLICATION.G_F01(i) = 'Y' THEN
        UPDATE REV_INTERNAL_ADJUSTMENT
        SET APPROVE_IND = 'Y' where INT_ADJ_SK = APEX_APPLICATION.G_F02(i);
        END IF;
    
        IF APEX_APPLICATION.G_F01(i) = 'N' THEN
        UPDATE REV_INTERNAL_ADJUSTMENT
        SET APPROVE_IND = 'N' where INT_ADJ_SK = APEX_APPLICATION.G_F02(i);
        END IF;
    
      END LOOP;
      COMMIT;
    END
    

    I hope that helps!
    Kind regards
    Kiran

  • apex_application.g_f0X - how

    I'm looking example of @ Dene.
    http://Apex.Oracle.com/pls/OTN/f?p=31517:214:4482592621033283:no
    and cannot help but wonder how to identify what is apex_application.g_f0 * X * I need to use in my page?
    How this can be done, if I do not form automatically generate?

    Hello again!

    How about something like this in your process of page?

    DECLARE
    
    v_err_rows VARCHAR2(255);
    v_err_msg VARCHAR2(255);
    
    BEGIN 
    
      FOR i IN 1.. APEX_APPLICATION.G_F01.COUNT
      LOOP
    
        IF LENGTH(APEX_APPLICATION.G_F01(i)) > 10
        THEN
    
          IF v_err_rows IS NULL
          THEN v_err_rows := i;
          ELSE v_err_rows := v_err_rows||' and '||i;
          END IF;
    
        END IF;
    
      END LOOP;
    
      IF v_err_rows IS NOT NULL
      THEN 
    
        IF LENGTH(v_err_rows) > 1
        THEN v_err_msg := 'Names on rows '||v_err_rows||' are just too damn long!';
        ELSIF v_err_rows IS NOT NULL
        THEN v_err_msg := 'Name on row '||v_err_rows||' is just too damn long!';
        END IF;
    
      END IF;
    
      IF v_err_msg IS NOT NULL
      THEN wwv_flow.show_error_message(v_err_msg);
      END IF;
    
    END;
    

    See you soon

    Ben
    http://www.munkyben.WordPress.com
    Don't forget to mark the answers useful or correct ;)

  • Generate the command Id and insert data into two different tables: oracle apex 5.0

    I have three tables. name of the tables: PRODUCT, ORDER_HEADER, ORDER_DETAIL. I took REPORT inter ASSETS in which the VALUES from TABLE product. I need to use the trigger here, there is a TEXT ARTICLE called ORDER ID: it will generate through trigger. so whenever new order placed order id must be unique. There is a button when this button is clicked, the VALUES of REPORT must be inserted in to ORDER_HEADER , ORDER_DETAIL (in fact, I am in confusion is it even possible).

    I tried to create the trigger: not work if


    CREATE OR REPLACE TRIGGER "EMP_TRG1".

    Before Insert on order_header

    for each line

    Start

    If: new. Order_ID is null

    then

    Select lpad (demo_seq.nextval, 8, '0'): new. Order_ID order_header;

    end if;

    end;

    SQL:

    Select

    apex_item. Text(1,p.PRODUCT_ID) PID.

    PN.product_name,

    apex_item. Text(2,p.PRODUCT_QTY) qt.

    apex_item. Text(3,p.unit_price) upward,

    apex_item. Text(4,p.TOTAL_AMOUNT) am

    OMS_SHIP_CART_DETAIL p, pn OMS_PRODUCT

    where p.product_id = pn.product_id

    DA:

    var arr_f01 = [];

    var arr_f02 = [];

    var arr_f03 = [];

    var arr_f04 = [];

    var arr_f05 = [];

    product_id var;

    unit_price var;

    Var Qty;

    var total_1;

    () $("input[name='f01']").each

    function() {}

    product_id = $(this).closest('tr') .children ('td [headers = 'PID']') .text ();

    unit_price = $(this).closest('tr') .children ('td [headers = "Uprice"]') .text ();

    Qty = $(this).closest('tr') .children ('td [headers = "Qty"]') .text ();

    total_1 = $(this). Closest ('tr'). Children ('td [headers = "total"]'). Text();

    arr_f01.push ($(this).) Val());

    arr_f02.push (product_id);

    arr_f03.push (total_1);

    arr_f04.push (unit_price);

    arr_f05.push (Qty);

    }  );

    (apex). Server.Process

    "Insert a command."

    , {f01: arr_f01, f02: arr_f02, f03: arr_f03, f04: arr_f04, f05: arr_f05}

    }

    , {dataType: "text", success: function (pData) {alert ('added product') ;}}

    );

    Ajax callback:

    declare

    l_count number;

    Start

    -insert into OMS_ORDER_HEADER (USER_ID, TOTAL_AMOUNT, batch, ORDER_DATE) values(:P1_USER_ID,:P42_TOTAL,'PENDING',SYSDATE);

    I'm looping 1.apex_application.g_f01.count

    insert into OMS_ORDER_DETAIL (PRODUCT_ID, UNIT_QTY, UNIT_PRICE, TOTAL_AMOUNT)

    values (APEX_APPLICATION. G_F01 (i), APEX_APPLICATION. G_F03 (i), APEX_APPLICATION. G_F04 (i), APEX_APPLICATION. G_F05 (i));

    commit;

    end loop;

    end;

    Hi Dominique,.

    I create a process page away present in your application

    declare
      l_order_id varchar2(8);
    begin
      insert into order_header(ORDER_ID
                            , STATUS
                            , ORDER_DATE)
                      values(lpad(demo_seq.nextval,8,'0')
                            , 'Pending'
                            , sysdate)
      returning ORDER_ID into l_order_id; 
    
      for rec in(select ID
                      , QTY
                      , PRICE
                  from product)
      loop 
    
        Insert Into Order_Detail ( ORDER_ID
                                  , PRODUCT_ID
                                  , QTY
                                  , UNIT_PRICE)
                            Values(l_order_id
                                  , rec.id
                                  , rec.qty
                                  , rec.price); 
    
        commit;
      end loop;
    end;
    

    Please check and let me know.

    Kind regards

    Jitendra

  • SUM OF COLUMN IN A TABLE.

    How can I make the sum of the rows in a table in the apex oracle 4.2.6.

    I want to perform validations on adj_amount column in a table. If the adj_amount column for the selected row is < = 0 then return false.

    How can I choose the name of the column of tabular presentation in validation.

    Hi Maxence,

    CORINE wrote:

    How can I make the sum of the rows in a table in the apex oracle 4.2.6.

    I want to perform validations on adj_amount column in a table. If the adj_amount column for the selected row is<=0 then="" return="">

    How can I choose the name of the column of tabular presentation in validation.

    Always provide the necessary information on your question.

    Members of the Forum cannot determine information such as the type of tabular presentation, you use (i.e. Assistant generated/manual based on APEX_ITEM).

    Now, the information you have provided, I concluded you want proof on a certain column the sum of this column must be greater than zero.

    Well, you can use a "PLSQL function return Boolean" type, the level of the Page using APEX_APPLICATION validation. G_FXX berries.

    Determine a column which is not null loop through this column and the adj_amount of the amount column. Determine if the sum is greater than zero and therefore trigger the validation.

    Validation sample code would be:

    DECLARE
    
      L_ADJ_AMOUNT_SUM NUMBER := 0;
    
    BEGIN
    
      FOR I in 1 .. APEX_APPLICATION.G_F01.COUNT LOOP
        L_ADJ_AMOUNT_SUM := L_ADJ_AMOUNT_SUM + TO_NUMBER(NVL(APEX_APPLICATION.G_F02(I),0));
      END LOOP;
    
      IF L_ADJ_AMOUNT_SUM <= 0 THEN
        RETURN FALSE;
      ELSE
        RETURN TRUE;
      END IF;
    
    END;
    

    Here APEX_APPLICATION. G_F01 is a column not null and APEX_APPLICATION. G_F02's adj_amount column for example.

    NOTE: You can use a code inspection tools in the browser to identify to which column is mapped to APEX_APPLICATION. Table G_FXX.

    Just inspect element in the column to determine the name attribute. If name = "f04" then it is mapped to APEX_APPLICATION. G_F04.

    I hope this helps!

    Kind regards

    Kiran

Maybe you are looking for

  • How can I remove the 'State' that wants an installation package "status.msi" I do not have?

    This laptop does not accept even in SP3. It doesn't have enough RAM for Win7.   I got rid of bad bits with chkdsk.  Status tries to install all the time & I can't find how to remove it.

  • HP dv6 7210us ENVY: ENVY Hp dv6 7210us motherboard

    My computer beeps at me almost whenever I'm working on it.  It's a beep distinctive high pitch and then a serious tone.  I also sometimes hear a click, but I don't remember if it's before, during or after the beeps (I think it was after the second be

  • How to change the font color

    as in the subject... I have a class that extends the VerticalFieldManager and paint method:   public void paint (Graphics _g) {} Super.paint (_g); _g.setColor (Color.Black); _g.fillRect (0, 0, getWidth(), getHeight()); _g.setColor (Color.Red); _g.dra

  • Icon timer of Smartphones from blackBerry in the middle of the screen

    Hey hope someone can help me with this. These days my phone has like a little black box which one could say is like a small clock, because it has a white line that goes around it, as it is counting the time. Anyway the problem is happening constantly

  • dv2500 notebook - extremely hot to the touch

    Equipped with Vista, no messages of error but laptop is very hot to the touch in a short time after it is on.  Everyone knows this and what to do about it.  This has happened for some time - no hardware or software important no changes before or afte