Matrix of distances: selection of values with the number of the column as a variable

Hi all

You wonder if SQL can do natively, let's go.

I have a static table with the same amount of rows and columns, that changes forever; It represents the distances between locations (e.g. countries).
It's basically a distance matrix (you can find a good example on Wikipedia ).

My SQL statement must extract the distances of this matrix, based on the IDS of countries located in another table.
Select a field is simple:

SELECT * from cdistances where countryid =
(select countryid from countries where upper (country) = upper (& getcountry));

When I run the present, I get a line of all distances to all countries of the country I go when asked. But I would limit the outcome of a country of destination that I entered.

Of course, a CASE statement would solve this nicely, but since we are talking more than 200 countries, which will become unmanageable.

Another method that I approached is to use a variable as a column, as below:

SELECT & getdestination of cdistances where countryid =
(select countryid from countries where upper (country) = upper (& getcountry));

It works well when I get directly the column identifier (manually from the keyboard) but I would like to automate even further.
My names of columns in the matrix of distances are named as follows:
countries1, countries2, countries3... country200 - where the number ID the real country, preceded by the constant string 'country '.
So I tried to define a variable as a concat between 'country' and another variable:
def getd2 = concat ("D2C", & testcountryid);
Of course, it does not; the output of the script is:

old: def getd2 = concat ('country', & testcountryid)
New: def getd2 = concat ("country", 12)

where I expected to be 'country12.

I'm so little loss of thoughts. Maybe I'm pushing my train of thought in the wrong way, so I guess the general question would be: how to select a specific column of a table based on information outside the SQL statement dynamically?

Hello

I'm still confused.
Is your table called chessking or testdistances, or you have 2 separate tables?

I'm guessing that your single table is testdistances, and you want to pass a list of countryids, such as that of 3.1 to a query and get results as follows:

`COUNTRYID  DISTANCE3  DISTANCE1
---------- ---------- ----------
         1         18         15
         3         13          1

If so:

DEFINE     country_list = "3,1"

-- Preliminary Query, to set column_list
COLUMN     column_list_col     NEW_VALUE column_list

SELECT     'distance' || REPLACE ( '&country_list'
                           , ','
                     , ',distance'
                     )          AS column_list_col
FROM    dual;

-- Main Query
SELECT     countryid
,     &column_list
FROM     testdistances
WHERE     countryid     IN (&country_list)
;

Sorry, I'm out of time now. I'll explain more in a few hours.

Tags: Database

Similar Questions

  • passing multiple values of the column to a variable in unix

    sqlplus -s $USER_ID@$SID/$PWD<<EOF>sql_1.txt
    set feedback off
    set heading off
    select  114032 as c_1 from dual ;
    
    
    EOF
    
    
    
    
    for i in `cat sql_1.txt`
    do
    
    
    sh script_1.sh  $i 
    

    Currently I am passing a column value to the single unix variable.

    How can I pass values of 2 columns

    sqlplus -s $USER_ID@$SID/$PWD<<EOF>sql_1.txt
    set feedback off
    set heading off
    select  114032 as c_1 ,sysdate c_2  from dual ;
    
    
    EOF
    
    
    
    
    sh script_1.sh $col_1_value  $col_2_value 
    

    I'm on SUNOS

    You can concatenate the columns in SQL by a delimiter, and then use the cut (for example) under Unix to analyze the production line in chips for the script.

  • Tabular presentation - column to turn it off (with picture) based on another value of the column

    Hi all

    I haven't worked much on tabular forms and JS. I'm looking for help in this regard.

    I'm working on a tabular presentation. with several editable fields... I need to disable a column (just for this single line), which contains an image, based on a field of LOV (static) list) (Y/N). The image column must be disabled if the value is N.

    My SQL for the report is something like this: (will keep things simple)

    Select

    emp_id,

    emp_name,

    static_list,

    (case when STATIC_LIST = "Y" THEN ' < a title = "Edit SAMPLE TBL" href = "f?) p = & APP_ID.:10: & APP_SESSION.:NO:P10_EMP_ID, P10_EMP_NAME :'|| EMP_ID | «, » || EMP_NAME | "" "> < img src =" "#IMAGE_PREFIX #SAMPLE.gif" border = '0' (> < /a > ' other ' ' end) as disable_col, "

    dept_name

    of sample_table

    I scoured the topics in this forum. Most of them were made using the table ID f_001, f_002.

    I tried to follow the same path by inspecting the item but the disable_col does not have any ID.  Let's say, f_003 is for the static list and f_004 is assigned to dept_name.

    I tried dynamic actions, but it did not work. Read in a topic that dynamic action does not work on tables. So I chose this approach. Is there a simpler way to solve this?

    need your help on how to proceed with this scenario. Thank you in advance.

    Versions: Apex: 4.2, DB: 11 g

    Thank you

    Daniel

    Hi Daniel_A,

    Daniel_A wrote:

    I did my job in Page 4.

    If the IS_VALID column is select as 'Yes' then the column hyper must be enabled, allowing the user to click on it. If she chose the 'no', then the column Hyper must be disabled for this line.

    The initial question about toggle the hyperlink is resolved. Check your App-> Page 4 35160.

    This is done with the help of two dynamic actions:

    • DA first loading of the Page / after updating of region "tabular":

    Event: After refresh

    Selection type: region

    Region: The other 'tabular '.

    Condition: No strings attached

    Action: Run the JavaScript Code

    Fire on loading the Page: Yes

    Code:

    $( 'select[name="f08"]' ).each(function() {
      if ( $(this).val() === "N" ) {
        $(this).closest("tr").find('td[headers="HYPER"]').find("a").addClass("apex_disabled").unbind("click");
      }
    });
    

    Items concerned: no item affected

    • Second DA on the evolution of the selection list:

    Event: change

    Selection type: jQuery Selector

    jQuery Selector: select [name = "f08"]

    Condition: No strings attached

    Action: Run the JavaScript Code

    Fire on loading the Page: No.

    Code:

    var el = this.triggeringElement;
    if ( el.value === "N" ) {
        $(el).closest("tr").find('td[headers="HYPER"]').find("a").addClass("apex_disabled").unbind("click");
    } else {
        $(el).closest("tr").find('td[headers="HYPER"]').find("a").removeClass("apex_disabled").bind("click");
    }
    

    Items concerned: no item affected

    NOTE: as the original question/topic related to toggle the image link in the column, for the problem with the Page 5, please create a new thread with the details.

    Kind regards

    Kiran

  • How can I replace the value of the column with a particular value in SQL

    Hi all

    Is someone can you please tell me how can I format my output with the replacement of a column value with a specific value that really depends on the current value of the column

    I am executing the following SQL statement

    Select state, count (id) from < table_name > where composite_dn = < composite_dn_name > Group by State;
    My current performance is:

    State Instance number
    1 3
    3 28

    I want to replace the value in the State column as follows

    No.OfInstances State
    3 filled
    28 faulted

    I want '1' to be reppaced of 'Done' and '3' is replaced by 'Faulted. '

    Is is possible with SQL or PL/SQL, if it is then how I can achieve this required. Help, please!

    Thanks in advance!

    Published by: Roshni Shankar on October 27, 2012 12:38 AM

    Hi Claude,.

    I guess this CASE clause can be simulated by a DECODE and also it is very easy to use.
    See - http://www.techonthenet.com/oracle/functions/decode.php

    select decode(t1.state,t2.state_id,t2.state_name), t1.count_id
    from  t2, (select state,count(id) count_id
     from 
     where composite_dn= 
    group by state) t1
    where t1.state = t2.state_id;
    

    HTH
    Vanessa B.

    Published by: Vanessa B on October 27, 2012 14:02
    -link added

    Published by: Vanessa B on October 27, 2012 14:19
    -added code sample

  • Need to null values with the values of filling the date before weekend/holidays

    I have a table with a Date column, column Type and rate column.

    The problem is when the weekends and holidays, column Type and rate column are null.

    I need all null values with the values of Type and fill rate before that date is the weekend and public holidays.

    Example:

    I have:

    RATE OF TYPE DATE
    07/01/2010 4510 PM 3.71
    07/01/2010 CETE28 4.59
    07/01/2010 TIIE28 4.95
    07/02/2010 4510 PM 3.82
    07/02/2010 CETE28 4.63
    07/02/2010 TIIE28 5.11
    * NULL NULL 07/03/2010 *.
    * NULL NULL 07/04/2010 *.
    07/05/2010 4510 PM 3.91
    07/05/2010 CETE28 4.74
    07/05/2010 TIIE28 5.25

    Will be:

    RATE OF TYPE DATE
    07/01/2010 4510 PM 3.71
    07/01/2010 CETE28 4.59
    07/01/2010 TIIE28 4.95
    07/02/2010 4510 PM 3.82
    07/02/2010 CETE28 4.63
    07/02/2010 TIIE28 5.11
    * 07/03/2010 4510 PM 3.82*
    * 07/03/2010 CETE28 4.63*
    * 07/03/2010 TIIE28 5.11*
    * 07/04/2010 4510 PM 3.82*
    * 07/04/2010 CETE28 4.63*
    * 07/04/2010 TIIE28 5.11*
    07/05/2010 4510 PM 3.91
    07/05/2010 CETE28 4.74
    07/05/2010 TIIE28 5.25

    What could I do?

    Hello

    You can use the analytic LAST_VALUE function to get the last day of work before each date into your table. It will be the same as the current day for every day of work.
    Do it a self-join to combine each current line (c) with the last day of work (l):

    WITH     got_last_work_day     AS
    (
         SELECT     dt, type, rate
         ,     LAST_VALUE ( CASE
                        WHEN  type  IS NOT NULL
                        THEN  dt
                       END
                       IGNORE NULLS
                      ) OVER (ORDER BY dt)     AS last_work_day
         FROM     table_x
    )
    SELECT       c.dt, l.type, l.rate
    FROM       got_last_work_day     c
    JOIN       got_last_work_day     l  ON       (    c.dt          = l.dt
                             AND  c.type          = l.type
                             )
                           OR     (    c.last_work_day     = l.dt
                             AND  c.type          IS NULL
                             )
    ORDER BY  c.dt
    ,       l.type
    ;
    

    Among other things, I guess that the type is NULL if (and only if) the line represents a holiday or weekend, and that the combination (dt, type) is uniuqe.

  • Can you after you have selected a picture with the magic wand just delete the background, leaving only the photo?

    Can you after you have selected a picture with the magic wand, just delete the background, leaving only the photo?

    Or should we use layers to achieve?

    I use Adobe Elements 8.

    Thank you

    Martin

    What is your intention to delete the background - replace the white background transparency or others?

    Keep in mind that if you delete on the background layer (the default name), deletion is replaced by the current color set in the chip of background color as shown in the toolbar. By default, it is white, so if you are selection and deletion of a white background you will end up with white again. If you want that transparency first change the background to a normal layer Layer renaming.

  • selecting a value in the drop-down list but page must not get recharged again.

    Hello
    I created a drop-down list. After you have selected a value from him, I can get a value in the box of text below according to updon one sql query. but the problem is that I HAV to select Page Action when the changed value parameter to the set value and redirect. Thanks to her whenever I have to select a value from the drop-down list, page get updated. Is there a way that will satisfy the requirement but page does not get new dependants.
    I use apex 4.2.
    Thank you

    You can create A dynamic Action to set the value while changing the value in the Select list (drop-down list).

    Event: change
    Selection type: item (s)
    Article (s): choose your selection list item
    Action: Execute the PL/SQL Code
    PL/SQL code:

    begin
    select colum_name into :Px_text_item_name from table where column_name=:px_select_list_name;
    end;
    

    Page elements to send: px_select_list_name
    Page referred to return: Px_text_item_name

    Its work for me without refreshing the page. Assume that, if you want to pass this value to the element in another page, then use the branch for redirection and assign the value to the element on the page of another.

    Thank you
    Lacombe

  • How to compare the new values with the old values in triggers.

    Dear all,

    Please tell me how to compare the new values with the old values in triggers.

    Hi, the employee example is in the document. You'd better read yourself.

    CREATE OR REPLACE TRIGGER Print_salary_changes
      BEFORE DELETE OR INSERT OR UPDATE ON Emp_tab
      FOR EACH ROW
    WHEN (new.Empno > 0)
    DECLARE
        sal_diff number;
    BEGIN
        sal_diff  := :new.sal  - :old.sal;
        dbms_output.put('Old salary: ' || :old.sal);
        dbms_output.put('  New salary: ' || :new.sal);
        dbms_output.put_line('  Difference ' || sal_diff);
    END;
    /
    
  • Select literal values in the same column

    Hello
    like the practice:

    Select 'A', 'B', 'C' for double
    will select these values in their own column on the same line, is there a simple way to select these values in the same column on lines without first their insertion into a table?

    Thank you
    SQL> select 'A' x from dual union
      2  select 'B' x from dual union
      3  select 'C' x from dual ;
    
    X
    -
    A
    B
    C
    

    A bit complicated:

    SQL> select chr(ascii('A')+level-1) x
      2  from dual
      3  connect by level <=3;
    
    X
    -
    A
    B
    C
    

    Other:

    SQL> select regexp_substr('ABC','[[:alpha:]]',1,level) x
      2  from dual
      3  connect by level <= length('ABC');
    
    X
    ---
    A
    B
    C
    

    Max
    http://oracleitalia.WordPress.com

    Published by: Massimo Ruocchio, February 12, 2010 17:55
    added a second

    Published by: Massimo Ruocchio, February 12, 2010 17:58
    Added the third

  • update line and reset the value of the column

    I have table (CORS_MTR) with 3 columns...

    SEQ ID of the EPR the ID of the child / / desc
    100221one
    101222two

    new entry as 1 number , that means change the flow of child #

    102223three

    When I enter the new line in number of children 1 instead of 2 and then the values of the column (child id, desc) another need to be reset as...

    SEQ ID of the EPR the ID of the child / / desc
    100222two
    101221one
    102223three
    103224four
    SEQ PRT_ID CHILD_ID DESC_
    100 22 1 one
    101 22 2 two
    102 22 3 three

    declare

    number of p_seq: = 103;

    number of p_prt_id: = 22;

    number of p_child_id: = 1;

    p_desc varchar2 (25): = 'a ';

    Start

    Update cors_mtr

    set seq = case when child_id = p_child_id

    then seq + 1

    other seq - 1

    end

    where prt_id = p_prt_id

    and child_id (p_child_id, p_child_id + 1);

    insert into cors_mtr (seq, prt_id)

    values(p_seq,p_prt_id);

    Update cors_mtr

    Set child_id = (select max (child_id) + 1 of the cors_mtr).

    desc_ = (select to_char (to_date (max (child_id) + 1, 'J'), 'jsp') of cors_mtr)

    where child_id is null.

    end;

    SEQ PRT_ID CHILD_ID DESC_
    100 22 2 two
    101 22 1 one
    102 22 3 three
    103 22 4 four

    Concerning

    Etbin

  • Dynamically by passing the values in the columns

    Hi all

    I'm trying a pl/sql block that take a string and execute it dynamically. Suppose that here is the string

    M_COL: = Q' [(Code_P = > ': DEPTNO', P_CODE_TYPE = > "ÉTAT")]';

    Now try to run. using below

    M_STR: = 'SELECT CHK_DEPT ' | M_COL | ' FROM EMP WHERE EMPNO = "7499" ';


    RUN IMMEDIATELY M_STR

    IN M_DATE;

    Now what I want is M_STR vairable executed as

    SELECT CHK_DEPT (Code_P = > DEPTNO, P_CODE_TYPE = > 'STATE') FROM EMP WHERE EMPNO = '7499'

    Instead of

    SELECT CHK_DEPT (Code_P = > 'DEPTNO', P_CODE_TYPE = > 'STATE') FROM EMP WHERE EMPNO = '7499'

    another other way in the Code_P column DEPTNO value parameter must be passed. Also note that the DEPTNO column in the M_COL string is Dynamic.i.e

    M_COL: = Q' [(Code_P = > ': DEPTID', P_CODE_TYPE = > "ÉTAT")]'; OR

    M_COL: = Q' [(Code_P = > ': EMP_ID', P_CODE_TYPE = > "ÉTAT")]';

    Any suggestions, please share with me.

    And also, please don't bother much about the data and the output of function. If I get a way to pass the value of the column in function, my problem is solved.

  • Partial Page rendering - refresh value in the column

    Hi gurus of the OFA.
    I created a page of creation and followed the tutorial on Partital page made by creating a view PVO object and I am able to make the "EmployeeNumber" / "Location" column true false GOLD according to the value of another field (area).

    The 'TypeMonitored' (choice of message) has 2 values (area/employee). If the user selects the 'zone' then "EmployeeNumber" column should be hidden and if the user selects 'Employee', then the 'Place' column should be hidden. It works very well.

    My problem is if the user has selected 'Employee' in the 'TypeMonitored' of poplist and registered the "EmployeeNumber" and then immediately again if the user selects "Domain" of the "TypeMonitored" of poplist and enters the 'place' (since the site is now visible to the user) and click on Save and then the record is get recorded with the two values. I need to have the value of the column of 'Employee' to be empty in this case.

    Basically need to SETTING / erases the value of EmployeeNumber before any record in the database.

    Any help would be appreciated to greatlly. Please let me know if you want more details.

    Thank you
    Mir

    Here is my Code AMImpl
    ===============
    package lac.oracle.apps.lac.lacempexposure.server;

    Import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
    Import oracle.apps.fnd.framework.server.OAViewObjectImpl;
    Import oracle.jbo.Row;
    Import oracle.apps.fnd.framework.OAViewObject;
    Import oracle.jbo.Transaction;

    Import oracle.jbo.domain.Number;
    Import oracle.apps.fnd.framework.OARow;
    Import oracle.apps.fnd.common.MessageToken;
    Import oracle.apps.fnd.framework.OAException;

    // ---------------------------------------------------------------------
    -File generated by Oracle ADF business components Design-time.
    -Custom code can be added to this class.
    -WARNING: do not change the methods generated method signatures.
    // ---------------------------------------------------------------------
    SerializableAttribute public class LacEmpExposureAMImpl extends OAApplicationModuleImpl {}

    / * This is the default constructor (do not remove)
    */
    public LacEmpExposureAMImpl() {}
    }

    /*
    *****************************************************************
    * Initializes the application transient VO properties.
    *****************************************************************
    */
    public void init()
    {

    System.out.println ("in LACEmpExposureAMImpl.java IN init");
    System.out.println (LacTypeMonitored);

    OAViewObject appPropsVO = (OAViewObject) findViewObject ("LacExpCreatePVO1");

    If (appPropsVO! = null)
    {
    Not reset the VO unless necessary. Note that this method
    not trying to query the database for your with no SELECT statement
    and only transient attributes.

    If (appPropsVO.getFetchedRowCount () == 0)
    {

    Set the mapping size extraction to 0 to a VO in memory
    It prevents to try the query lines. The call
    executeQuery() ensures that the lines are not lost after
    validation under (workaround for known issue of BC4J) operation.

    appPropsVO.setMaxFetchSize (0);
    appPropsVO.executeQuery ();

    You must create and insert a line in the original Version, before you start
    definition of the properties.

    appPropsVO.insertRow (appPropsVO.createRow ());
    Set the primary key for this single-rwo VO.
    Line OARow = (OARow) appPropsVO.first ();
    row.setAttribute ("RowKey", new Number (1));
    }
    } / / Initialization of application VO properties (and the user interface) based on the
    Tracking to default value set on the underlying object Type.


    handleTypeMonitoredChangeEvent();

    } / / end of init()


    /*
    * *******************************************************
    Manages the poplist TypeMonitored changes to set the
    * application properties value of PRR VO
    * *******************************************************
    */

    Public Sub handleTypeMonitoredChangeEvent()
    {
    Get the properties of special application, einreihig, and make the
    First (only) current line.

    OAViewObject vo = (OAViewObject) findViewObject ("LacExpCreatePVO1");
    Line OARow = (OARow) vo.first ();

    Get the value of the attribute of the object from view with the code TypeMonitored


    OAViewObject LacEmpExposureCreateVO = (OAViewObject) findViewObject ("LacEmpExposureVO1");
    OARow LacEmpExposureCreateRow = (OARow) LacEmpExposureCreateVO.getCurrentRow ();
    String LacTypeMonitored = (String) LacEmpExposureCreateRow.getAttribute ("TypeMonitored");


    System.out.println ("in LACEmpExposureAMImpl.java IN handleTypeMonitoredChangeEvent");
    System.out.println (LacTypeMonitored);
    row.getAttribute ("LocationMonitoredRender");
    System.out.println (Row.GetAttribute ("LocationMonitoredRender"));


    If (("Personal".equals (LacTypeMonitored)))
    {
    row.setAttribute ("LocationMonitoredRender", Boolean.FALSE);
    row.setAttribute ("EmployeeNumberRender", Boolean.TRUE);
    row.setAttribute ("FullNameRender", Boolean.TRUE);

    }
    else if (("Area".equals (LacTypeMonitored)))
    {

    row.setAttribute ("LocationMonitoredRender", Boolean.TRUE);
    row.setAttribute ("EmployeeNumberRender", Boolean.FALSE);
    row.setAttribute ("FullNameRender", Boolean.FALSE);
    }

    } / / handleTypeMonitoredChangeEvent()



    / * Main sample for debugging code of business using the tester components.
    */
    Public Shared Sub main (String [] args) {}
    launchTester ("lac.oracle.apps.lac.lacempexposure.server", / * name of the package * /)
    ("LacEmpExposureAMLocal" / * Configuration name * /);
    }

    / * Getter of the container for LacEmpExposureVO1
    */
    public OAViewObjectImpl getLacEmpExposureVO1() {}
    return (OAViewObjectImpl) findViewObject ("LacEmpExposureVO1");
    }

    / * Getter of the container for EmployeeNamesLovVO1
    */
    public OAViewObjectImpl getEmployeeNamesLovVO1() {}
    return (OAViewObjectImpl) findViewObject ("EmployeeNamesLovVO1");
    }

    / * Getter of the container for MonitoringTypeVO1
    */
    public OAViewObjectImpl getMonitoringTypeVO1() {}
    return (OAViewObjectImpl) findViewObject ("MonitoringTypeVO1");
    }

    / * Getter of the container for LacParameterMonitoredVO1
    */
    public OAViewObjectImpl getLacParameterMonitoredVO1() {}
    return (OAViewObjectImpl) findViewObject ("LacParameterMonitoredVO1");
    }

    /*
    *******************************
    * Creates a new record of the exhibition
    *******************************
    */
    Public Sub CreateLacEmpExposure()
    {
    OAViewObject vo = (OAViewObject) getLacEmpExposureVO1 ();

    By coding standards, it is the right way of
    initialize a VO that is used for queries and inserts.
    See the objects in view in detail in the developer's Guide can do for
    Additional information.

    System.out.println ("in LACEmpExposureAMImpl.java IN CreateLacEmpExposure");

    If (!) VO.isPreparedForExecution ())
    {
    vo.executeQuery ();
    }
    Line = vo.createRow ();
    vo.insertRow (row);
    Required by OA Framework model M69 coding standards

    row.setNewRowState (Row.STATUS_INITIALIZED);

    } / / end CreateLacEmpExposure


    /*
    *****************************************************************
    * Performs a rollback, including the database and the middle-tier
    *****************************************************************
    */
    Public Sub rollbackLacEmpExposure()
    {
    Transaction txn = getTransaction();

    This small optimization ensures that we do not have persorm a restore
    If you have not to.

    If (txn.isDirty ())
    {
    TXN. Rollback();
    }
    } / / end rollbackLacEmpExposure()

    / * Getter of the container for LacEmpExposureLOVDataVO1
    */
    public OAViewObjectImpl getLacEmpExposureLOVDataVO1() {}
    return (OAViewObjectImpl) findViewObject ("LacEmpExposureLOVDataVO1");
    }

    /*
    * *****************************
    * Commits the transaction
    * *****************************
    */
    public void Apply()
    {
    getTransaction () .commit ();
    } / / end apply()

    / * Getter of the container for LacExpCreatePVO1
    */
    public OAViewObjectImpl getLacExpCreatePVO1() {}
    return (OAViewObjectImpl) findViewObject ("LacExpCreatePVO1");
    }


    /*
    ***********************************************************************
    * Initializes the request of employee details for the Update Page.
    ***********************************************************************
    */
    public void initDetailsUpdate (String EmployeeNumber,
    String FullName,
    String RecordSeq)
    {

    System.out.println ("in LACEmpExposureAMImpl.java IN initDetailsUpdate");

    System.out.println ("LACEmpExposureAMImpl == > EmployeeNumber in initQueryUpdate is:" + EmployeeNumber);
    System.out.println ("LACEmpExposureAMImpl == > FullName in initQueryUpdate is:" + FullName);
    System.out.println ("LACEmpExposureAMImpl == > RecordSeq in initQueryUpdate is:" + RecordSeq);

    OAViewObjectImpl vo = getLacEmpExposureVO1();

    LacEmpExposureEditVOImpl vo = (LacEmpExposureEditVOImpl) getLacEmpExposureEditVO1 ();


    OAViewObject vo = (OAViewObject) getLacEmpExposureVO1 ();

    If (vo is nothing)
    {
    MessageToken [] errTokens = {new MessageToken ("parameter", "LacEmpExposureVO1")};
    throw new OAException ("AK", "FWK_TBX_OBJECT_NOT_FOUND", errTokens);
    }

    ToL InitQueryUpdate (EmployeeNumber, FullName, RecordSeq);

    Line row = vo.first ();

    vo.setCurrentRow (row);



    /*
    Since we will interview a single row with a primary key value, we
    can use the findByKey method, which first checks the cache of BC4J
    and if it does not find one matching row, it will put forward a request for help
    the given key and retrieve it from the database.
    String [] keys = {employeeNumber};
    Line lines [] = vo.findByKey (new Key (keys), 1);

    You must set the current line, or the details page will not display any
    data. When you explicitly query data, you don't have to do it.

    If (rows! = null)
    {
    vo.setCurrentRow(rows[0]);
    }
    */

    } / / end initDetails()


    / * Getter of the container for LacEmpExposureEditVO1
    */
    public LacEmpExposureEditVOImpl getLacEmpExposureEditVO1() {}
    return (LacEmpExposureEditVOImpl) findViewObject ("LacEmpExposureEditVO1");
    }
    } / / end of class LacEmpExposureAMImpl

    Hello

    In your LacTypeMonitored / / I guess it will fire when you change the value of employee poplist form in area
    Add logic for null value, the value of the employee
    If (("Area".equals (LacTypeMonitored)))
    {

    row.setAttribute ("LocationMonitoredRender", Boolean.TRUE);
    row.setAttribute ("EmployeeNumberRender", Boolean.FALSE);
    row.setAttribute ("FullNameRender", Boolean.FALSE);

    Change the attribute used to null
    (OARow) LacEmpExposureCreateVO.getCurrentRow () .setAttribute ("", null);

    }

    Let me know that it works.

    Thank you

    With respect,
    Kali.
    OSSI.

  • How to use the prompt value in the column of the report

    Hello

    I have a quick report column which is 'Adj Type' that contains values 10,20,30, and when the user selects Adj Type = 10, this value should be passed on to the column of the report.

    For example. Value in column 1 is 10 and this should multiple with the prompt value and production is expected to be 10 * 10.

    Ideas how to capture the prompt values in the column of the report for the calculation.

    Hi hsekar,

    (1) declare a presentation online in the section variable set Variable--> Variable--> P_var presentation

    (2) in Fx Table_name. Your_column * @{P_Var}

    @{P_var} {20} (20 is the default, it replaces when a user selects the value in the command prompt

    Thank you
    Saichand.v

  • Aggregated value of the column in which referencing Clause

    Hello-

    I am trying to determine how I can accomplish the following the most simple and effective way.

    Among other things, I select the next value in my table:
    max(received_date) as last_received_date
    I also need to assess the value of 'last_received_date' as a condition in my where clause. However, I can't refer to my value in the column alias 'last_received_date', and when trying to evaluate max (received_date) in where clause, I get the error 'group feature is not permitted here.

    Does anyone know of a good workaround?

    Thank you
    Christine

    Hello

    Maybe you can use the HAVING clause:

    Example:

    Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0
    Connected as hr
    
    SQL>
    SQL> WITH DATA as (
      2  select to_date('10/02/2009', 'dd/mm/yyyy') as received_date from dual union all
      3  select to_date('10/01/2009', 'dd/mm/yyyy') as received_date from dual union all
      4  select to_date('14/02/2009', 'dd/mm/yyyy') as received_date from dual union all
      5  select to_date('11/01/2009', 'dd/mm/yyyy') as received_date from dual union all
      6  select to_date('15/02/2009', 'dd/mm/yyyy') as received_date from dual union all
      7  select to_date('13/02/2009', 'dd/mm/yyyy') as received_date from dual
      8  )
      9  select max(received_date) from data having max(received_date) > to_date('14/02/2009', 'dd/mm/yyyy');
    
    MAX(RECEIVED_DATE)
    ------------------
    15/02/2009
    
    SQL>
    

    Kind regards

  • How to display the value of the column

    Oracle 10g on Linux

    I want to display the value of the id column in the table of www if count (distinct id) is 1. The following query is fine except that it does not display the value of the column ID help, please.
    SELECT count(distinct id)
                   FROM www c
                  WHERE C.x_code IN (SELECT D.x_code
                                                     FROM www_app d
                                                    WHERE d.y_code = '1151299386')
                  having count(distinct id) = 1                                                

    I think you can use MAX in this case

    SELECT max(id)
                   FROM www c
                  WHERE C.x_code IN (SELECT D.x_code
                                                     FROM www_app d
                                                    WHERE d.y_code = '1151299386')
                  having count(distinct id) = 1
    

Maybe you are looking for

  • search for Delta is a new choice of tab...

    Morning. Two days ago I reinstalled FF on a clean install of W7. After installing each (software, ext., personas, etc) when I run FF, the "Add" tab sometimes is on the far right (which doesn't bother me), but when I clik on the sign, the new tab open

  • Satellite R630-155 - no express card slot

    Hello I have a R630 155 and I have a PC card / Express card slot as far as I know. Toshiba manual shows that it would be just below the optical drive [cd] on the right side of the laptop, but I do not have such a slot. Anyone know if it is possible t

  • Windows 8 install on Virtual Box

    When you install Windows 8 in my VirtualBox, I get this error message "no device drivers were found. Make sure that the installation media contains the correct drivers, and then click ok. Is there a solution for this? » My PC is a 64 - bit Windows 7

  • Scrolling and keyboard have a delay of perhaps 1 or 2 seconds.

    Scrolling and keyboard have a delay of perhaps 1 or 2 seconds.  I will type a Word and it does not appear for a second or two. I put the mouse to the default settings, but it did not help. original title: scrolling and keyboard

  • Copy the Web page address

    How to copy a Web page address in the Google app on my compact z3