Master the detailed report, complete the columns based on selection LOV

Hello

When creating a master form / retail, I chose "Edit in detail in tables on the same page."  The form has a "report of the region" to select the list of employees.

The EMPNO column is filled with "Popup LOV (named LOV)".  It works very well.

My requirement is, after selecting an employee, I want other retail JOBS & SAL table fields to be populated with the information of the employee for selected EMP table and must be posted immediately.  Is this possible to do?  If not, what other solution available to achieve the same functionality?

I tried this in Oracle.

workspace: test_ws_anand

user: anandgp

password: cable123

Watch ""list of skills "on the main menu. "

Thank you

-Anand

Hi Anand,

On the change of employee (employee selection) call Ajax via javascript and set the returned salary and job field.

Here you have two values to return: wages and employment, you can generate json and parse the json in javascript and set the values for the specific field...

Please see the sample code below

Step 1: Create the Ajax application process

Please check Procces Ajax, see line 7 How to assign a value to the variable sent by ajax call

Declare
    L_JSON_STR varchar2(4000) := null;
    P_SAL number ;
    P_JOB varchar2(50);
    lc_emp_no VARCHAR2(20);
    Begin
    lc_emp_no := WWV_FLOW.G_X01;
    -- code to fetch the salary and commission into p_sal and p_job variable based on selected employee;
      SELECT sal
          , job
        INTO p_sal
          , p_job
        FROM emp
      WHERE empno = lc_emp_no; 

    -- build a JSON string to return
      L_JSON_STR := '{
                      "SAL": "'||P_SAL||'",
                      "JOB": "'||P_JOB||'"
                    }'; 

      SYS.HTP.P(L_JSON_STR);
    End;

Step 2: Create the javascript function

First, you must extract the rowid for which you want to define the work and wages, see line 6, 7, and 8


Step 3 : from selection of employee call the function
onchange="javascript:f_fetch_emp_dtls(this);"

Hope this helps you,

Kind regards

Jitendra

Tags: Database

Similar Questions

  • Dynamic report query table based on selected LOV

    Hello

    Need some suggestions and Tips how to query dynamically table via lov to report.

    Scenario:

    Table, TABLE_LIST, a tablename (table in DB) and filter (for where clause) column. The TABLENAME_LOVE is derived from the table TABLE_LIST.
    D SELECT TABLENAME TABLENAME TABLE_LIST R


    On Page 2, a select list item, page P2_TABLENAME use TABLENAME_LOV
    All data tables in the table_list has an identical structure (columns, triggers, primary key and so on).

    I want to have the query area of the report of the table based on selected LOV.

    Example,

    TableName Filter
    WBR
    CD2 ACTIVE = 'Y '.

    When select TB1, regin report ask TB1 on the base.
    When select CD2, will interview the report based on CD2 regin WHERE ACTIVE = 'Y '.


    Question:
    How can I query function & P2_TABLENAME. WHERE & P2_FILTER.
    As
    Select col1, col2 from P2_TABLENAME WHERE & P2FILTER

    Appreciate any suggestions and tips.

    Tigerwapa

    Hello
    You should always put your version of the Apex, version of DB and such other information as suggested in the FAQ.
    And now wherever you are referring to report, you need to answer if it's IR or classic.

    Regarding your query, have you explored the kind of statement "SQL Query (body of function from PL/SQL returning SQL query)"?
    This could be a good target for what you're trying to reach.

    Kind regards

  • How to divide the data in the column based identifier

    Hello

    I use the oracle database.
    I have data in this format in my column 1234 ~ 2345 ~ 3456 ~ 4567.

    I need a motion to split the data in the column based on the identifier ' ~', so that I can choose the value after the second occurrence of the identifier.


    Do I know who can do this.

    Published by: 962987 on October 3, 2012 12:11

    Hello

    Welcome to the forum!

    Whenever you have any questions, please post CREATE TABLE and INSERT statements for some examples of data and the results desired from these data. For example, in view of these data

    CREATE TABLE     table_x
    (       my_column     VARCHAR2 (40)
    );
    
    INSERT INTO table_x (my_column) VALUES ('1234~2345~3456~4567');
    INSERT INTO table_x (my_column) VALUES ('just~2 parts');
    

    I think you're asking for these results

    PART_3     MY_COLUMN
    ---------- ----------------------------------------
    3456       1234~2345~3456~4567
               just~2 parts
    

    I suppose that, if the string does not contain at least 2 ' ~ s, you want to return null. It's a good idea to explain what you want like that for special cases and include examples in your sample data and results.

    Not all versions of Oracle are exactly the same. In fact, they are all different. If you want the best solution that works with your version, then say what version it is.
    The following query will work in Oracle 10.1 and higher:

    SELECT  REGEXP_SUBSTR ( my_column
                    , '[^~]+'
                    , 1
                    , 3     -- 3rd occurrence (after 2nd delimiter)
                    )     AS part_3
    ,     my_column          -- if wanted
    FROM    table_x
    ;
    

    See the FAQ forum {message identifier: = 9360002}

    Published by: Frank Kulash, October 3, 2012 15:24
    Adding sample data and results.

  • Update the value of the column based on another value of the column to another table

    Hi all

    I have something very confused me and need your help.

    Having two tables A and B.

    Table A have 2 column (+ id + and desc1)

    Table B have column 2 also (+ transnum + and desc2)

    Now, I want to update the column desc2 of table B identical desc1 of table was where transnum of Table B same as the id of the table has.

    I use this SQL

    update of a2 set a2.desc2 = a1.desc1 of a2 on a2.transnum = a1.id inner join a1

    but this error occurs

    Error from line 5 in order:
    update of a2 set a2.desc2 = a1.desc1 of a2 on a2.transnum = a1.id inner join a1
    Error in the command line: 5 column: 35
    Error report:
    SQL error: ORA-00933: SQL not correctly completed command
    * 00933. 00000 - "command not properly ended SQL."
    * Question: *.

    * Action. *

    Hope someone can help me. TQ for help...
    SQL> create table a1 (id number(2),des varchar2(10));
    
    Table created.
    
    SQL> create table b1 (transnum number(2),des varchar2(10));
    
    Table created.
    
    SQL> insert into a1 values (1,'maran');
    
    1 row created.
    
    SQL> insert into b1 values (1,'ram');
    
    1 row created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> update b1 set des=(select des from a1 where b1.transnum=a1.id);
    
    1 row updated.
    
    SQL> select * from b1;
    
      TRANSNUM DES
    ---------- ----------
             1 maran
    
  • Update line in the column-based database

    Hello

    I am trying to find a way to update a row that has a SQL database based on two columns. If the command and the match number sensor order number and sales sensor that already exists in the database, I want to update the column of reading of the sensor. If not exists then I want that it creates a new line. How would I go to do this?

    Thank you

    Chris

    You can use the tools of DB Query.vi Execute. Here is an example of a MS Access 2010 database where a column value is updated in all rows satisfying the WHERE conditions.

    Ben64

  • Conditionally display the values in the column based on another column

    Hello

    I'm sure this has been covered before, but I can't find anything appropriate based on the research I've done.

    I have 2 attributes in VO.

    I have a table that displays this VO.

    I still want to display header for both attributes, but I only want to show the value of attribute 1 in a row, if value of Attibute2 = 'I '.

    If Attibute2! = 'I', so I want just the column for Attribute1 to be empty space.

    I've not yet done anything with conditional expressions, and I wonder if someone could provide a link or a thread which is similar to this issue.

    Thank you

    Joel

    You can do according to the post above, but if you are not interested in changing the original Version and I want to just change the user interface page only, you can do as in the example below:


    lines = ' #{bindings. " Employee.rangeSize}.
    emptyText = "#{bindings." Employee.Viewable? "{'No data to display.': 'Access Denied.'}".
    fetchSize = "#{bindings." Employee.rangeSize}.
    rowBandingInterval = '0 '.
    selectedRowKeys = ' #{bindings. " Employee.collectionModel.selectedRow}.
    selectionListener = "#{bindings." Employee.collectionModel.makeCurrent}.
    rowSelection = "single" id = "t1" >

    headerText = "#{bindings." Employee.hints.Employeeid.label}.
    ID = "c2" >


    model = ' #{bindings. " Employee.hints.Employeeid.format}"/ >



    headerText = "#{bindings." Employee.hints.Employeename.label}.
    ID = 'c3' >



    headerText = "#{bindings." Employee.hints.Salary.label}.
    ID = "c1" >
    *
    ID = "ot2" >

    model = ' #{bindings. " Employee.hints.Salary.format}"/ >


    OutputText for the Attibute1, you can write the EL expression as:
    *<>
    * value = "#{rank." Attibute2 == "I"? "line. "{Attibute1:"}. "
    * id = "ot2" > *.

    I hope this helps.

    Thank you
    Nini

  • How to set the width of the column based on the width of header?

    I have a column that will contain only 1 character. It's good, but I want that column width to match the column header.

    For example,.

    Currently, I get:

    Select * from table;

    I NAME
    - ---------
    1 ROBERT

    The problem is, I want the column heading set out (in this case, it's just the ID)

    ID NAME
    -- ---------
    1 ROBERT

    Better yet,.

    If I did:

    Select the ID "Identification NUMBER", "FIRST NAME" of table name;

    I want to see:

    ID NUMBER NAME
    --------------- -----------------
    1 ROBERT

    (The ID in the column width of centering would be good too, but it's "sauce")

    Any thoughts? I tried:

    FORMAT ID COLUMN A10 (which obviously didn't work!)

    Thank you

    KSL.

    Published by: leonhardtk on August 23, 2010 11:55

    Hello

    You can check [SQL Reference | http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/functions093.htm#SQLRF00663] for syntax.

    SELECT LPAD('A', 10) FROM DUAL;
    
  • values of insertion to the db based on selected drop-down list

    Hello I am currently adding values to the database based on a selection in the menu dropdown.
    is all that I need.
    This does not work properly. Thanks for any help
    My goal is if they choose one of the following
    Toyo
    Hon
    Suba
    It will be inserted into the db.

    Thank you


    <!----------------
    Cardaddform.cfm

    has a list dropdown and based on the falling down of the selected list, it assumes that to fill the
    Car_dbTEST db
    Table of Car_tab
    car_make field
    with values
    Honda
    or
    Toyota
    or
    Subaru.
    This is the page: - >
    < html >
    < head >
    < title > car add brand < /title >
    < link rel = "stylesheet" href = "styles.css" >
    < / head >

    < body >

    < h1 > < / h1 >

    < table >
    < action = "CarAddAction.cfm cfform" method = "POST" > "

    < b >
    Car < td > < table >
    < td >
    < SELECT name = "CarMake" size = "1" >
    < OPTION Value = "Toyo" > please select < / OPTION >
    < OPTION Value = "Hon" < cfif Carmake is 'Honda' > selected < / cfif > > Honda < / OPTION >
    < OPTION Value = "Toyo" < cfif Carmake is 'Toyota' > selected < / cfif > > Toyota < / OPTION >
    < OPTION Value = "Suba" < cfif Carmake is "Subaru" > selected < / cfif > > Subaru < / OPTION >
    < / select >
    < table >
    < /tr >


    < b >
    < td > < table >
    < td >
    < input type is 'submit' value is "Take Add to database" >
    < table >
    < /tr >

    < / cfform >
    < /table >

    < / body >
    < / html >
    <!-then sends to the action of the CarAddAction.cfm page

    < name cfquery = "InsertCarInfo."
    DataSource = "#request. MainDSN #">"
    INSERT INTO Car_tab)
    car_Make

    )
    VALUES)

    "#Trim (Form.car_make) #
    )
    < / cfquery > -.


    The value you use for the name parameter in your SELECT becomes the name of the FORM variable that is sent to the action page, assuming a POST method. Goes same for tags of entry... the name you use becomes the name of the FORM variable.

    Phil

  • Datapopulation the value of the column-based target

    Generals.

    It's my first post in this forum, so my apologies if my words are not correct.

    Use case:

    I have an ETL process (in ODI) fills my paintings. the table contains information of connection for users as its id, password encrypted etc. The process of ODI runs and fills in the data. The scenario is if the password in the target column is null then ODI must fill some default value. Is it already contains a value, then it should not be updated.

    How do I get there?

    thnks
    10.1.3.5 version

    1. integrate target this table source side.
    2 create a filter where is password IS NOT NULL column - cela make you ODI will not update the password of the target column
    3. on the use of column target password
    CASES WHERE IS NOT NULL
    THEN
    ON THE OTHER
    END

  • How can I update the column based date?

    Hello..

    first I want to thank everyone for the help that you are given...

    I have a table that looks like this:

    the air course date

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

    X 0 NOV2013

    Y 900 OCT2013

    Z 800 OCT2013

    X 700 OCT2013

    Y 500 NOV2013

    X 100 NOV2011

    X 200 NOV2012

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

    I need a SQL expression for this

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

    If the price is 0

    then select the average price for the same air, and the same month but different year

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

    for example in the table...

    When noncompliance X is 0 to DATE price NOV2013

    THEN select the average price for product X in NOV2012 NOV2011 AND

    THAT will be (100 200) = 100

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

    Naïve...

    Hello

    This?

    Note: I pushed since your unique records PROD, D

    SQL > select * from t1;

    D PRICE OF PROD

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

    X 0 01.11.2013

    Y 900 01.10.2013

    Z 800 01.10.2013

    X 700 01.10.2013

    Y 500 01.11.2013

    X 100 01.11.2011

    X 200 01.11.2012

    7 selected lines

    SQL >

    SQL > select q1.prod, q1.price, q1.d, avg (q2.price) avg_price

    2 from t1 t1

    3 join left t1 t2

    4 on q2.prod = q1.prod

    5 and trunc (q2.d, 'yyyy')! = trunc (q1.d, 'yyyy')

    6 and to_char (q2.d, 'mm') = to_char (q1.d, 'mm')

    Group 7 by q1.prod, q1.price, q1.d

    8.

    PROD AVG_PRICE D PRICE

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

    X 700 01.10.2013

    200 X 01.11.2012 50

    X 0 01.11.2013 150

    Z 800 01.10.2013

    Y 900 01.10.2013

    Y 500 01.11.2013

    X 100 01.11.2011 100

    7 selected lines

    SQL >

    SQL >

    SQL >

    SQL > fusion in t1

    2. using (select q1.prod, q1.price, q1.d, avg (q2.price) avg_price

    3 T1 t1

    4 join left t1 t2

    5 on q2.prod = q1.prod

    6 and trunc (q2.d, "yyyy")! = trunc (q1.d, "yyyy")

    7 and to_char (q2.d, 'mm') = to_char (q1.d, 'mm')

    q 8 group of q1.prod, q1.price, q1.d)

    9 on (q.prod = t1.prod and t1.d = q. at)

    10 when matched then

    11 update set t1.price = q.avg_price where t1.price = 0

    12.

    1 row merged

    SQL >

    SQL >

    SQL > select * from t1;

    D PRICE OF PROD

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

    X 150 01.11.2013

    Y 900 01.10.2013

    Z 800 01.10.2013

    X 700 01.10.2013

    Y 500 01.11.2013

    X 100 01.11.2011

    X 200 01.11.2012

    7 selected lines

    SQL >

    ----

    Ramin Hashimzade

  • Show and hide the drop-down menus on the page of the product, based on selected values

    Hello.

    I wish that my product page to view different drop-down lists following, based on the values of individual drop-down list.


    I managed to achieve this through JavaScript, but I don't like how it works.

    As far as I know, there is no identifier for each individual drop-down list to determine who it is, so I can't for the moment is to rely on their order in the DOM, which is bad and it is difficult for me to create a solution that might work for all products.

    For example, if the following is a single attribute:

    < div class = "catProductAttributeGroup" style = "" display: none; "> < div class ="catProdAttributeTitle"> metal Foiling < / div > < div class ="catProdAttributeItem"> < select > < option value =" ">--please select--< / option > < option value ="6051720"> not necessary < / option > < option value ="6051721"> sheet ONE side + £45 < / option > < option value ="6051722"> Foiling BOTH sides + £75 < / option > < / select > < / div > < / div >"

    I would like to than the div outermost having some sort of html attribute that contains the product id attribute. Something like: data-attribute id = "XXXXXXX". Is this possible?

    Here's what I have so far:

    I use {tag_attributes_json}, {tag_product_json} and {tag_currency} to get these values in javascript on the page loading, so I can use them later.


    Then, I hang on to change the events of the drodpowns I have and then toggle their visibility based on those who are selected. I rely on the jequery ': eq (n)' selector to achieve, I don't like. Is there an option with {tag_attributes} which to add additional information (such as the ID attribute on the menu drop-down) on the generated HTML code?

    All works in the beginning, but if I can 'Add to Cart', the product element get ajax-reloaded and events are suddenly off the hook, so it no longer works. For this one, there are two options:

    1. I could hang on to an event that triggers once the product added to the shopping cart and the page is ready. Is there such an event?

    2. I could set up my own add to cart using bcInternals.shop.addToCart. I tried to do this, but I have two problems with it.

    a. addToCart seems add my selection twice, for some reason any. Any ideas what I could do wrong?

    b. the news of cart in the upper right corner don't refresh. Apparently, he's trying to refresh, but there is a kind of access error in the script. This part is not yet fully added to the page, but there is a function which would add it to the basket at the bottom of the largest block of script. Am I using the function addToCart incorrectly?

    It's the page, sure I have the feature added partial implementation:

    Matt Laminated business cards

    The scripts are currently embedded in the HTML code. Once I put it in place correctly, I would like to extract in a separate file. Search for "'$productAttributesElement ' to find the block with the features and for 'productInfo' to find the part where I store the product with tags. _json data "

    Hello

    No worries, na not know if you have solved or that the answer was not helpful

    You need trigger the script you in the presentation of product details model, or you can add a listener for the container of the product and to trigger the script if changes are detected.

    Concerning

  • How dim part of the form based on selection?

    I have a php form that has a dropdown menu with two options: Standard or custom. If the visitor chooses Custom, I need the form remains to be "grey" on or off or something. I have no idea where to start. I did a quick search on the web and have not found much. I wonder if this may be something that handles JavaScript. Or perhaps an IF statement that causes the rest of the form to appear if custom is selected. (Please let me know if I am barking the wrong tree.)

    I'll spend some time tomorrow night trying to find a solution, so I hope someone can point me in the right direction first.

    Any advice would be welcome. If anyone knows a tutorial or explanation or a solution on the web, please send me a link.

    Thanks to that!

    John

    PHP is a language server side, so the only way to do it with PHP would be to submit the form when this option is selected.

    You must use JavaScript to disable form elements. The following script activates / deactivates on and outside form elements:

    
    

    Put this in the head of your document and apply it on the menu drop down like a like this onchange event: