divide the value in the column value

Hi all

I have an EMP table with column (NAME varchar2 (100)). It has a full name with name value "«MIDDLE_NAME"»
It should always has 3 words value separated by single spaces.

Value of the sample: FRANKLIN ROOSEVELT OBAMA


I want to create a view EMP2_VW that contains a split each distinct names as MIDDLE_NAME, LAST_NAME, FIRST_NAME


How can I do this?


Thank you very much
SQL> with t as (
  2  select 'FRANKLIN ROOSEVELT OBAMA' fullname from dual
  3  )
  4  --
  5  -- actual query:
  6  --
  7  select fullname
  8  ,      substr( fullname
  9               , 1
 10               , instr(fullname, chr(32))-1
 11               ) first_name
 12  ,      substr( fullname
 13               , instr(fullname, chr(32), 1, 1)+1
 14               , instr(fullname, chr(32), 1, 2)-1 - instr(fullname, chr(32), 1, 1)
 15               ) middle_name
 16  ,      substr( fullname
 17               , instr(fullname, chr(32), 1, 2)+1
 18               ) last_name
 19  from   t;

FULLNAME                 FIRST_NAME               MIDDLE_NAME              LAST_NAME
------------------------ ------------------------ ------------------------ -------------
FRANKLIN ROOSEVELT OBAMA FRANKLIN                 ROOSEVELT                OBAMA

1 row selected.

Tags: Database

Similar Questions

  • How to divide the column Date OBIEE

    Hello
    We have the name of the date column: To_Date and the format is DD/MM/YY hh.
    How to divide the date in YEARS, MONTHS, DAY as new columns.
    kindly help on that.


    Kind regards.
    CHR

    Published by: 867932 on November 23, 2011 22:18

    Hi user,

    All 3 functions can be written in RPD too. MDB layer, duplicate the date column-> the mapping tab to column of Goto-> expression-> functions Builder Select-> calendar Date functions / hour-> select DayofMOnth function. The column of your logic formula will look like,

    DayofMonth (YourDateColumn)

    Rgds,
    DpKa

  • DIVIDE THE COLUMNS 2

    Hello pppl.
    Please can you me two to divide the result of two columns (from two different views), effectively without using the PL/SQL?
    for example
    column a: 123456789
    column B:987654321
    need to produce column c (a / b): 1/9.2/8.3/7,...
    Thank you!

    This changes your original question a bit:

    SQL> with v1 as (
      2  select 'HOSP1' hospitals, 2 visits from dual union all
      3  select 'HOSP2' , 1 from dual union all
      4  select 'HOSP3' , 1 from dual union all
      5  select 'HOSP4' , 1 from dual union all
      6  select 'HOSP5' , 0 from dual union all
      7  select 'HOSP6' , 1 from dual union all
      8  select 'HOSP7' , 2 from dual union all
      9  select 'HOSP8' , 1 from dual
     10  )
     11  ,      v2 as (
     12  select 'HOSP1' hospitals, 2 doctors from dual union all
     13  select 'HOSP2' , 1 from dual union all
     14  select 'HOSP3' , 1 from dual union all
     15  select 'HOSP4' , 2 from dual union all
     16  select 'HOSP5' , 1 from dual union all
     17  select 'HOSP6' , 2 from dual union all
     18  select 'HOSP7' , 1 from dual union all
     19  select 'HOSP8' , 2 from dual
     20  )
     21  --
     22  -- actual query, change view names for your own views:
     23  --
     24  select a.hospitals
     25  ,      a.visits/b.doctors ratio
     26  from   v1 a
     27  ,      v2 b
     28  where  a.hospitals = b.hospitals;
    
    HOSPI      RATIO
    ----- ----------
    HOSP1          1
    HOSP2          1
    HOSP3          1
    HOSP4         ,5
    HOSP5          0
    HOSP6         ,5
    HOSP7          2
    HOSP8         ,5
    
    8 rows selected.
    
  • SQL help - Need help to rotate the columns to rows

    I have a HughesNet to divide the columns into multiple lines. For example:

    EMP_DEPT

    ROWID empid1 ename1 empid2 ename2 empid2 ename2 empid4 ename4 dept4 dep3 dep2 dept1
    100001 1 'SCOTT' 10 2 'DAVE' 20 3 10 4 20 SMITH "MILLER"
    100002 1 'SCOTT' 10 2 'DAVE' 20 3 'MILLER' 20

    Note: EMP_DEPT do not always have information about the 4 employees settled for example in info only 3 employees rank 2 are there

    I need to convert and insert it into the EMPLOYEE table as follows:

    EMPLOYEE

    EmpID ename dept
    1 SCOTT 10
    2 20 DAVE
    3 MILLER 10
    4 SMITH 20

    1 SCOTT 10
    2 20 DAVE
    3 MILLER 20

    Thank you
    KeV

    Hey Kevin,

    Here's one way:

    WITH t AS (
      SELECT level i FROM dual CONNECT BY level <= 4
    )
    SELECT enty_type, enty_name, enty_id
    FROM (
      SELECT case when mod(t.i,2) = 0 then 'DEPARTMENT'
                  else 'EMPLOYEE'
             end as enty_type
           , case t.i
               when 1 then emp_name1
               when 2 then dept_name1
               when 3 then emp_name2
               when 4 then dept_name2
             end as enty_name
           , case t.i
               when 1 then emp_id1
               when 2 then dept_id1
               when 3 then emp_id2
               when 4 then dept_id2
             end as enty_id
      FROM emp
           CROSS JOIN t
    )
    WHERE enty_id IS NOT NULL
    ;
    

    Another using the MODEL clause:

    SELECT *
    FROM (
      SELECT enty_id, enty_name, enty_type
      FROM emp
      MODEL
      RETURN UPDATED ROWS
      PARTITION BY (pk)
      DIMENSION BY (0 i)
      MEASURES(
         emp_id1, emp_name1
       , emp_id2, emp_name2
       , dept_id1, dept_name1
       , dept_id2, dept_name2
       , cast(null as number(10)) enty_id
       , cast(null as varchar2(200)) enty_name
       , cast(null as varchar2(30)) enty_type
      )
      RULES (
         enty_type[1] = 'EMPLOYEE' , enty_id[1] = emp_id1[0], enty_name[1] = emp_name1[0]
       , enty_type[2] = 'EMPLOYEE' , enty_id[2] = emp_id2[0], enty_name[2] = emp_name2[0]
       , enty_type[3] = 'DEPARTMENT' , enty_id[3] = dept_id1[0], enty_name[3] = dept_name1[0]
       , enty_type[4] = 'DEPARTMENT' , enty_id[4] = dept_id2[0], enty_name[4] = dept_name2[0]
      )
    )
    WHERE enty_id IS NOT NULL
    ;
    

    Published by: odie_63 on 8 Dec. 2010 21:00

  • Extract the column names

    Hi all

    I have a requirement...
    I have a sql Query, something like this

    Select emp_code,
    emp_first_name | » '|| emp_last_name,
    substr (emp_addr, 1, 240),
    NVL(SAL,0) wages.
    emp_doj
    Of employee_master

    I want to divide the columns in a table of column_detail
    as
    column_id column_name
    1 emp_code
    2 emp_first_name | » '|| emp_last_name
    3 substr (emp_addr, 1, 240)
    4 nvl(sal,0)
    5 emp_doj

    Is it possible to do this... other than the weiring loooooooooooops that handles all the possible characters?

    Please, I beg you. help... Thanks in advance
    Concerning
    Dora

    Hello

    Use the DBMS_SQL package:

    Connected to:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    
    SQL> set serveroutput on
    SQL>   -----------------------------------------------
    SQL>   --  Get data structure for any select order  --
    SQL>   -----------------------------------------------
    SQL> Declare
      2    c           NUMBER;
      3    d           NUMBER;
      4    col_cnt     PLS_INTEGER;
      5    rec_tab     dbms_sql.desc_tab;
      6    col_num     NUMBER;
      7    LC$Order    VARCHAR2(2000) := 'Select EMPNO, ENAME, JOB FROM EMP' ;
      8
      9    v           VARCHAR2(4000) ;
     10    t           T1 ;
     11
     12    result             INTEGER;
     13
     14    BEGIN
     15
     16      -- retrieve the columns of the query --
     17      c := dbms_sql.open_cursor;
     18
     19      dbms_sql.parse(c, LC$Order , dbms_sql.NATIVE);
     20
     21      d := dbms_sql.execute(c);
     22
     23      dbms_sql.describe_columns(c, col_cnt, rec_tab);
     24
     25
     26      For i in rec_tab.first .. rec_tab.last Loop
     27
     28        Dbms_Output.put_line('Colomn name:' || rec_tab(i).col_name ) ;
     29        --rec_tab(i).col_name ;      -- name
     30        --rec_tab(i).col_type ;      -- type
     31        --rec_tab(i).col_precision ; -- precision
     32        --rec_tab(i).col_scale ;     -- scale
     33        --rec_tab(i).col_max_len ;   -- length
     34
     35      End loop ;
     36
     37      dbms_sql.close_cursor(c);
     38
     39
     40    EXCEPTION
     41      WHEN OTHERS THEN
     42
     43        IF dbms_sql.is_open(c) THEN
     44           dbms_sql.close_cursor(c);
     45        END IF;
     46
     47        RAISE;
     48
     49    END;
     50  /
    Colomn name:EMPNO
    Colomn name:ENAME
    Colomn name:JOB
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    François

  • Divide the values of a single column into multiple values of columns

    I want that the values of the "col_val" column to divide into several values in the column

    Table1:

    Col_val Col1, Col2

    Code1 POINT 45

    L2 AB 45

    L1 POINT 45 OF

    Code2 CAB 61

    ABC 51 LABORATORY

    SSS LAB 45

    QQQ BED 123

    BBV COT 100

    FFF COT 444

    Output as expected:

    OUT1 out2 out3-out4, out5

    Code1 AB SSS

    L1

    Code2

    ABC

    QQQ

    BBV

    FFF

    Each line must contain the values corresponding to the Col2 values and each column must have the values in Col1, as illustrated above.

    SQL> with t
      2  as
      3  (
      4  select 'Code1' col_val, 'ITEM' col1, 45 col2
      5    from dual
      6  union all
      7  select 'L2' col_val, 'AB' col1, 45 col2
      8    from dual
      9  union all
     10  select 'L1' col_val, 'ITEM' col1, 45 col2
     11    from dual
     12  union all
     13  select 'Code2' col_val, 'CAB' col1, 61 col2
     14    from dual
     15  union all
     16  select 'ABC' col_val, 'LAB' col1, 51 col2
     17    from dual
     18  union all
     19  select 'SSS' col_val, 'LAB' col1, 45 col2
     20    from dual
     21  union all
     22  select 'QQQ' col_val, 'COT' col1, 123 col2
     23    from dual
     24  union all
     25  select 'BBV' col_val, 'COT' col1, 100 col2
     26    from dual
     27  union all
     28  select 'FFF' col_val, 'COT' col1, 444 col2
     29    from dual
     30  )
     31  select max(col1)
     32       , max(col2)
     33       , max(col3)
     34       , max(col4)
     35       , max(col5)
     36    from (
     37            select decode(col1, 'ITEM', col_val) col1
     38                 , decode(col1, 'AB'  , col_val) col2
     39                 , decode(col1, 'LAB' , col_val) col3
     40                 , decode(col1, 'CAB' , col_val) col4
     41                 , decode(col1, 'COT' , col_val) col5
     42                 , t.col2 col_2
     43                 , row_number() over(partition by col2, col1 order by 1) rno
     44              from t
     45         )
     46   group
     47      by col_2, rno
     48   order
     49      by col_2;
    
    MAX(C MAX(C MAX(C MAX(C MAX(C
    ----- ----- ----- ----- -----
    Code1 L2    SSS
    L1
                ABC
                      Code2
                            BBV
                            QQQ
                            FFF
    
    7 rows selected.
    
    SQL>
    
  • Display the name of the tag as the column name and the value in the tag as a row of data from the input string.

    Hi Forum members,

    I am looking for a query display the name of the tag as the column name and the value in the tag as a row of data.

    I have to print the values within the tag to a file by choosing the value of the flags. the sequence of the tags will vary each time, as the tag name will change dynamically.

    So here is the example of input data and the expected output. The string in the text column must be separated as the column names and values.

    Input data
    Select 1 as seqno,' < > 0210A 50 4f < / 4f > < 5f20 > TEST CARD 16 < / 5f20 > < 5f2a > < / 5f2a > < 82 > 1 c 00 < / 82 > ' double text


    Output:

    Seqno 4f 5f20 5f2a 82
    0210A 50 16 1 00 TEST CARD 1

    Please help me by providing your entries on this.

    We use the version of Oracle 11.2.

    Note: This is not the XML string

    Thank you

    Shree

    with

    data in the form of

    (select 1 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2a><82>00 1' text of all the double union)

    Select 2 as seqno,'XYZ<4F>0210 A 50<5f20>TEST CARD 16<5f2a><82>00 1' text of all the double union

    Select 3 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2A><82>1 00XYZ ' text of all the double union

    Select option 4 as seqno,'<4F>0210 A 50<5F20>TEST CARD 16<5f2A><82>1 00XYZ' double text

    )

    Select d.seqno, x.*

    d the data,

    XMLTable ('/ root')

    by the way xmltransform (xmltype ('': replace (replace (text,'<><>'),)))

    XmlType (q'~http://www.w3.org/1999/XSL/Transform "version ="1.0"> ")

                                                     

                                                       

                                                         

                                                       

                                                     

                                                     

                                                       

                                                         

                                                       

                                                     

    ~'

    )

    )

    path of columns '4f' varchar2 (10) "tag4f."

    path of "5f20' varchar2 (30)"tag5f20. "

    path of '5f2a' varchar2 (10) "tag5f2a."

    path of varchar2 (10) "82" "tag82.

    ) x


    SEQNO 4f 5f20 5f2a 82
    1 0210A 50 16 TEST CARD - 1 00
    2 0210A 50 16 TEST CARD - 1 00
    3 0210A 50 16 TEST CARD - 1 00
    4 0210A 50 16 TEST CARD - 1 00

    with

    data in the form of

    (select 1 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2a><82>00 1' text of all the double union)

    Select 2 as seqno,'XYZ<4F>0210 A 50<5f20>TEST CARD 16<5f2a><82>00 1' text of all the double union

    Select 3 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2A><82>1 00XYZ ' text of all the double union

    Select option 4 as seqno,'<4F>0210 A 50<5F20>TEST CARD 16<5f2A><82>1 00XYZ' double text

    ),

    Chopper (seqno, Key, value, String) as

    (select seqno,

    regexp_substr (text,'<(.+?)>', 1, 1, null, 1),

    regexp_substr (Text,'>(.*?))

    regexp_substr (text,'<.+?>. *? ) (.*) $', 1, 1, null, 1). » <>'

    from the data

    Union of all the

    Select seqno,

    regexp_substr (String,'<(.+?)>', 1, 1, null, 1),

    regexp_substr (String,'>(.*?))

    regexp_substr (String,'<.+?>. *? ) (.*) $', 1, 1, null, 1)

    Chopper

    where regexp_substr (string,'<(.*?)>', 1, 1, null, 1) is not null

    )

    Select '4f', seqno, '5f2a', '82', '5f20.

    of (seqno, lower (key) select key, value)

    Chopper

    )

    Pivot (max (value) for key in ('4f' as '4f', '5f20' as '5f20', '5f2a' as '5f2a', "82" as "82"))

    Concerning

    Etbin

  • Display the value of the column automatically based on another column in a table

    Hello

    I use APEX 5.0, I have a requirement to display the field automatically based on the tabular presentation of other numbers.

    img.png

    in the screen shot attached above when I press Add button line a new line is created and enter the value in 'place no.', 'dept and identification of height place' when I press tab or get out of the column "height", "GID" should appear automatically.

    To display the GID my query will be like that. "Select GID from x where no = '1011' place and dept = 88 and height = 88'.

    How to get the value of from GID of the another value entered in Place no, dept and height in tabular form.

    Thanks in advance

    Ravi.

    Hi Ravi

    No need to point of Application or process. I just completed the task with the following steps

    (1) create 4 hidden items

    P2_SELWID

    P2_SELDEPTH

    P2_SELHEIGHT

    P2_CALCWNAME

    (2) gives 3 CSS classes in three columns of tables.

    . WID

    . DEPTH

    . HEIGHT

    (3) create the function jQuery for re - get three items from the page on a line if one of them has been changed.

    Add the following code to the function and the declaration of global variables

    function setRowItemValues(p_rownum){
        wid_col_id = 'f02_' + rownum ;
        wid_col_val = $('#'+wid_col_id).val();
        depth_col_id = 'f03_' + rownum ;
        depth_col_val = $('#'+depth_col_id).val();
        height_col_id = 'f04_' + rownum;
        height_col_val = $('#'+height_col_id).val();
        wname_col_id = 'f05_' + rownum;
        // set P2_SELWID,P2_SELDEPTH,P2_SELHEIGHT
        $s("P2_SELWID", wid_col_val );
        $s("P2_SELDEPTH", depth_col_val );
        $s("P2_SELHEIGHT", height_col_val );
        $s("P2_SELWNAMEID", wname_col_id );
        // Call the Dynamic Action to get WNAME if all values are not null
        if( wid_col_val != ''  && depth_col_val != '' && height_col_val != '' ){
            //Call DA to Get WNAME from WINT
            $.event.trigger("CalcWNAME");
            // set the Tabular form
            $('#'+wname_col_id).val($x("P2_CALCWNAME").value);
        }
    }
    

    and run when the Page loads

    $(document).on("change", ".WID,.DEPTH,.HEIGHT", function(){
        rownum = $(this).attr('id').substr(4);
        setRowItemValues(rownum);
    });
    

    (4) create a dynamic Action to get WNAME based on a PL/SQL function. Note the submitted page elements.

    CalcWNAME

    (5) set of the corresponding element in the line of the function jQuery, after completing the DA.

    Please check and I hope your problem is now solved.

    Concerning

    Mahmoud

  • Using the value of the column of the report in view state

    Hi all

    I have a little trouble as long as you report column. Here's the problem I have face.

    I have a classic report in apex5 (universal theme). Please find the page here https://apex.oracle.com/pls/apex/f?p=62495:5:

    I want to have a condition that SAL column should appear only if DEPTNO! = 10. For this, I put a conditional display for SAL column that "point value / expression 1 column! Expression 2 ="and #DEPTNO # expression1 and expression2 10. But this doesn't seem to work. Can someone help me understand the issue.

    Note: I want to view only the column of the report, not the page item in the condition.

    Thank you

    Stephanie.

    Kalesh Ravi-Oracle wrote:

    I want to have a condition that SAL column should appear only if DEPTNO! = 10. For this, I put a conditional display for SAL column that "point value / expression 1 column! Expression 2 ="and #DEPTNO # expression1 and expression2 10. But this doesn't seem to work. Can someone help me understand the issue.

    It is not possible to report baseline values in the State of the reference column. It would be unwise to do so: how APEX can determine if the column should be included or not until all rows are retrieved?

    Note: I want to view only the column of the report, not the page item in the condition.

    Why? In the example given, this is the correct (and more effective) approach. If the condition must be based on the expected query results, then use a Exists (SQL query returns at least one row) or NOT Exists (SQL query returns no line) condition.

  • By using the link in the column to pass column values

    Hello

    I have a link to the column in my report which opens a modal page, now I want to use the value of the column clicked in the page that opens.

    I don't want to put any article on the opening page of the column value of click rather I want to use the value of the column of the click in my sql query.

    for example:

    1 P1 has the report < column link by clicking on it opens P2 >

    2. on page 2, I want to use the value of the clicked column.

    So far, I did

    1 link to page 2

    2. ask - #column_value_clicked #.

    3. in the sql query, I use the same above in the where clause.

    Any help...

    Thank you

    Rakesh

    fac586 wrote:

    Sunil Bhatia wrote:

    Hi Rakesh,

    Make use of x 01 parameter included in apex 5.0

    You can create a URL to page 1 as:

    f? p = 103:1:3241341234123: & x 01: #column_value_clicked #.

    Make use on request P2 in the form:

    Select * from test_table where id = APEX_APPLICATION. G_X01;

    You have not tested who, did you?

    I tested it buddy.

    Link https://apex.oracle.com/pls/apex/f?p=56971

    Click any bar chart and then wait that he freshen up.

    Click on report of ENAME and see that he went through the parameter.

    Report URL: f? p = 56971:2: & APP_SESSION. : No.: & x 01 = #ENAME #.

    -Sunil Bhatia

  • update of NULL in the column with the values of the adjacent column

    Examples of data

    with test_data as
    (select 1 as one, null as two, 2 as three,5 as four, 6 as five, null as six from dual
    union all
    select 1 as one, null as two, 2 as three,5 as four, 6 as five, null as six from dual)
    select * from test_data;
    

    This is one of those cases, the case may be where any value of a column can be null

    or two similar columns can be null. If the column is null then I want to update the adjacent column

    average value of the column, if the first column is null so I want to take the next non-null column and update, if the last column is null

    so I want to take prev not zero column and to update.

    In this case would be my expected output

    Un Two Three Four Five Six
    11.52566
    123566

    Prospects for the future the suggesion or advice.

    Or, using Analytics:

    SQL> with test_data (id, one, two, three, four, five, six) as (
      2    select 1, 1   , null, 2   , 5, 6, null  from dual union all
      3    select 2, 1   , null, 3   , 5, 6, null  from dual union all
      4    select 3, 1   , null, null, 5, 6, null  from dual union all
      5    select 4, null, null, null, 5, 6, null  from dual
      6  )
      7  select *
      8  from (
      9    select id
     10         , cell
     11         , case when next_nn is not null and prev_nn is not null
     12             then (next_nn + prev_nn)/2
     13             else nvl(next_nn, prev_nn)
     14           end val
     15    from (
     16      select id
     17           , cell
     18           , val
     19           , last_value(val) ignore nulls over(partition by id order by cell) as prev_nn
     20           , first_value(val) ignore nulls over(partition by id order by cell range between current row and unbounded following) as next_nn
     21      from test_data
     22      unpivot include nulls (val for cell in (one as 1, two as 2, three as 3, four as 4, five as 5, six as 6) )
     23    )
     24  )
     25  pivot ( min(val) for cell in (1 as "ONE", 2 as "TWO", 3 as "THREE", 4 as "FOUR", 5 as "FIVE", 6 as "SIX") )
     26  ;
    
            ID        ONE        TWO      THREE       FOUR       FIVE        SIX
    ---------- ---------- ---------- ---------- ---------- ---------- ----------
             1          1        1,5          2          5          6          6
             2          1          2          3          5          6          6
             3          1          3          3          5          6          6
             4          5          5          5          5          6          6
    
  • 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

  • need to update the value of the column automatically (exists and the new value)

    Hello

    (1) I Segment1, Segment2, Segment3, Segment4, item_status (new column modified in the Temp table)

    Must update the form OFA and the DB Temp table item_status value in the column when I click APPLY to SAVE the Inserted records in the DB table and form and must register the mtl_system_items_b Segment1, Segment2, Segment3, Segment4 in which the condition

    Note: need to update automatically item_status for existing and new inserted records in the Table and the form

     Serializable[] param = {Segment1, Segment2, Segment3, Segment4
                       };
                       am.invokeMethod("InsertRecord", param);
                       row.setAttribute("SelectFlag", "N");
    

    Thank you

    Renon,

    When you write code, try to understand what makes each line. (If you don't understand all the lines, feel free to ask)

    row.setAttribute ("ItemStatus", row.getAttribute ("ItemStatus"));

    What do you think that the above line done? You try to get the value of the attribute and trying to put the same value. How is it, that will have an impact?

    You need to do 2 things.

    1. change the insertRecord method and the State of return of this method.

    Change the definition of the function:

    public String InsertRecord (String itemstyle, String itemcust, String itemsize, String itemcolor, String ordrno,

    String desc)

    Add a return statement at the end after validation.

    TR.Commit ();

    return the situation;

    }

    2 accept that status in CO and set the value to the attribute details VO.

    String status = (String)am.invokeMethod ("InsertRecord", param);

    row.setAttribute ("ItemStatus",status);

    I hope this helps.

    See you soon

    AJ

  • How to use the values in the columns of an interactive report (Apex 5)

    Hello

    I have an interactive report and a link column and I click to set the value of four fields in a subregion with the value of four columns of the report.

    This without submitting the page every time so I think using javascript.

    But what is the right way to do this in 5 Apex?

    How to have a reference to the column of a report (customer.name to the customer or customer.city, for example)?

    Concerning

    Gianpaolo

    Hi gianpagi,

    gianpagi wrote:

    I can't run your code as well, on apex.oracle.com, I have re-product the situation with the emp table and the columns ename, sal and the fields p1_ename, p1_job, p1_sal

    Can you help me.

    https://Apex.Oracle.com/pls/Apex/f?p=4550:1:103040501310506:

    https://Apex.Oracle.com/pls/Apex/f?p=102726:LOGIN_DESKTOP:104044067688962:

    user and developer demo/demo (TR1 workspace)

    Check the application now. I've done the column 'Empno' as link and execution of your dynamic action on click on the link.

    Here are the changes:

    • Edited the "Empno" column attributes and perform the following settings in the properties of 'column link:

    Text link: #EMPNO #.

    Link attributes: class = 'empdetails '.

    Target: URL

    URL: javascript:void (0);

    NOTE: The link does nothing but on the onclick for the event of link DA no real logic.

    • Edited the dynamic action 'assign values' and set the following properties:

    Selection type: jQuery Selector

    jQuery Selector: a.empdetails

    Kind regards

    Kiran

  • retrieve the value column access via the variable name of the column

    I need to build a function of validation with this condition:

    The data model is like this:

    We have an array of items_general, with its id and data.

    Then we have specific tables, let's say... item_especific1, item_especific2 item_especificn. They have the same as the table of the item_general pk and fk against item_general

    Each element is in one of the tables item_specific and items_general.


    Now, the validation feature: I need to check for an element, if some special columns of the item_especificx table are null and will raise an error if this occurs.

    I got the name of especific_table and the list of names of particular column stored in another table.


    I guess I can browse this list of column table to build a clause concatening Dynamics 'and' | column_name | 'is nothing', but I'm not a big fan of the dynamic sql.


    Can you think of a better solution? Any way to access the value of the column by using the column name, as if it were a varchar2 key index?




    Nope, no filter.

    When you have a funky data like that model, you're destined to dynamic sql and other assortment of headaches.

  • I have a table with a city of the column. Values are 'delhi' and 'hyderabad '.

    I have a table with a city of the column. Values are 'delhi' and 'hyderabad '.

    as

    ID |   City

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

    1     |  Delhi

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

    2     |  Hyderabad

    Now, I have to update Delhi and Hyderabad Hyderabad with Delhi.

    How to do this?

    Hi Indi,

    (1) why do you want what it? Requirements of companies?

    (2) how much these values you want to reverse? Is it only "Delhi" and "Hyderabad", or there is a list, or other logic?

    Update your_table

    Set city = decode (lower (city), 'delhi', 'Hyderabad', 'hyderabad', 'Delhi')

    where lower (city) ('Delhi', 'hyderabad');

    Does that help?

Maybe you are looking for