Change the value of column select and insert different

Hi all

I've written a procedure where I am selecting values in other tables and inserting into a new table. The code is below
 
If you see line 54 in the code, you will find the combined_bu_code is comes from a procedure and the value of BU is stored in prod. Table SEM_BACKLOG_LOG. I need to check, if the combined_bu_code came as PWR then insert as table BACKLOG_OTD_NEW POWER not as PWR.

You are looking for assistance on this. Thanks in advance

Concerning

Published by: User_Apex on June 23, 2011 03:03

Published by: User_Apex on June 23, 2011 03:53
DECODE(SMTC_OTD_CHART.get_combined_bu_code(a.BU), 'PWR', 'POWER', SMTC_OTD_CHART.get_combined_bu_code(a.BU)) COMBINED_BU_CODE

Kind regards
Richard

-----
blog: http://blog.warp11.nl
Twitter: @rhjmartens
If you answer this question, please mark the thread as closed and give points where won...

Tags: Database

Similar Questions

  • Difference in the values of column MAX_SIZE and MAX_USED_SIZE in V$ SORT_SEGMENT

    Hello

    Anyone have an idea what is the difference between the value of the column MAX_SIZE and MAX_USED_SIZE to V$ SORT_SEGMENT?

    I checked in docs. The definition as:

    Taille_max Maximum NUMBER of extensions, never used

    Maximum number of MAX_USED_SIZE NUMBER of extensions used by all sorts

    I couldn't understand the difference by top definitaion.

    Thank you
    oratest

    My best guess is that MAX_SIZE is the total number of extensions that are used for any purpose, while MAX_SORT_SIZE is the total number of extensions already used for sorting.

    Consider that the temporary segments can be used for anything other than sorting. A temporary LOB of handling, storage medium for temporary tables, hash, fusion of bitmaps, etc., etc., are examples.

    Hope that helps,

    -Mark

  • dynamically change the value of a selection list in the form based on a table

    Hi friends,

    I use a form based on a table. I want to display two fields in the form of lists of selection instead of text boxes and when a value

    in a select list is selected, the corresponding values will be included in the next list of selection. For example if Department

    value is selected in a selection list that employees in this Department will be included in the employee selection list. I saw a

    even using ajax to achieve this as a table in the Dene example application [click here | http://apex.oracle.com/pls/otn/f?p=31517:176:462842537250908:NO].

    Is it possible to achieve the same for a form based on a table.

    Thank you
    TJ

    Hi TJ.

    Take a look on: [http://apex.oracle.com/pls/otn/f?p=56976:4] - instructions are on the page

    Andy

  • How to extract the values of column aliases based on different column values?

    Hello gurus,

    I have a table with the following struture-
    "drop table T;
    create table T(Name, Symbol, Amount,dep) as select
    'Anderia', 'AA', 1050000,'HR' from dual union all select
    'Michael', 'ML',150000,'Sales' from DUAL union all select
    'Bill', 'BL', 1050000,'Finance' from dual union all select
    'Nancy', 'NY', 4000,'HR' from DUAL union all select
    'Anderia', 'AA',3000,'HR' from dual union all select
    'Michael', 'ML',1050000,'Sales' from DUAL union all select
    'Bill', 'BL', 1200000,'Finance' from DUAL union all select
    'Anderia', 'AA', 1200000,'HR' from DUAL union all select
    'Vish', 'VH', 1200000,'Marketing' from DUAL;"
    And try to find the values of the column as
    Name, symbol, dep, amount, % Total, Total $Cumm, rank but some additional as-columns

    Amount HR, % HRTotal, $HR Cumm Total,
    Finance amount, FinanceTotal %, $Finance Cumm Total
    Sales amount, a percentage of Total sales, $Sales Cumm Total.
    Amount marketing, MarketingTotal %, $Marketing Cumm Total

    then I use the following query to retrieve the name, the symbol, the dep, amount, % Total, Total $Cumm, rank columns.
    select name
         , decode(grouping(symbol), 0, symbol, 'Total') symbol
         , dep
         , sum(amount) amount
         , sum(per_total) "% Total"
         , decode(grouping(symbol), 0, max(Cum_per_total), null) "% Cumm Total"
         , decode(grouping(symbol), 0, max(rank), null) rank
      from (
              select name
                   , symbol
                , dep
                   , amount
                   , per_total 
                   , sum(per_total) over(order by rk) cum_per_total
                   , rank
                   , rk
                from (     
                        select name
                             , symbol
                    , dep
                             , sum(amount) amount
                             , round((sum(amount)/max(total_amount)) * 100,2) per_total
                             , dense_rank () over (order by sum(amount) desc) as rank
                             , row_number() over(order by sum(amount) desc) as rk
                          from (
                                 select name
                                      , symbol
                                      , amount
                          , dep
                                      , sum(amount) over() total_amount 
                                      , sum(amount) over () 
                                   from t
                               )
                         group 
                            by name, symbol, dep
                    )
            )
      group         
         by grouping sets((name, symbol, dep), ())
      order by rank, max(rk) nulls last
    But I want to extract the following columns so... How can I do?

    Amount HR, % HRTotal, $HR Cumm Total,
    Finance amount, FinanceTotal %, $Finance Cumm Total
    Sales amount, a percentage of Total sales, $Sales Cumm Total.
    Amount marketing, MarketingTotal %, $Marketing Cumm Total


    as I want that all records, then will the dep..do-specific I need to use the case here?
    Thanks for all your time and effort in advance

    If I understand your needs, you need pivot: SQL and PL/SQL FAQ

  • Add the value of column based on a different line with the same id

    Hello world

    I have a query that displays the first three columns of the table below. I would like to add a column to this output, most indicating (for each row) if there is an electronic product in the same order. For example, the command 1 in the table below contains 1 unit of furniture and 1 unit of electronics. In my outings, I would add a flag 'Y' for the two rows 1 and 3. Also, I would add a "N" indicator to any order which does contain all the electronics.

    Any ideas on how to achieve this? Any idea or suggestion is appreciated!

    order_id product_cat quantity with_electronics
    1furniture1THERE
    2grocery1N
    1Electronics1THERE

    Thank you

    Zsolt

    Hi, Zsolt,

    You can also use analytical functions.  For example:

    SELECT order_id, product_cat, quantity

    MAX (CASE

    WHEN product_cat = 'electronics '.

    THEN 'Y '.

    ANOTHER "N".

    END

    ) OVER (PARTITION BY order_id) AS with_electronics

    Orders

    ;

    Of course, I can't test it without a table.

  • change the values to a string and return

    Hello
    I need help to find the best way to perform a trinsformation on a field.

    I got data such as:
     
    text;moretext;ir-baoc|notActive|notInduced-01;ir-baoc|notActive|notInduced-02;andmore
    ir-baoc|notActive|notInduced-01;ir-baoc|notActive|notInduced-02;andmore
    text;moretext;ir-baoc|notActive|notInduced-01;ir-baoc|notActive|notInduced-02
    ir-baoc|notActive|notInduced-01;ir-baoc|notActive|notInduced-02
    text;moretext;andmore
    I got this questioned:
    select 
      NVL(SUBSTR(REGEXP_SUBSTR(CONCAT(';',srv_code_lst),';ir-([^;]*)-01'),LENGTH(';ir-')+1,LENGTH(REGEXP_SUBSTR(CONCAT(';',srv_code_lst),';ir-([^;]*)-01'))-7), ' ') as A,
      NVL(SUBSTR(REGEXP_SUBSTR(CONCAT(';',srv_code_lst),';ir-([^;]*)-02'),LENGTH(';ir-')+1,LENGTH(REGEXP_SUBSTR(CONCAT(';',srv_code_lst),';ir-([^;]*)-02'))-7), ' ') as B
    from mysystem
    that return results as:
    "A","B"
    "boic|notActive|notInduced","boic|notActive|notInduced"
    "boic|Active|notInduced","boic|Active|notInduced"
    "boic|notActive|notInduced","boic|notActive|notInduced"
    "baoc|notActive|Induced","baoc|Active|Induced"
    "boic|notActive|notInduced","boic|notActive|Induced"
    I need to be like:
    "A","B"
    "boic-notActive","boic-notActive"
    "boic-Active","boic-Active"
    "boic-notActive","boic-notActive"
    "baoc-notActive","baoc-Active"
    "boic-notActive","boic-notActive"
    Can someone help me on this?
    I'll try to find a solution, but I have to do this transformation in 50 million lines and probably I won't find one with good performance!

    Thank you
    Ricardo Tomas
    SQL> with t as (
      2             select 'text;moretext;ir-baoc|notActive|notInduced-01;ir-baoc|notActive|notInduced-02;andmore' srv_code_lst from dual union all
      3             select 'ir-baoc|notActive|notInduced-01;ir-baoc|notActive|notInduced-02;andmore' from dual union all
      4             select 'text;moretext;ir-baoc|notActive|notInduced-01;ir-baoc|notActive|notInduced-02' from dual union all
      5             select 'ir-baoc|notActive|notInduced-01;ir-baoc|notActive|notInduced-02' from dual union all
      6             select 'text;moretext;andmore' from dual
      7            )
      8  SELECT  CASE ';' || srv_code_lst
      9            WHEN A THEN ' '
     10            ELSE A
     11          END A,
     12          CASE ';' || srv_code_lst
     13            WHEN B THEN ' '
     14            ELSE B
     15          END B
     16    FROM  (
     17           SELECT  srv_code_lst,
     18                   REGEXP_REPLACE(';' || srv_code_lst,';(.*;ir-)([^|]*)\|([^|]*)(\|.*|-01)','\2-\3') A,
     19                   REGEXP_REPLACE(';' || srv_code_lst,';(.*;ir-)([^|]*)\|([^|]*)(\|.*|-02)','\2-\3') B
     20             FROM  t
     21          )
     22  /
    
    A                              B
    ------------------------------ ------------------------------
    baoc-notActive                 baoc-notActive
    baoc-notActive                 baoc-notActive
    baoc-notActive                 baoc-notActive
    baoc-notActive                 baoc-notActive
    
    SQL> 
    

    SY.

  • Change the value in column (varchar) column value (date)

    Hello
    The requirement is as follows:
    table currently test
    ID (Number) review_name (varchar2 (10))
    December 1, 2007
    December 1, 2007
    December 1, 2007
    December 1, 2007
    December 2, 2005
    December 2, 2005
    December 2, 2005

    but the test of the table should be
    ID (Number) review_start_date (date)
    1-1 DECEMBER 2007
    1-1 DECEMBER 2007
    1-1 DECEMBER 2007
    1-1 DECEMBER 2007
    2 1 DECEMBER 2005
    2 1 DECEMBER 2005
    2 1 DECEMBER 2005

    THIS means that rename the column of review_name (varchar2 (10)) review_start_date (date)...

    That's a lot for the help in advance boyfriend...

    Published by: user11116232 on April 29, 2009 03:34

    You are welcome, but perhaps if you check the answer that correct others will know it works too ;-)

  • When there are several tabs open, why the search always take place on the 2nd tab (first tab seems never to change the homepage) despite my selection of a different tab where to do a search on google?

    I have Mozilla Firefox 10.0. When I open it, it opens properly on the homepage in the first tab. Once I have another, or several, tabs opened, any tab is active, your google searches, I immediately takes place at the No. 2. Do not count how many times I go to the tab for example 4 to search (because I would compare with the page Web open in a tab 2), but it does still today the Search tab 2. It's very irritating. It must be a setting that went pear-shaped, but where / who? Any suggestions? Thank you.

    Try Firefox SafeMode to see how it works there.

    A way of solving problems, which disables most of the modules.

    (If you use it, switch to the default theme).

    • You can open the mode without failure of Firefox 4.0 + by pressing the SHIFT key when you use the desktop Firefox or shortcut in the start menu.
    • Or use the Help menu option, click restart with the disabled... modules while Firefox is running.

    Do not choose anything at the moment, just use 'continue in safe mode.

    To exit safe mode of Firefox, simply close Firefox and wait a few seconds before using the shortcut of Firefox (without the Shift key) to open it again.

    If it's good in Firefox Safe mode, your problem is probably caused by an extension, and you need to understand that one.

    http://support.Mozilla.com/en-us/KB/troubleshooting+extensions+and+themes

    When find you what is causing that, please let us know. It might help others who have this problem.

  • change the color of line based on the value of column 5 Apex in the classic report

    Version of the apex 5.0.0.00.31

    Standard universal theme

    Page theme default template

    Classic report

    Foldable report template

    Hello

    I know this question has been asked several times here, but I'm working on 5 Apex and need to know the correct way to do it in this version.

    I need to change the color of the text of the entire line (no background color) based on the value in one of the columns of the classic report. I have just two conditions, if the value of column = Yes, color should be red, otherwise it must be green.

    I am new to jscript and css, so appreciate if someone can tell me the solution with steps.

    I have already checked this link that changes the value of the column, need to do something similar to the whole line.

    https://tylermuth.WordPress.com/2007/12/01/conditional-column-formatting-in-apex/

    Hi coolmaddy007-Oracle,.

    Here's an example set up on the apex.oracle.com according to the specifications you gave: https://apex.oracle.com/pls/apex/f?p=35467:1

    Version of the apex 5.0.0.00.31

    Standard universal theme

    Page theme default template

    Classic report

    Foldable report template

    Here is how it is done:

    Create a dynamic action with the following specifications:

    Name: Give the appropriate name

    Event: After refresh

    Selection type: region

    Region: select your region classic report

    Condition: No strings attached

    Action: Run the JavaScript Code

    Fire on loading the Page: Yes

    Code:

    $('td[headers="JOB"]').each(function() {
      if ( $(this).text() === 'MANAGER' ) {
        $(this).closest('tr').find('td').css({"color":"red"});
      }
      if ( $(this).text() === 'SALESMAN' ) {
        $(this).closest('tr').find('td').css({"color":"green"});
      }
      if ( $(this).text() === 'CLERK' ) {
        $(this).closest('tr').find('td').css({"color":"blue"});
      }
    });
    

    NOTE: Download the selector appropriate for your knowledge $('td[headers="JOB"]') case using firebug/browser development tools.

    Items concerned: leave blank.

    PS: Changed the example to change the color of text instead of the background color.

    I hope this helps!

    Kind regards

    Kiran

  • Interactive report - out has changed the value of the column selectlist

    Hello

    I try to use a selectlist in an interactive report. I used "APEX_ITEM. SELECT_LIST' for this. My interactive report request is

    SELECT APEX_ITEM.checkbox (1, CUSTOMER_ID, NULL, NULL, 'onclick = "javascript:setvalue (this.value)" ') as "-",

    CUST_FIRST_NAME,

    CUST_LAST_NAME,

    APEX_ITEM. SELECT_LIST)

    p_idx = > 2,

    p_value = > TEST.

    p_list_values = > ' Y; Y, N; NO

    ) 'test' for DEMO_CUSTOMERS

    I had a "Override" button on the page. I try to get the modified values (for the field "test") and the customer ID selected as a semicolon-separated list just by clicking on the ignore"" button. The process code on submit is

    : P8_TEST_VALUE: = NULL;

    BECAUSE me in 1... APEX_APPLICATION. G_F01. COUNTING LOOP

    : P8_TEST_VALUE: =: P8_TEST_VALUE | « ; » || APEX_APPLICATION. G_F01 (i) | APEX_APPLICATION. G_F02 (i);

    END LOOP;

    But I still get the data value, not the value for column 'test '.

    For example if I'm changing the value of "N" to 'Y' after selecting the checkbox (client code corresponds to "6") and click on 'Ignore' button. I get the value '; 6n 'instead of '; 6Y'. is it possible that I can get the value of seelectlist has changed?.

    Thank you

    JJ

    Your problem is in the values of the selection list. The element is not sent to use in PL/SQL, best way to do it is with jQuery

    try adding this to your report:

    SELECT APEX_ITEM.checkbox (1, CUSTOMER_ID, NULL, NULL, 'onclick = "javascript:setvalue (this.value)" ') as "-",

    CUST_FIRST_NAME,

    CUST_LAST_NAME,

    APEX_ITEM. SELECT_LIST)

    p_idx-online 2

    p_item_id => CUSTOMER_ID,

    p_value => TEST,

    p_list_values => ' Y; Y, N; NO

    ) 'test' for DEMO_CUSTOMERS

    and to add actions to the lick... button or other trigger.

    $x("P8_TEST_VALUE").value ="";

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

    {var val = $("select [id ='" + $(this) .val () + "']") .val ();}

    $x("P8_TEST_VALUE").value = $x ("P8_TEST_VALUE") .value + $(this) .val () + val + ";". " » ;

    });

    Hope that this post will be useful for you.
    Andrej Grlica

  • Change the value of the playlists selection to another selection list value

    Hi friends,

    I have a column select list(Yes/No) in an interactive report that has a default value as No.
    This interactive report realized extraction thousand lines.
    Users will check a batch of records and change the value of the selection to Yes and submit.
    They do the same process with the next Recordset.

    To remedy this, starting by selecting each selection list Yes in report users want a mass update selection list for Yes and no.
    Here's an example of what I meant: https://apex.appshosting.com/pls/apex/f?p=898:1:4477178916616585:

    Anyone can throw some light on this issue?

    Thank you very much.
    Raj.

    Raj:

    Edit and add this javascript in your page

    
    
    
    For the 'Html Attributes' of the 'Mass Update' select list specify
    
      onChange='doStuff(this)'
    
    Varad                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
    
  • Change the default setting for "record and column headings display.

    Is there a way to change the value of dafault for table 'Folder and column headers display' property for ' as lines separate.

    Need this setting at the default for all new tables/analysis in OBIEE 11.1.1.7

    BR

    Morten

    We did some of this 'default piracy' at the beginning of 11g, but this option for example is nested too deeply in the bowels of OBIEE, so I wouldn't try (it will be a waste of time because it won't work).

  • "All the values in column" change in the dash prompt

    In OBIEE 11 g, how to change the dashboard prompt label everything value? I don't want to change the value in the XML file, because it will prompt value impact all the dashboard.
    This is there best method to implement this problem?

    For example:
    In prompt dashboard-> edit-> options-> check ' include "All values in the column" in the list ", so I can display value"(toutes les valeurs de colonne) ' in the command prompt. " Customers want to change this value, such as 'all values '. Is this possible? Thank you.

    Hello

    Can do this by using Union All is prompt, SQL and variable presentation in the report.

    Reference: http://www.varanasisaichand.com/2010/01/editing-all-choices-in-dashboard.html

    Kind regards
    Srikanth

  • How to change the values of a from the values selected in another LOV LOV

    Hello

    I have a requirement in the ADF where there are two LOVs. The values in the second LOV based on the values that I selected in the 1st LOV should change dynamically.
    In addition, the 1st LOV accepts 3 values for each value that I select, a different query is executed to fill the 2nd LOV.
    I have a gross thought I can use 3 different read only view objects containing these 3 queries. And according to the value that I select in the 1st LOV I can run the object matching the view of the bean to support. But my doubt is how to link the results of this query that is executed to fill the 2nd LOV.

    Thanks in advance.

    Published by: 886591 on September 21, 2011 04:48

    Kouadio,

    All your queries based on the table? If Yes, you can use a variable binding for the lov attribute relative to the query to run on the LOV child.

    If they are based on different tables, you can create 3 different lovs for the child attribute and select what lov seem based on the parent attribute.

    Here are a few examples.

    http://andrejusb.blogspot.com/2011/03/ADF-BC-dependent-lov-11g-ps2ps3-bug-and.html

    http://andrejusb.blogspot.com/2008/12/Groovy-multiple-lovs-per-attribute-in.html

    Arun-

  • changing the value of text within a column of a PivotTable

    Hi people,

    I get great help from this forum and I am very frequently. This time, I have a question about Tables, how to manipulate fields in a table using JavaScript. The requirement is as follows, I have a Table (100rows x 3columns), and few of them are hidden in the page layout. The first column contains the values of text such as sequential numbers, (the first column is visual index, 1, 2, 3... 100). now, I'm trying to write a script that replaces or substitutes the first column values in the text areas of space. Can you guys help out me if you do a script? or give me some resources where I can manipulate the fields from the table using JavaScript?

    Thanks in advance.

    Hello

    It seems that the table is static and will always three rows during execution. In other words, the user cannot add more lines. If this correct?

    You need not resolve the nodes in this case, because you are referencing fields and specific lines.

    Because the script is located in the square, which is in the same container as the table, the following would erase the contents of the fields in the second column:

    Table1.Row1[1].TextField3.rawValue = null;
    

    Your script accesses an object in the second row called Cell1. This seems to be a text object has no property .rawValue If you want to change the value at run time, you will need to change this to a TextField object.

    In addition, looks like that is not an object in the second row (Row1 [1]) called "Cell1". It seems that the first object is unnamed. This will also cause the script to fail. When debugging, it is useful to use the JavaScript Console to see the (control + J) errors when previewing the form or in Acrobat.

    Who help me?

    Niall

Maybe you are looking for