How to refer a column value of a single row in conditional column display?

Hello,
does anybody have an idea, how i can refer a column value of a single row in conditional display of a column?
So my idea is, that a report has a column, which value is only displayed, when another column value of this row has a specific value.
I want to solve this problem with condition type: PL/SQL Function Body returning a boolean.
But I do not know how to refer the column value of each single row!
Thank you,
Tim

Here's a solution that, to me, seems easier to implement but, that's, of course, in the eye of the implementer.
Rather than using APEX to generate a link column for you, actually create the link as part of your SQL.
select '<a href="f?p=102:3:491847682940364::::P3_CONTACT_ID:' || CONTACT_ID || "><img src="/i/themes/theme_1/ed-item.gif" alt="Edit"></a>' CONTACT_LINK, ...
etc.
Test this out. You'll see that it works just like making a column a link using the column attributes.
Next, we'll change the SQL to use a DECODE statement to either display the link or nothing depending on what your criteria is. For example, let's assume you only want a link for active contacts.
select Decode( CONTACT_STATUS, 'A', '<a href="f?p=102:3:491847682940364::::P3_CONTACT_ID:' || CONTACT_ID || "><img src="/i/themes/theme_1/ed-item.gif" alt="Edit"></a>', NULL ) CONTACT_LINK, ...
etc.
This will not display the link in any rows in which the CONTACT_STATUS is not active, i.e. "A"
-Joe

Similar Messages

  • ADF: How to get the attributes' values of one single row from a table?

    Currently I have a table with 3 attributes, suppose A,B and C respectively. And I've added an selectionListener to this table. That means when I select one single row of this table, I wish to get the respective value of A, B and C for that particular row. How do I achieve this?
    suppose the method is like:
    public void selectionRow(SelectionEvent se) {            //se is the mouse selection event
    .......??? //what should I do to get the values of A\B\C for one single row?
    Edited by: user12635428 on Mar 23, 2010 1:40 AM

    Hi
    Assuming you are using Jdev 11g.
    Try with this
    public void selectionRow(SelectionEvent se) {
    String val = getManagedBeanValue("bindings.AttributeName.inputValue");
    public static Object getManagedBeanValue(String beanName) {
    StringBuffer buff = new StringBuffer("#{");
    buff.append(beanName);
    buff.append("}");
    return resolveExpression(buff.toString());
    public static Object resolveExpression(String expression) {
    FacesContext facesContext = getFacesContext();
    Application app = facesContext.getApplication();
    ExpressionFactory elFactory = app.getExpressionFactory();
    ELContext elContext = facesContext.getELContext();
    ValueExpression valueExp =
    elFactory.createValueExpression(elContext, expression,
    Object.class);
    return valueExp.getValue(elContext);
    Vikram

  • How to convert multiple string values in a single row from nvarchar to int

    suppose I have a table like below.all these values are in nvarchar. How would I find the minimum year from START_DATE??
    PRODUCT_CODE 
    PRODUCT_DESC
    START_DATE
    P00002933
    VITAMINE C
    2005,2000,2011,2001,2002
    P00003087
    BIOFENAC
    2011,2009,2006,2007,2004,2005
    P00000155
    AMOXYPEN
    2006,2007,2008,2009,0000,2001
    P00002325
    SAHHA FARINE
    2008,2003,2002,2001,2009
    P00005666
    AMOXYPEN
    2007,2008,2006,2009,0000,2001

    Create the split function:
    CREATE FUNCTION Split (
    @InputString VARCHAR(8000),
    @Delimiter VARCHAR(50)
    RETURNS @Items TABLE (
    Item VARCHAR(8000)
    AS
    BEGIN
    IF @Delimiter = ' '
    BEGIN
    SET @Delimiter = ','
    SET @InputString = REPLACE(@InputString, ' ', @Delimiter)
    END
    IF (@Delimiter IS NULL OR @Delimiter = '')
    SET @Delimiter = ','
    --INSERT INTO @Items VALUES (@Delimiter) -- Diagnostic
    --INSERT INTO @Items VALUES (@InputString) -- Diagnostic
    DECLARE @Item VARCHAR(8000)
    DECLARE @ItemList VARCHAR(8000)
    DECLARE @DelimIndex INT
    SET @ItemList = @InputString
    SET @DelimIndex = CHARINDEX(@Delimiter, @ItemList, 0)
    WHILE (@DelimIndex != 0)
    BEGIN
    SET @Item = SUBSTRING(@ItemList, 0, @DelimIndex)
    INSERT INTO @Items VALUES (@Item)
    -- Set @ItemList = @ItemList minus one less item
    SET @ItemList = SUBSTRING(@ItemList, @DelimIndex+1, LEN(@ItemList)-@DelimIndex)
    SET @DelimIndex = CHARINDEX(@Delimiter, @ItemList, 0)
    END -- End WHILE
    IF @Item IS NOT NULL -- At least one delimiter was encountered in @InputString
    BEGIN
    SET @Item = @ItemList
    INSERT INTO @Items VALUES (@Item)
    END
    -- No delimiters were encountered in @InputString, so just return @InputString
    ELSE INSERT INTO @Items VALUES (@InputString)
    RETURN
    END -- End Function
    GO
    Use the below script:
    create table Table1 (Product_Code varchar(50),Product_Desc varchar(10),sStart_date varchar(MAX))
    Insert into Table1 Values('P00002933','VITAMINE C','2005,2000,2011,2001,2002'),
    ('P00003087','BIOFENAC','2011,2009,2006,2007,2004,2005')
    Select Product_Code,Product_Desc ,MIN(Item) Minstart_date
    From Table1 A
    Cross apply Split(A.sStart_date,',') B
    Group by Product_Code,Product_Desc
    Drop table Table1

  • Get the column values in a single row seperated by commas

    Hi
    i have two tables project_baseline and project_resource which have the foreign key project_id from the base table project_details. Now iam trying to retrieve data from these tables using the below query :
    select distinct b.TASK_NAME,r.RESOURCE_NAME,() from project_baseline b inner join project_resource r on R.PROJECT_ID=B.PROJECT_ID group by b.TASK_NAME,r.RESOURCE_NAME
    Below is the output snippet :
    TASK_NAME RESOURCE_NAME
    TEST DESIGN PARAGI M
    TEST DESIGN RAJAN M S
    TEST EXECUTION VIBHU ARMA
    TEST EXECUTION PRATHAB GARG
    TEST EXECUTION NAGABHUSHAN G K
    TEST DATA PREPARATION RAJAN M S
    TEST DATA PREPARATION SHIVA MARAN
    TEST CASE REWORK VISWAN RAM
    TEST CASE REVIEW NAGABHUSHAN G K
    REGRESSION SANGEET
    PROJECT SUPPORT VIBHU ARMA
    PROJECT SUPPORT PRATHAB GARG
    PROJECT SUPPORT PARAGI M
    PROJECT SUPPORT NAGABHUSHAN G K
    PROJECT SUPPORT SANGEET
    PROJECT CLOSURE PRATHAB GARG
    i need to get the resource_names in a single row seperated by comma for a single task like following:
    TASK_NAME RESOURCE_NAME
    PROJECT SUPPORT VIBHU ARMA,PRATHAB GARG,PARAGI M,NAGABHUSHAN G K,SANGEET
    Could anyone please help me to get the query for the above formated output?
    Thanks in advance
    Meera
    Edited by: 928378 on May 22, 2012 5:20 AM

    Hi,
    It can be done using xmlagg function.
    For Example :
    Table Data..
    DEPTNO     ENAME
    20     WARD Tree
    23     Shank
    30     BLAKE
    10     MILLER
    30     MARTIN
    10     CLARK
    20     SCOTT
    30     TURNER
    20     ADAMS
    30     JAMES
    20     FORD
    30     BLAKE
    Query:
    SELECT deptno,
    RTRIM (XMLAGG (XMLELEMENT (e, ename || ',')).EXTRACT ('//text()'),
    ) NAME
    FROM emp
    GROUP BY deptno;
    Output :
    DEPTNO     NAME
    10     MILLER,CLARK
    20     WARD Tree,FORD,ADAMS,SCOTT
    23     Shank
    30     BLAKE,TURNER,BLAKE,JAMES,MARTIN
    Thanks,
    Shankar
    Thanks,
    Shankar.

  • How to store all the columns values into one single column

    Hi All,
    this is my file layout,i am receiving the data in below format only
    emp_no,c1,c2,c3,c4,c5
    100 ,1 ,0 ,1 ,0,1
    200 ,1 ,0 ,1 ,0,1
    300 ,1 ,0 ,1 ,0,1
    but i want to store that above data into my table like(from c1 to c5 columns values i want to store in period column)
    emp_no,period
    100 ,1
    100 ,0
    100 ,1
    100 ,0
    100 ,1
    200 ,1
    200 ,0
    200 ,1
    200 ,0
    200 ,1
    300 ,1
    300 ,0
    300 ,1
    300 ,0
    300 ,1
    please help me

    Strange but this is it
    Processing ...
    with original as (
         select 100 as id ,1 as v1,0 as v2,1 as v3,0 as v4,1 as v5
         from dual
         union all
         select 200 ,1 ,0 ,1 ,0,1
         from dual
         union all
         select 300 ,1 ,0 ,1 ,0,1
         from dual
    select id,v1 as res_row
    from original
    union all
    select id,v2
    from original
    union all
         select id,v3
         from original
    union all
         select id,v4
         from original
    union all
         select id,v5
         from original
                      ID                                   RES_ROW
                                       100                                      1
                                       200                                      1
                                       300                                      1
                                       100                                      0
                                       200                                      0
                                       300                                      0
                                       100                                      1
                                       200                                      1
                                       300                                      1
                                       100                                      0
                                       200                                      0
                                       300                                      0
                                       100                                      1
                                       200                                      1
                                       300                                      1
    15 row(s) retrievedBye Alessandro

  • How to get the maximum/largest value in a single row?

    I have a simple Pivot table view with dollars as the measure, months on the columns and accounts on the rows.  I want to highlight the month that had the largest value.  E.g. so if the dollar values for account Revenue are 10 for Jan, 11 for Feb, 50 for Mar and 0 for the rest of the months, then I want to highlight the cell with 50 green. So essentially I need to be able to identify the max value in a row in the pivot table. 
    If I add a max calculation, it returns the top value across all columns and rows. A Rank calculation also returns rankings across all columns and rows. How can I determine the largest value in a single row?
    Thanks
    J

    In general you have to go by level based measures. Just tweak it as max(revenue by Year)
    Just do it in Criteria tab and see how it works and I thing rest you know how to do

  • Better approach for checking column values between two different rows

    My requirement is to find best Approach to find difference between column values of two different rows.Below I've mentioned two different
    approaches I'm thinking of,but I'd like to know is there any other better approach.
    version details
    SQL> SELECT *
      2  FROM V$VERSION;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE    11.1.0.7.0      Production
    TNS for Solaris: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - ProductionTable creation script
    CREATE TABLE R_DUMMY
       (CA_ID VARCHAR2(16) NOT NULL ENABLE,
         CA_VER_NUM NUMBER(4,2) NOT NULL ENABLE,
         BRWR_SHORT_NAME VARCHAR2(25 CHAR),
         sic_code     number,
         FAC_ID VARCHAR2(10) NOT NULL ENABLE
    / insert script
    insert into r_dummy (CA_ID, CA_VER_NUM, BRWR_SHORT_NAME, sic_code, FAC_ID)
    values ('CA2001/11/0002', 2.00, 'Nandu',1234, 'FA000008');
    insert into r_dummy (CA_ID, CA_VER_NUM, BRWR_SHORT_NAME, sic_code, FAC_ID)
    values ('CA2001/11/0002', 3.00, 'SHIJU',456, 'FA000008');Desired O/P :
    ca_id               fac_id          column_name          previous name          after_modification
    CA2001/11/0002          FA000008     BRWR_SHORT_NAME          Nandu               SHIJU
    CA2001/11/0002          FA000008     sic_code          1234               456My approach
    select      ca_id,fac_id,column_name,
         decode(column_name,'BRWR_SHORT_NAME',lg_brwr,lg_sic) previous_name ,
         decode(column_name,'BRWR_SHORT_NAME',ld_brwr,ld_sic) after_modification
    from
         select
                   case
                        when ld_brwr != lg_brwr then
                        'BRWR_SHORT_NAME'
                        when ld_brwr != lg_brwr then
                        'sic_code'
                   end
              ) column_name,ca_id,fac_id,lg_brwr,ld_brwr,ld_sic,lg_sic
         from     (
              select ca_id,fac_id,lag_brwr,ld_brwr,ld_sic,lag_sic
              from
                        Select      lead(brwr_short_name,1) over(partition by ca_id,fac_id) ld_brwr,
                             lag(brwr_short_name,1) over(partition by ca_id,fac_id) lg_brwr,
                             lead(sic_code,1) over(partition by ca_id,fac_id) ld_sic,
                             lag(sic_code,1) over(partition by ca_id,fac_id) lg_sic,
                             ca_id,fac_id
                        from r_dummy
              where (ld_brwr != lg_brwr or ld_sic != lg_sic)
    )2nd Approach :
    =============
    select      ca_id,fac_id,column_name,
         decode(column_name,'BRWR_SHORT_NAME',lg_brwr,lg_sic) previous_name ,
         decode(column_name,'BRWR_SHORT_NAME',ld_brwr,ld_sic) after_modification
    from
         select
                   case
                        when ld_brwr != lg_brwr then
                        'BRWR_SHORT_NAME'
                        when ld_brwr != lg_brwr then
                        'sic_code'
                   end
              ) column_name,ca_id,fac_id,lg_brwr,ld_brwr,ld_sic,lg_sic
         from     (
              select ca_id,fac_id,brwr_short_name,sic_code
              from
                        Select      ca_id,fac_id,brwr_short_name lg_brwr,sic_code lg_sic
                        from     r_dummy
                        where     ca_ver_num = '2.00'
                   )o,(
                        Select      ca_id,fac_id,brwr_short_name ld_brwr,sic_code ld_sic
                        from     r_dummy
                        where     ca_ver_num = '3.00'
                              )n
              where      0.ca_id = n.ca_id
                   and 0.fac_id = n.fac_id
                   and (ld_brwr != lg_brwr or ld_sic != lg_sic)
    )Hi Experts,
         I've provided sample data where I'm checking for just two columns viz brwr_short_name ,sic_code,but in real time
    I've to check for 8 more columns so please suggest me with a better approach.
    I appreciate your precious suggestions.

    Hi,
    Thanks for posting the CREATE TABLE and INSERT statements; that really helps!
    Here's one wa. Like your 2nd approach, this uses a self-join:
    WITH     got_r_num     AS
         SELECT  ca_id
         ,     ROW_NUMBER () OVER ( PARTITION BY  ca_id
                                   ,                    fac_id
                             ORDER BY        ca_ver_num
                                 )    AS r_num
         ,     brwr_short_name
         ,     TO_CHAR (sic_code)     AS sic_code
         ,     fac_id
    --     ,     ...     -- Other columns (using TO_CHAR if needed)
         FROM     r_dummy
    ,     unpivoted_data     AS
         SELECT     *
         FROM     got_r_num
         UNPIVOT     INCLUDE NULLS
              (    txt
              FOR  column_name IN ( brwr_short_name          AS 'BRWR_SHORT_NAME'
                            , sic_code               AS 'SIC_CODE'
    --                        , ...     -- Other columns
    SELECT       p.ca_id
    ,       p.fac_id
    ,       p.column_name
    ,       p.txt          AS previous_name
    ,       a.txt          AS after_modification
    FROM       unpivoted_data   p
    JOIN       unpivoted_data   a  ON  p.ca_id     = a.ca_id
                           AND p.fac_id     = a.fac_id
                         AND p.column_name     = a.column_name
                         AND p.r_num      = a.r_num - 1
                         AND p.txt || 'X' != a.txt || 'X'
    ORDER BY  a.r_num
    ;To include other columns, add them in the 2 places where I put the comment "Other columns".
    Ca_ver_num can have any values, not just 2.00 and 3.00.
    This will show cases where a value in one of the columns changed to NULL, or where NULL changed to a value.
    There ought to be a way to do this without a separate sub-query like got_r_num. According to the SQL Language manual, you can put expressions in the UPIVOT ... IN list, but when I tried
    ...     UNPIVOT     INCLUDE NULLS
              (    txt
              FOR  column_name IN ( brwr_short_name          AS 'BRWR_SHORT_NAME'
                                 , TO_CHAR (sic_code)     AS 'SIC_CODE'
              )I got the error "ORA_00917: missing comma" right after TO_CHAR. Perhaps someone else can show how to eliminate one of the sub-queries.

  • How can I get the values of the selected row in the report?

    Hi All:
    I have a dynamic query(lexical parameters)that columns are selected at the run time. And depend on the values, I'd like to do another query just for certain row. For example, when I double click on the fifth column of the fifth row. I'd like to collect all the column values of this fifth row. I think It likes drill-down report, but I don't need a detail report. I just want a string of the combination column's values. Would you please help?
    Thanks, in advances, for your help.
    TD

    Hi:
    I got it.
    Thx,
    TD

  • How to Print the same field value in a single row

    Hi,
    I need to print the same field values in a single row
    For Examble
    in a table TestTable
    ID Name Value
    1 AB 120
    1 BC 150
    1 CD 130
    2 AB 111
    2 BC 112
    2 CD 113
    I need the query like if the Name contains BC and CD then i need to print like ID, BC Value, CD Value as below
    ID BC'Value CD'Value
    1 150 130
    2 112 113
    Kindly suggest me...
    Thanks in Advance
    Anu

    Hi,
    Since you're on 9i some available functionality unfortunatly isn't at your disposal.
    This should work, however, using your sample data:
    MHO%xe> create table t as ( -- generating sample data:
      2  select 1 cid, 'AB' cname, 120 cvalue from dual union all
      3  select 1, 'BC', 150 from dual union all
      4  select 1, 'CD', 130 from dual union all
      5  select 2, 'AB', 111 from dual union all
      6  select 2, 'BC', 112 from dual union all
      7  select 2, 'CD', 113 from dual
      8  );
    Tabel is aangemaakt.
    MHO%xe> select cid
      2  ,      max(decode(cname, 'BC', cvalue, null)) BC_value
      3  ,      max(decode(cname, 'CD', cvalue, null)) CD_value
      4  from   t
      5  group by cid;
           CID   BC_VALUE   CD_VALUE
             1        150        130
             2        112        113For reference and future challenges, see:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:419593546543
    http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php

  • How to change the background color of a single row

    Hi OTN,
    I am using JDeveloper 11.1.1.2 with ADF faces in view layer.My issue is How to change the background color of a single row in af:table ?.

    How to highlight ADF table row based on column value?
    Found by searching

  • Merge multiple rows into single row (but multiple columns)

    How to merge multiple rows into single row (but multiple columns) efficiently.
    For example
    IDVal IDDesc IdNum Id_Information_Type Attribute_1 Attribute_2 Attribute_3 Attribute_4 Attribute_5
    23 asdc 1 Location USA NM ABQ Four Seasons 87106
    23 asdc 1 Stats 2300 91.7 8.2 85432
    23 asdc 1 Audit 1996 June 17 1200
    65 affc 2 Location USA TX AUS Hilton 92305
    65 affc 2 Stats 5510 42.7 46 9999
    65 affc 2 Audit 1996 July 172 1100
    where different attributes mean different thing for each Information_type.
    For example for Information_Type=Location
    Attribute_1 means Country
    Attribute_2 means State and so on.
    For example for Information_Type=Stats
    Attribute_1 means Population
    Attribute_2 means American Ethnicity percentage and so on.
    I want to create a view that shows like below:
    IDVal IDDesc IDNum Country State City Hotel ZipCode Population American% Other% Area Audit Year AuditMonth Audit Type AuditTime
    23 asdc 1 USA NM ABQ FourSeasons 87106 2300 91.7 46 85432 1996 June 17 1200
    65 affc 2 USA TX AUS Hilton 92305 5510 42.7 46 9999 1996 July 172 1100
    Thanks

    Hi,
    That's called Pivoting . The forum FAQ has a section on this subject: {message:id=9360005}
    I hope this answers your question.
    If not, post your best attempt, along with a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data. (You did post the results you wanted, but they're very hard to read because they're not formatted. Use \ tags, as described in the forum FAQ, below.)
    Explain, using specific examples, how you get the results you want from the data given.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).  This is always important, but especially so with pivots.
    See the forum FAQ {message:id=9360002}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to get column value of a selected row of ALV

    Hello ,
    I have application POWL POWL_UI_COMP uses  another component  POWL_TABLE_COMP.
    This POWL_TABLE_COMP uses SALV_WD_TABLE.
    I want to select value of ORDER id and it need to be passed whenever user selects a display order button(Which is self defined function generated in POWL_TABLE_COMP) . I am calling a display order on action of this display button(http://nap60.nalco.one.net:8042/sap/bc/webdynpro/sap/mt_order_app?IV_ACTIVITYTYPE=A&IV_EQUIPMENT=aaaa&IV_ORDERID=90001511&IV_ORDERTYPE=STD&IV_QMNUM=00&IV_TPLNR=00)
    ORDERID is one column value of selected row of ALV table.
    So please can you suggest , how to read ORDERID and pass it to the self defined function..
    thanks in advance,
    Sharada

    Anoop,
    I have plcaed this code in event handler of  on_lead_select.
    Its giving error  the element doesnt exist. 
    static_attributes should give me row data but it's giving short dump saying
    Pl can you suggest.
    data:   set_of_element type WDR_CONTEXT_ELEMENT_SET,
            element1 type ref to IF_WD_CONTEXT_ELEMENT,
            result type POWL_CRESULT_STY,
            table_helper type ref to CL_POWL_TABLE_HELPER,
          context_node type ref to IF_WD_CONTEXT_NODE,
           lt_selected_elements TYPE wdr_context_element_set,
           static_attributes type ref to data.
      table_helper = wd_comp_controller->mr_table_helper.
      context_node = table_helper->get_data_node( ).
      context_node = wd_comp_controller->mr_table_helper->get_data_node( ).
      context_node->get_static_attributes( exporting index = r_param->index
                                          importing static_attributes = static_attributes ).
    thanks,
    Sharada

  • How to insert column values into database as rows

    Hi,
    I have 8 columns and some not null columns. Based on not null columns I want to insert into table as rows. The 8 columns may contain values or no value. If the first column contains data, then I have to insert into one row. if the second column contains data I have to insert a row and in second column. respectively...So How can I insert column values into rows. Can I write 8 insert statements. (OR) is it possible to insert data from columns using where clause.
    Please help me out....
    Thanks in Advance

    Lines Table:
    line_id, orcl_bank_account_num, product_type, service_type, lease_type,
    funding_type, cpi, billing_frequency_unit_cd , annual_due_date ,
    pricing_start_date, pricing_end_date, install_date, contract_end_date ,
    prdct_replacement_cost_amt, cradle_replacement_amt, supranet_contract,
    issuance_fee, board_inactive_date, header_id, creation_date, last_modified_date,
    created_by_nam, modified_by_nam, activeinactive_flg, prdct_bill_amt_yr1,
    prdct_bill_amt_yr2, prdct_bill_amt_yr3, prdct_bill_amt_yr4, prdct_bill_amt_yr5,
    prdct_bill_amt_yr6, prdct_bill_amt_yr7, prdct_bill_amt_yr8, activation_fee_yr1,
    activation_fee_yr2, activation_fee_yr3, activation_fee_yr4, activation_fee_yr5,
    activation_fee_yr6, activation_fee_yr7, activation_fee_yr8,
    In this table the columns structure is :
    -- PRDCT_BILL_AMT_YR (1 to 8) NUMBER(14,4)
    -- ACTIVATION_FEE_YR (1 to 8) NUMBER(8,2)
    I have one more table:
    PRDCT_INS_AMT               NUMBER(14,4)
    ACTIVATION_FEE_AMT          NUMBER(14,4)
    I want to insert prdct_bill_amt_yr (1 to 8) columns data into PRDCT_INS_AMT column. similarly activation_fee (1 to 8) columns data.
    But the data should be inserted based product_type, service_type, lease_type columns values. (These 3 columns may contain upto 45 combinations).

  • To get the count of records and able to access the column value in a single

    Hi
    Is there any way to get the number of records in the query and access the column values
    e.g
    select count(*)
    from
    (SELECT department, COUNT(*) as "Number of employees"
    FROM employees
    WHERE salary > 25000
    GROUP BY department ) a
    This wil only get the Count, if i want to access each row from the inline view how can i do that.

    Your question is not clear.
    Are you looking for total record count as well as count by department ?
    Something like this?
    SQL>
    SQL> with temp as
      2  (
      3  select 1 dept ,10000 sal from dual union
      4  select 1 dept ,25100 sal from dual union
      5  select 1 dept ,30000 sal from dual union
      6  select 1 dept ,40000 sal from dual union
      7  select 2 dept ,10000 sal from dual union
      8  select 2 dept ,25100 sal from dual union
      9  select 2 dept ,30000 sal from dual union
    10  select 2 dept ,40000 sal from dual )
    11  select count(*) over( partition by 1 ) total_count,dept,
    12  count(*) over(partition by dept) dept_cnt  from temp
    13  where sal>25000;
    TOTAL_COUNT       DEPT   DEPT_CNT
              6          1          3
              6          1          3
              6          1          3
              6          2          3
              6          2          3
              6          2          3
    6 rows selected
    SQL>

  • How do I set the value of a dynamic row text field

    I have a repeated row form which contains a button and multiple text fields.  There is a text field (Input Data Field) further up with some information I want to place in the table and multiple buttons that I want to read the value of and set to the table.  I apologize there are multiple questions I have and I am using pseudocode to describe it.
    Top form looks like
    InputField
    | ButtonX1 | ButtonY1 | DescriptionX1 (read only Text Field)
    | ButtonXn | ButtonY1 | DescriptionXn
    OutputRow looks like
    | ButtonOutput | OutputField1 | OutputField2 | OutputField3 |
    So I would like it to do
    ButtonX1.click
    OutputTable.OutputRow.addInstance(true)  //this works - everything else I have questions on
    OutputTable.OutputRow.OutputField1.rawValue = DescriptionX1.rawValue
    Question 1
    How do I address the location in each table to set a value
    Question 2
    How do I get the value of the description field in the same table and row as the button
    I would like to say something to the effect of  OutputTable.OutputRow[??].OutputField1.rawValue = this.parent.DescriptionX
    OutputTable.OutputRow.OutputField2 = InputField.rawValue
      Same question as above - how do I specify a dynamic row - is this the proper syntax for getting the value from the input field?
    OutputTable.OutputRow.OutputField3 = this.ButtonLabel
    Question 3
      How can I get the value of the button's label to set in the field
      There should be very many of these buttons and buttons will be added - I would prefer to set the value based on the button's label to make the value easier - not requiring changing the code
    Question 4 - unrelated to those above.
    Is it possible to build the first table
    | ButtonX | ButtonY | Description |
    from an XML File.  I have seen examples of how to build if it is just data, but can the XML be pushed into a form with code to do the above actions?

    Each object in a form must have a unique name. I doing so it is not neccessarily the name but the path or SomExpression associated with that object that must be unique. In your case you have a Table.Row.object configuration. The Row is the part that is repeating so to give each object a unique name an instance number is placed on the repeating part. So objects in the 1st row woudl be Table.Row[0].object...objects in the second row woudl be Table.Row[1].object etc .....You can see this by adding a debug instruction on the Enter event of the description field. Put the code app.alert(this.somExpression) and when you enter the field you will see what the somExpression is. Do this for a few rows and you will see the pattern (don't forget to remove the debug code from the enter event). Now you know what you have to use to address the fields. If no instance is given it is assumed to be 0 ..that is why only the 1st row is being affected.
    So now to answer your questions:
    Question1: The square bracket notation is an issue for javascript (this is the notation for an array) so we have to use a different means of addressing the field to include the instance number. So to address the Description in the 3rd row we woudl use:
    xfa.resolveNode("Table.Row[2].Description").rawValue = "This is my new description";
    Note that the instance number is 2 for the 3rd row because the instance numbers are 0 based.
    Question2. The resolveNode notation allows you to pass a string so you can also concatinate expressions to make the string. If you are writing code on a button in the same row you can get the instance that you are on by using the expression this.parent.index. The "this" portion refers to the current object (the button) and the parent.index gets you th eindex of the Buttons parent. If the button is embedded deeper in a hierarchy then you can continue to add parent indicators until you get back to the node that you want. So rewriting your expression from Q1 it woudl be:
    xfa.resolveNode("Table.Row[" + this.parent.index + "].Description").rawValue = "This is my new description";
    Question3: The buttons caption can be retrieved by using ButtonName.caption.value.text.value
    Question4: When you say build from an XML file. What are you expecting to come from the XML file? The caption that goes on the button? Typically the XML file carries data (not to say that it cannot carry other things). Just need a bit of clarification on this one first.
    Hope that helps
    Paul

Maybe you are looking for

  • FTP Issue with Host name

    Hi All,    When i tried to send the file to other FTP server with host name i am getting below error.   Error when getting an FTP connection from connection pool: com.sap.aii.af.lib.util.concurrent.ResourcePoolException: Unable to create new pooled 

  • Deployed in Kuwait - VPNclient configuring w/o networkmanager (pptp)

    My laptop connects to a wireless router in the barracks and Kuwait has quite a few filters on what we can access. I've purchased an account with an online VPN provider and have been able to connect via windows7 and via networkmanager-pptp in Arch. Th

  • How to write 14 similar crystal reports

    I am new to working with crystal reports. I would like to know way(s) to  write 14 similar detail reports.   I will be passing parameters from a vb.net windows application to a crystal report that will have 14 detail reports that are similar but the

  • SQL Server Max Memory Settings

    Hi, I'd like to check if SQL Server will consume memory more than the configured MAX Memory settings? And if so when does SQL consume that and how much would it consume. Regards, Jay

  • Custom Materialized View

    Hi I am ha query regarding Materialized View . Materialized View Query : select * from emp@db1 where salary in ('1000','3000'); Scenario : In the DB2 (Target DB) : create materialized view emp_mv refresh force on demand as select * from emp@db1 where