cloning of a line with the default value in a select list

Hello, how clone this selection list it will display the first value always when I add a line?

This is my work space:

workspace: RGWORK
user: Tester
Pass: test12
Apllication name: TESTER 01
page: 2

Thanks in advance
Joe

Hello

Then add in your cloneRow function

  $('[name="f01"]:last').val($('[name="f01"]:last option:first').val());

See the page of your app 900

Kind regards
Jari

Tags: Database

Similar Questions

  • Documentation about adding column with the DEFAULT value.

    Hello

    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14200/statements_3001.htm#i2198241

    < quote >
    If you add a column, then the initial value of each row in the new column is NULL unless you specify the DEFAULT clause. In this case, Oracle database updates each row in the new column with the value specified for the DEFAULT value. This update operation, in turn, triggers AFTER UPDATE triggers defined on the table.
    < quote >

    I am not able to understand the emphasis on the part AFTER UPDATE while the column with DEFAULT values addition triggers both BEFORE and AFTER triggers defined on UPDATE.

    According to the documents of 11 g

    http://download.Oracle.com/docs/CD/B28359_01/server.111/b28286/statements_3001.htm#i2133105

    n.m. (u) r only changes with the NON NULL columns, but focus on AFTER UPDATE is still there. No trigger defined on the fire of the update in this case.

    This insistence is intended? If not, IMO, it should be changed.

    Kind regards

    Hi Sissi. After further discussion, we have added some information about a change in behavior. Here is what says the next version of the doc:

    When you add a column, the initial value of each row in the new column is null.

    * If you specify the DEFAULT clause for a column NOT NULL, then the default value is stored as metadata, but the column itself is not populated with data. However, the following queries that specify the new column are rewritten so that the default value is returned in the result set.

    This optimized behavior differs from earlier versions, when as part of operation ALTER TABLE Oracle database updated every line in the newly created with the default column and then fired defined update triggers on the table. In this release, no trigger is triggered because the default value is stored only in the form of metadata.

    * If you specify the DEFAULT for a nullable column clause, then the default value is added to existing lines under this ALTER TABLE statement, and any update triggers defined on the table are activated. This behavior also means if you change a NOT NULL column with a default value to be nullable.

    Hope that helps to clarify the matter further.

    Kind regards
    Diana

  • Pump diagram remapping of data with the default value of sequence (12 c feature)

    Hello

    in the 12 c Oracle database there is a new feature that allows you to set default values directly from a sequence:

    http://docs.Oracle.com/database/121/NEWFT/chapter12101.htm#NEWFT155

    This helps us to save the use of triggers to get the next value of an ID column for example the DDL of such a table might look something like this:

    CREATE TABLE "FOO"."MY_TABLE" ("ID" NUMBER(10,0) DEFAULT "FOO"."MY_TABLE_ID"."NEXTVAL", ...   );

    During the pattern FOO with Data Pump export and import the schema with the remap_schema option in the BAR diagram for example, mapping works fine for all the tables, triggers, etc. except those defaults (as Oracle always writes the schema information in these default values).

    The error in the output log that says 'FOO. MY_TABLE_ID"sequence is unknown, because the sequence is now called 'BAR. MY_TABLE_ID' - mapping so does not work for default values.

    Someone knows how to fix this?

    Thanks in advance

    Concerning

    Hello

    Read this note, I think that it is an expected behavior:

    http://docs.Oracle.com/CD/E11882_01/server.112/e22490/dp_import.htm#SUTIL927

    REMAP_SCHEMA

    .

    Restrictions

    * The mapping cannot be 100 percent complete because there are some references to diagrams that importing is not able to find. For example, import will not find of references to patterns incorporated into the body of the definitions of triggers, types, views, procedures and packages.  -I think in your case it is the default value.

    * If any table in the schema are remapped contains object types defined by the user and this table changes between the time wherever it is exported and the time you are trying to import, and then import this table will fail. However, the import operation will continue.

    HTH,

    Pradeep

  • problem with the default value of the parameter in function

    Hi all
    create or replace FUNCTION date_post_message (
    user_lock_in  IN  users.user_lock%TYPE,
    form_type_in  IN users.form_type%TYPE DEFAULT 0 ,
    date_in       IN                       DATE)
    RETURN BOOLEAN
    IS
    v_num number(1);
    BEGIN
    IF user_lock_in = 1 THEN
       RETURN FALSE;
    END IF;
    IF form_type_in NOT IN (1,2) THEN
       RETURN FALSE;
    END IF;
      SELECT 1
      INTO v_num
      FROM changes
      WHERE date_post_msg <= date_in ;
      RETURN TRUE;
    exception
    WHEN NO_DATA_FOUND THEN
    RETURN FALSE;
    END date_to_post_msg;
    problem: there is null, the function ignore the form_type_in default value 0.
    Why? the default value is valid only in the parameter of the procedure?
    Thanks to Advnaced
    Naama

    Naama wrote:
    If a value is null to convert it to 0? I mean in the part of the statement of the parameter

    No, can't do this in the signature. You will need to manage this by validating the parameters passed at the beginning of the function.

    It is quite simple. In your case, you might as well test for NULL and fail to function like this:

        FUNCTION date_post_message(
                user_lock_in IN NUMBER,
                form_type_in IN NUMBER DEFAULT 0 ,
                date_in      IN DATE)
            RETURN BOOLEAN
        IS
            v_num NUMBER(1);
        BEGIN
            dbms_output.put_line('Value of parameters : user_lock_in : '||user_lock_in || ' : form_type_in : '||form_type_in||' : date_in : '||date_in );
            IF user_lock_in = 1 THEN
                RETURN FALSE;
            END IF;
            IF form_type_in IS NULL THEN
                RETURN FALSE;
            ELSIF form_type_in NOT IN (1,2) THEN
                RETURN FALSE;
            END IF;
            RETURN TRUE;
        EXCEPTION
        WHEN NO_DATA_FOUND THEN
            RETURN FALSE;
        END;
    

    In other cases of use I would issue a local variable and treat it like this:

            IF form_type_in IS NULL THEN
                l_form_type := 0;
            ELSE
                 l_form_type := form_type_in;
            END IF;
    

    Of course, the code should use the local variable rather than the parameter.

    It is a good practice to validate values passed in parameters at the beginning of a function. If you really want to go to the city, discover the Design By Contract.

    Cheers, APC

    Published by: APC on November 9, 2011 13:36

    Example added, as requested by OP

  • compare the value of previous line with the current value

    I need to compare the previous value with the current value. All Oracle functions could there be to do?
    Something similar as a result.
    If previous (Amt {}) > Current (({Amt}) then 0 Else Null.)

    Something like that?

    SQL> WITH test_data AS
      2  (
      3          SELECT 107019 AS ID, 1583 AS AMT FROM DUAL UNION ALL
      4          SELECT 107019 AS ID, 1572 AS AMT FROM DUAL UNION ALL
      5          SELECT 107019 AS ID, 1572 AS AMT FROM DUAL
      6  )
      7  -- END SAMPLE DATA
      8  SELECT  ID
      9  ,       (CASE
     10                  WHEN LAG(AMT,1) OVER (PARTITION BY ID ORDER BY ID) = AMT THEN NULL
     11                  ELSE AMT
     12          END) AS AMT
     13  FROM test_data;
    
            ID        AMT
    ---------- ----------
        107019       1583
        107019       1572
        107019
    
  • How can I set the default value of a selection in the Query Panel with table.

    Hi Experts,

    JDev 12.1.3.0.0

    I have a view Criteria (contains a attribute with LOV). and the named criteria is dragged as a query with Table Panel.

    In the user interface, the LOV is now visible in the query Panel. Suppose that the LOV has 3 values: 'Manual', 'Other' and 'portfolio '.

    How can I set a default value for the choice of a select. ?

    Thank you

    Roy

    refer to:

    Andrejus Baranovskis Blog: Dynamic value by default for the field in query ADF search

    but rather to express as in the bellows of the image, choose literal and let 2

  • Problem with the default value for OAMessageTextInputBean to the controller layout

    Hello

    I encountered this problem when I expand a controller for the page create a work request (/ oracle/apps/eam/workrequest/webui/EAM_WR_WORK_REQUEST_DETAIL_PL). My goal is to re - fill OAMessageTextInputBean 'Additional Description' after the user clicks "Save" or "apply". When I try to change the value of another field, it works correctly, the problem persists for 'Description Addidional' more precisely. I don't know that I have the correct id (I took it from xml received by jdr_utils.printdocument). The journal does not all controllers running after the attempt to set the value.

    Compare these logs:

    [21]:PROCEDURE:[xxfideltronik.oracle.apps.eam.workrequest.webui.xxPageRegionCO]:Goosfraba, pre-added!
    [21]:EVENT:[fnd.framework.webui.OAMessageTextInputHelper]:OAF LOG: Event : Get Attribute Value, in: oracle.apps.fnd.framework.webui.OAMessageTextInputHelper: View:null ,Attribute:EAM_WR_WORK_REQUEST_DETAIL_PL426_EamWrRqlog , Return Value without datatype conversion :4321
    [21]:PROCEDURE:[xxfideltronik.oracle.apps.eam.workrequest.webui.xxPageRegionCO]:Goosfraba, added!
    

    [Descriptive information, does not work]

    and:

    [64]:PROCEDURE:[xxfideltronik.oracle.apps.eam.workrequest.webui.xxPageRegionCO]:Goosfraba, pre-added!
    [64]:EVENT:[fnd.framework.webui.OAMessageTextInputHelper]:OAF LOG: Event : Get Attribute Value, in: oracle.apps.fnd.framework.webui.OAMessageTextInputHelper: View:RequestDetailsVO ,Attribute:PhoneNumber , Return Value without datatype conversion :null
    [64]:EVENT:[fnd.framework.webui.OAMessageTextInputHelper]:OAF LOG: Event : Set Attribute Value, in: oracle.apps.fnd.framework.webui.OAMessageTextInputHelper: OldValue:null ,New Value:4312
    [64]:PROCEDURE:[xxfideltronik.oracle.apps.eam.workrequest.webui.xxPageRegionCO]:Goosfraba, added!
    

    [Phone number, works fine]

    Here is my code for the method of the processFormRequest controller:

    public void processFormRequest(OAPageContext pgCtx, OAWebBean wBean){
         super.processFormRequest(pgCtx, wBean);
        
         String description = pgCtx.getParameter("EamWrRqlog");
         log("Goosfraba: " + description, pgCtx);
    
         if(description != null){
              OAMessageTextInputBean additionalDescription = (OAMessageTextInputBean) wBean.findChildRecursive("EamWrRqlog");
              if(additionalDescription != null){
                   log("Goosfraba, pre-added!", pgCtx);
                   additionalDescription.setValue(pgCtx, description);
                   log("Goosfraba, added!", pgCtx);
              }
         }
    }
    

    A solution would be: -.

    1. create a transitional VO with an attribute, LongDescription.

    2 associate this attribute with the EamWrRqlog field.

    3. in the processFormRequest, set the TransientVO attribute value

  • Select the lines with the maximum value for a date where another column is different from 0

    Hello

    I need to write a query on a table (called DEPRECIATION) that returns only the rows whose date maximum (PERENDDAT_0 column) for a specific record (identified by AASREF_0), and where the other column in the table called DPRBAS_0 is different from 0.

    If DPRBAS_0 is equal to 0 in all the lines of a specific record, then return the line with date maximum (PERENDDAT_0 column).

    To be clearer, I give the following example:

    Suppose we have the following data in the table of DEPRECIATION:

    AASREF_0 PERENDDAT_0 DPRBAS_0
    I2011001074331/12/20150
    I2011001074331/12/20140
    I2011001074331/12/20130
    I2011001085612/31/20160
    I2011001085631/12/20150
    I2011001085631/12/2014332
    I2014001223812/31/2016445
    I2014001223831/12/2015445
    I2014001223831/12/20140

    The query must return only the following lines:

    AASREF_0 PERENDDAT_0 DPRBAS_0
    I2011001074331/12/20150
    I2011001085631/12/2014332
    I2014001223812/31/2016445

    Thanks a lot for your help!

    This message was edited by: egk

    Hello Egk,

    The following query works for you.

    SELECT AASREF_0, PERENDDAT_0, DPRBAS_0

    FROM (SELECT AASREF_0,

    PERENDDAT_0,

    DPRBAS_0,

    ROW_NUMBER)

    DURING)

    AASREF_0 PARTITION

    ORDER BY

    CASE WHEN DPRBAS_0 <> 0 THEN 1 OTHER 0 END DESC,.

    PERENDDAT_0 DESC)

    RN

    DEPRECIATIONS)

    WHERE rn = 1

  • XMLNAMESPACE with the default value of XQuery

    Need help on how to solve the problem of default namespace with the underside of XQuery. XQuery below works great when space default namespace ("xmlns ="http://abc.org/SampleRequest/one"") is removed from the XML SampleRequest element. Any help is appreciated.

    with table1 AS
      (select xmltype(
    '<SampleRequest xmlns:ns0="http://abc.org/SampleRequest/one" xmlns="http://abc.org/SampleRequest/one">
       <ns0:Appn>
          <AppnID xmlns="">1234567890</AppnID>
          <AppnStatCd xmlns="">RECEIVED</AppnStatCd>
       </ns0:Appn>
       <ns0:Indivd>
          <TtlCd xmlns="Mr"/>
          <FrstNm xmlns="">Joe</FrstNm>
          <MidNm xmlns=""/>
          <LastNm xmlns="">Bloggs</LastNm>
       </ns0:Indivd>
    </SampleRequest>'
    ) xmlcol from dual
      )
      SELECT t.first_name,t.last_name
        from table1
        ,   xmltable(xmlnamespaces ('http://abc.org/SampleRequest/one' as "ns0"),
                      '/SampleRequest/ns0:Indivd' passing xmlcol
                      columns first_name     varchar2(20) path '//FrstNm',
                      last_name     VARCHAR2(20) PATH '//LastNm') t 
      ;
    

    You can declare a default namespace by using the DEFAULT keyword:

    http://docs.Oracle.com/CD/E11882_01/AppDev.112/e23094/xdb_xquery.htm#autoId7

    for example

    XMLTable (XMLNamespaces (default ' xmlns.example.org', 'another_ns' as "ns0"),...)

    In your example, the default namespace is the same as that associated with the ns0 prefix, so simply precede the SampleRequest element:

    SQL > with table1 AS)

    2. Select xmltype)

    3 'http://abc.org/SampleRequest/one' xmlns ="http://abc.org/SampleRequest/one" >. "

    4

    5 1234567890

    6 RECEIVED

    7

    8

    9

    10 Joe

    11

    12 Borgella

    13

    14  '

    (15) xmlcol

    16 double

    17)

    18 select t.first_name, t.last_name

    19 from table1

    20, xmltable)

    21 xmlnamespaces ('http://abc.org/SampleRequest/one' as 'ns0')

    22, ' / ns0:SampleRequest / ns0:Indivd'

    23 passage xmlcol

    path of varchar2 (20) 24 columns first_name "FrstNm."

    path of varchar2 (20) 25 last_name 'LastNm '.

    (26) t

    27;

    FIRST NAME LAST NAME

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

    Joe Bloggs

  • prompt of dashboard works do not correctly with the default values

    I created 2 dashboard:

    Dashboard 1 are:
    prompt A
    report A

    Dashboard 2 were:
    B invites
    report B

    Report A and B are the same reports as structure and filters. Only have different names.
    Prompt A and B both filtered region attributes:
    Invite a default view in clause sql on the "Région" attribute values: region1, 2, 3
    B quickly view sql clause on the "Région" attribute default values: 4, 5, 6

    If I run the A dashboard, it works fine.
    If I run the dashboard B, show me the same values of the dashboard (region1, 2, 3) in the two guests of report.
    If I click on the Clear button, the B dasbhoard runs correctly and shows 4, 5, 6 in the two guests of report.

    Seems to be something in the cache. But why?


    Sara

    Published by: Sara C. on 18 / gen/2010 9.41

    Go ahead and skip this step then. I never did, but my colleague has mentioned that you can disable the RPD to be cached at all, so if you are in online mode and you still cannot manage the cache, assume that this feature is disabled.

    In addition, as I said above, I don't think it is a caching problem, it was just more precautionary, so I don't think it will be a big problem.

    Please let me know how the rest goes!

    Kind regards
    Jason

    PS - Out of curiosity, what version of OBIEE do you use? 10.1.3.4?

  • Two lines with the same value (in a single pass) but a different value (in another pass)...

    Hello
    I have the following table:
    create the table pp_status (ppid number (10), ppdescr varchar2 (20),)
    (1) number, varchar2 (4)) bordered;
    The ppid is the primary key.

    where: the ppid Gets the values of a sequence, status may have values (0, 1, 2) and bordered of... years.
    Thus, some values of line may be as follows:
    insert into pp_status values(1,'XX',0,'2009');
    insert into pp_status values(2,'XXY',0,'2010');
    insert into pp_status values(3,'XXT',1,'2009');
    .....

    Now, I want to impose a business rule in which declaratively:
    If and only if both lines have values of shell (as in row 1, 3 in the example above lines) but different data values in the neck of status (and specifically the values 0 and 1 (not 2), as in the lines of the sample 1 and 3) then the second row (that is, the third row in the whole of the sample) is permitted , otherwise not. For example, the following lines:
    insert into pp_status values(3,'XXT',2,'2009'); {because of the whole first line was inserted}
    insert into pp_status values(3,'XXT',0,'2009'); {because of the whole first line was inserted}

    should not be allowed...

    Is it possible to achieve without writing code... I mean the declaratively.

    Note: I use DB10g v.2

    Thank you
    SIM

    SIM,

    It's an interesting challenge, which requires two unique indexes to solve declaratively:

    SQL> create table pp_status(ppid number(10),ppdescr varchar2(20),
      2  status number(1) check (status in (0,1,2)),firstyear varchar2(4));
    
    Tabel is aangemaakt.
    
    SQL> create unique index ui1 on pp_status (firstyear,decode(status,2,0,status))
      2  /
    
    Index is aangemaakt.
    
    SQL> create unique index ui2 on pp_status (firstyear,decode(status,2,1,status))
      2  /
    
    Index is aangemaakt.
    
    SQL> insert into pp_status values(1,'XX',0,'2009');
    
    1 rij is aangemaakt.
    
    SQL> insert into pp_status values(2,'XXY',0,'2010');
    
    1 rij is aangemaakt.
    
    SQL> commit
      2  /
    
    Commit is voltooid.
    
    SQL> insert into pp_status values(3,'XXT',2,'2009');
    insert into pp_status values(3,'XXT',2,'2009')
    *
    FOUT in regel 1:
    .ORA-00001: Schending van UNIQUE-beperking (RWIJK.UI1).
    
    SQL> insert into pp_status values(3,'XXT',0,'2009');
    insert into pp_status values(3,'XXT',0,'2009')
    *
    FOUT in regel 1:
    .ORA-00001: Schending van UNIQUE-beperking (RWIJK.UI1).
    
    SQL> insert into pp_status values(3,'XXT',1,'2009');
    
    1 rij is aangemaakt.
    

    Kind regards
    Rob.

    PS: why the hell proclaim the year varchar2 (4) instead of number 4?

  • Problem with the cascading for interactive report selection list

    Hi all.

    I'm trying to implement the solution of cascading to the tabular presentation list.

    https://Apex.Oracle.com/pls/Apex/f?p=31517:176:103661090335568:

    But instead of the form of paintings, I use interactive report. After executing the query, I get the error:

    ORA-06550: line 1, column 147: PL/SQL: ORA-00936: lack of expression ORA-06550: line 1, column 13: PL/SQL: statement ignored


    My Sql query for the report:

    select 
    apex_item.hidden(1, a."DATA_ID")DATA_ID,
    apex_item.select_list_from_query(10,
      b.WAVE_GROUP,
     'select GROUP_DISPLAY, GROUP_RETURN from dwd_wave_group',
     'onchange="f_set_casc_sel_list_item(this,f11_'||LPAD (a.DATA_ID, 4,'0')||')"',
     'YES',
     '',
     '- Select Group -',
     'f10_' || LPAD (a.DATA_ID, 4, '0'),
      NULL,
     'NO'
     )WAVE_GROUP,
    apex_item.select_list_from_query(11, b."WAVE_USER",
    'SELECT username d, '
    ||'username r FROM dwd_user where groups = '||b."WAVE_GROUP",
    '',
    'YES',
    '', 
    '- Select User -',
    'f11_' || LPAD (a.DATA_ID, 4, '0'),
     NULL,
    'NO'
    )WAVE_USER
    from "DWD_WAVE_MASTER" a, dwd_wave_assignment b
    where a.data_id = b.data_id
    and b.wave_id = 'wave_1'
    

    If I exclude the condition 2nd selection list query and change as below then everything works fine. Query does not give error on sql developer.

    Use: APEX 4.2.6 with Database 11g.

    apex_item.select_list_from_query(11, b."WAVE_USER",
    'SELECT username d, '
    ||'username r FROM dwd_user',
    '',
    'YES',
    '', 
    '- Select User -',
    'f11_' || LPAD (a.DATA_ID, 4, '0'),
     NULL,
    'NO'
    )
    

    Can someone please help!

    Thank you

    Nabila

    The nabila Islam wrote:

    I'm trying to implement the solution of cascading to the tabular presentation list.

    https://Apex.Oracle.com/pls/Apex/f?p=31517:176:103661090335568:

    But instead of the form of paintings, I use interactive report. After executing the query, I get the error:

    ORA-06550: line 1, column 147: PL/SQL: ORA-00936: lack of expression ORA-06550: line 1, column 13: PL/SQL: statement ignored

    My Sql query for the report:

    1. Select
    2. apex_item. Hidden (' 1, a. "DATA_ID DATA_ID").
    3. apex_item.select_list_from_query (10,
    4. b.WAVE_GROUP,
    5. "select GROUP_DISPLAY, GROUP_RETURN from dwd_wave_group,"
    6. "onchange =" f_set_casc_sel_list_item (this, f11_'|) LPAD (a.DATA_ID, 4, '0'). ") » ',
    7. '' YES. ''
    8. '',
    9. -Select Group «-»,
    10. "f10_" | LPAD (a.DATA_ID, 4, '0'),
    11. NULL,
    12. 'NO '.
    13. ) WAVE_GROUP,.
    14. apex_item.select_list_from_query ("11, b.") WAVE_USER,"
    15. "SELECT user name d.
    16. |' username r FROM dwd_user where group = ' | b."WAVE_GROUP."
    17. '',
    18. '' YES. ''
    19. '',
    20. "- Select user -",
    21. "f11_" | LPAD (a.DATA_ID, 4, '0'),
    22. NULL,
    23. 'NO '.
    24. ) WAVE_USER
    25. of 'DWD_WAVE_MASTER' a, b dwd_wave_assignment
    26. where a.data_id = b.data_id
    27. and b.wave_id = 'wave_1. '

    If I exclude the condition 2nd selection list query and change as below then everything works fine. Query does not give error on sql developer.

    Use: APEX 4.2.6 with Database 11g.

    1. apex_item.select_list_from_query ("11, b.") WAVE_USER,"
    2. "SELECT user name d.
    3. |' username r FROM dwd_user ",
    4. '',
    5. '' YES. ''
    6. '',
    7. "- Select user -",
    8. "f11_" | LPAD (a.DATA_ID, 4, '0'),
    9. NULL,
    10. 'NO '.
    11. )

    What is the data type of DWD_WAVE_ASSIGNMENT. WAVE_GROUP? If it is not a number, then it must be enclosed in quotes when it is used as a literal:

    apex_item.select_list_from_query(11, b."WAVE_USER",
    'SELECT username d, '
    
    ||'username r FROM dwd_user where groups = ' || dbms_assert.enquote_literal(b."WAVE_GROUP"),  
    
    '',
    'YES',
    '',
    '- Select User -',
    'f11_' || LPAD (a.DATA_ID, 4, '0'),
    NULL,
    'NO'
    )
    
  • Adding the different values to a selection list?

    4.2.1

    Hello

    I have three pages, home page that has to do with a filter period - values of the last 7 days last 14 days. Filter period is: P1_PERIOD
    I have another page with the same report - last values 1 day, last 7 days, 30 days previous and last quarter. Filter period is: P2_PERIOD

    Page two above shows the same reports based on the time period selected in the respective pages.
    Page 1 
    Item           last 7 days          last 14 Days
    lights             10                      16
    Tail Lamp         2                      10
    
    Page 2
    
    Item              last 1 day              last 7 days                 last 30 days                   last quarter
    
    lights               1                         10                              20                               100
    .
    .
    Now I have a third page that actually is a detail page that lists the details of the item
    item_id              item_name                  Item_Purchase_date
    
    1                       Lights                             19-Mar-2013
    1                       Lights                              16-Mar-2013
    .
    .
    The indictments to page 1 and page 2 hyperlinked.

    My question is

    1. on the page two: P2_PERIOD has the list of various selection options. so on page 3 I have an interactive report, when I run the query, I run it as
    select * from item_master where item_purchase_date between decode(:P2_period,1, sysdate-1, 2, sysdate-7,3, sysdate-30, 4, sysdate-90) and sysdate.
    However, I also want to do the same on page 1. Or when the user presses the account on 7, 14 days, it will take them to the page three, but the same report should be run for 7 or 14 days based on what the user has selected in: P1_PERIOD.
    select * from item_master where item_purchase_date between decode(:P1_period,1, sysdate-7, 2, sysdate-14) and sysdate.
    Counsel on how to do it?

    Thank you
    Ryan

    ryansun wrote:
    4.2.1

    Hello

    I have three pages, home page that has to do with a filter period - values of the last 7 days last 14 days. Filter period is: P1_PERIOD
    I have another page with the same report - last values 1 day, last 7 days, 30 days previous and last quarter. Filter period is: P2_PERIOD

    Page two above shows the same reports based on the time period selected in the respective pages.

    Page 1
    Item           last 7 days          last 14 Days
    lights             10                      16
    Tail Lamp         2                      10
    
    Page 2
    
    Item              last 1 day              last 7 days                 last 30 days                   last quarter
    
    lights               1                         10                              20                               100
    .
    .
    

    Now I have a third page that actually is a detail page that lists the details of the item

    item_id              item_name                  Item_Purchase_date
    
    1                       Lights                             19-Mar-2013
    1                       Lights                              16-Mar-2013
    .
    .
    

    The indictments to page 1 and page 2 hyperlinked.

    My question is

    1. on the page two: P2_PERIOD has the list of various selection options. so on page 3 I have an interactive report, when I run the query, I run it as

    select * from item_master where item_purchase_date between decode(:P2_period,1, sysdate-1, 2, sysdate-7,3, sysdate-30, 4, sysdate-90) and sysdate.
    

    However, I also want to do the same on page 1. Or when the user presses the account on 7, 14 days, it will take them to the page three, but the same report should be run for 7 or 14 days based on what the user has selected in: P1_PERIOD.

    select * from item_master where item_purchase_date between decode(:P1_period,1, sysdate-7, 2, sysdate-14) and sysdate.
    

    Counsel on how to do it?

    Take a different approach. Create a new P3_PERIOD_START item on page 3, calculate the date required on pages 1 and 2 and pass the value calculated on page 3 in the links (using a URL format secure as YYYYMMDD). Change the report query to

    select * from item_master where item_purchase_date between to_date(:p3_period_start, 'YYYYMMDD') and sysdate
    

    (Think about the implications of the use of Select * in production code.) Unwanted effects may occur if the definition of the table is changed.)

  • Mr President, how can I enter two rows at the same time with different default values that only the first line to use see?

    Mr President.

    My worm jdev is 12.2.1

    How to enter two rows at the same time with different default values that only the first line to use see?

    Suppose I have a table with four fields as below

    "DEBIT" VARCHAR2(7) , 
      "DRNAME" VARCHAR2(50),
      "CREDIT" VARCHAR2(7) , 
      "CRNAME" VARCHAR2(50),
    

    Now I want that when I click on a button (create an insert) to create the first line with the default values below

    firstrow.png

    So if I click on the button and then validate the second row with different values is also inserted on commit.

    The value of the second row are like the picture below

    tworows.png

    But the second row should be invisible. It could be achieved by adding vc in the vo.

    The difficult part in my question is therefore, to add the second row with the new default values.

    Because I already added default values in the first row.

    Now how to add second time default values.

    Concerning

    Mr President

    I change the code given by expensive Sameh Nassar and get my results.

    Thanks once again dear Sameh Nassar .

    My code to get my goal is

    First line of code is

        protected void doDML(int operation, TransactionEvent e) {    
    
            if(operation != DML_DELETE)
                 {
                     setAmount(getPurqty().multiply(getUnitpurprice()));
                 } 
    
            if (operation == DML_INSERT )
                       {
                               System.out.println("I am in Insert with vid= " + getVid());
                           insertSecondRowInDatabase(getVid(),getLineitem(),"6010010","SALES TAX PAYABLE",
                            (getPurqty().multiply(getUnitpurprice()).multiply(getStaxrate())).divide(100));      
    
                           }
    
            if(operation == DML_UPDATE)
                              {                                                    
    
                                 System.out.println("I am in Update with vid= " + getVid());
                             updateSecondRowInDatabase(getVid(),
                                 (getPurqty().multiply(getUnitpurprice()).multiply(getStaxrate())).divide(100));      
    
                              }                      
    
            super.doDML(operation, e);
        }
        private void insertSecondRowInDatabase(Object value1, Object value2, Object value3, Object value4, Object value5)
                  {
                    PreparedStatement stat = null;
                    try
                    {
                      String sql = "Insert into vdet (VID,LINEITEM,DEBIT,DRNAME,AMOUNT) values " +
                 "('" + value1 + "','" + value2 + "','" + value3 + "','" + value4 + "','" + value5 + "')";  
    
                      stat = getDBTransaction().createPreparedStatement(sql, 1);
                      stat.executeUpdate();
                    }
                    catch (Exception e)
                    {
                      e.printStackTrace();
                    }
                    finally
                    {
                      try
                      {
                        stat.close();
                      }
                      catch (Exception e)
                      {
                        e.printStackTrace();
                      }
                    }
                  }  
    
                  private void updateSecondRowInDatabase(Object value1, Object value5)
                  {
                    PreparedStatement stat = null;
                    try
                    {
                      String sql = "update vdet set  AMOUNT='"+ value5+"' where VID='" + value1 + "'";                     
    
                      stat = getDBTransaction().createPreparedStatement(sql, 1);  
    
                      stat.executeUpdate();
                    }
                    catch (Exception e)
                    {
                      e.printStackTrace();
                    }
                    finally
                    {
                      try
                      {
                        stat.close();
                      }
                      catch (Exception e)
                      {
                        e.printStackTrace();
                      }
                    }                  
    
                  }
    

    Second line code is inside a bean method

        public void addNewPurchaseVoucher(ActionEvent actionEvent) {
            // Add event code here...
    
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
                   DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("VoucherView1Iterator");
                   RowSetIterator rsi = dciter.getRowSetIterator();
                   Row lastRow = rsi.last();
                   int lastRowIndex = rsi.getRangeIndexOf(lastRow);
                   Row newRow = rsi.createRow();
                   newRow.setNewRowState(Row.STATUS_NEW);
                   rsi.insertRowAtRangeIndex(lastRowIndex +1, newRow);
                   rsi.setCurrentRow(newRow);
    
                   BindingContainer bindings1 = BindingContext.getCurrent().getCurrentBindingsEntry();
                   DCIteratorBinding dciter1 = (DCIteratorBinding) bindings1.get("VdetView1Iterator");
                   RowSetIterator rsi1 = dciter1.getRowSetIterator();
                   Row lastRow1 = rsi1.last();
                   int lastRowIndex1 = rsi1.getRangeIndexOf(lastRow1);
                   Row newRow1 = rsi1.createRow();
                   newRow1.setNewRowState(Row.STATUS_NEW);
                   rsi1.insertRowAtRangeIndex(lastRowIndex1 +1, newRow1);
                   rsi1.setCurrentRow(newRow1);
        }
    

    And final saveUpdate method is

        public void saveUpdateButton(ActionEvent actionEvent) {
            // Add event code here...
    
            BindingContainer bindingsBC = BindingContext.getCurrent().getCurrentBindingsEntry();      
    
                   OperationBinding commit = bindingsBC.getOperationBinding("Commit");
                   commit.execute(); 
    
            OperationBinding operationBinding = BindingContext.getCurrent().getCurrentBindingsEntry().getOperationBinding("Commit");
            operationBinding.execute();
            DCIteratorBinding iter = (DCIteratorBinding) BindingContext.getCurrent().getCurrentBindingsEntry().get("VdetView1Iterator");// write iterator name from pageDef.
            iter.getViewObject().executeQuery();  
    
        }
    

    Thanks for all the cooperation to obtain the desired results.

    Concerning

  • How can I validate a dropdown list NOT accepting the default value?

    I have a fillable form where I need the user to select their "number of employees". I've added several lines as their options in a drop-down list (1-10, 11-25, 26-50, 50 +). My question is "defult value" is set to "1-10" and people submit it without changing the correct value.

    I changed the value for default "-select -", but it allows them to always submit the form with the value entered.

    I guess I need some sort of validation script that will basically say - "If the value of this field is - select one - do not submit the form, but give an error that says 'Please select your number of employees' or something of the sort."

    Basically I just want what they choose something as opposed to just submit it with the default value.

    I looked everywhere and am not very good with JS.

    You can't have the default set to a possible real value. You need a value that must be selected.

    So for your sending script, you will need to test all your required fields to make sure that they are not at the default value.

    You make a variable that assumes that all required fields are filled and then check each field and if one still has the default value that you set your variable to 'false' and then when you have verified all of the fields that you test the value of the variable and only if she is true to send you the form.

    var bSumbit = ture; logical variable for test submission

    Test menu drop-down # of employees

    this.getField ("number of employees".). required = false; Disable the required property

    If (this.getField ("number of employees"). value == "-select one - ') {}

    Determine = false;

    this.getField ("number of employees".). required = true; Set the required property

    }

    {if (bSubmit)}

    your submit acation;

    } else {}

    App.Alert (' not all required fields completed", 0, 1);

    }

Maybe you are looking for

  • Why not iMovie has Simple Text free form add?

    I know iMovie's titles that you can add, but it doesn't have a text format that you can add to have nothing much significant for the text. You must always create in your favorite photo program. It is really missing from this program unless I'm missin

  • Update iTunes errors, can not find the file iTunes6464.msi

    Try to update iTunes on PC. Windows 7 (64-bit) with Intel i5 processor. During an update of base, update errors trying to find the file "iTunes6464.msi" he says is not available. I tried to delete all the software Apple on PC, but the file final iTun

  • Help my Lenovo G550 Webcam not found

    Help my Lenovo G550 Webcam not found It was working fine last night and I went this morning etil did not work! Help her bed to the ive tried caraa drivers

  • Need to access BIOS ASAP code

    disabled system code is 60306076I saw that you have to post on the forums to get the unlock codeIt is quite ridiculous, you must have a code... but if you can help me understand the unlock code, I'd be happy. I'm afraid that the hard drive is dying i

  • SanDisk sansa m230 Initialize fail

    Hi, I have a Sandisk sansa M230 and updating of software found new firmware for my device. As soon as I installed the update of the firmware, the software told me to remove the usb connection and restart the device. Now it tells me failed to initiali