How to count the values in row

Hello

50 columns in a table are and 10 records are there. In these 10 records are not inserted not all columns (some are null values). How to find the values of The Count of Record (row).

For example

Table
P1 p2 p3 p4 p5 p6 p7 p8 p9 p10...

10 20 30 40 50
20 30
60 80



In the table below - before, how to find
the number of values in 1 record is 5
the number of values in 2nd record is 2
the number of values in 3rd record is 2




--
Thank you and best regards,
Hari
decode(p1,null,0,1)+
decode(p2,null,0,1)+
decode(p3,null,0,1)+
...

Tags: Database

Similar Questions

  • How to get the value of row current table when press the button submit

    Hello

    I want to get the current value of the SuccessionPlanId line which is part of the column in a table that is advanced.

    I created a (created using customization, from action through CO) button in the table as column, so each line with a single key, if I press the button of the first line means so I want to extract the first line SuccessionPlanId and if it's the 3rd way so I want to get the value of the value of the third row.

    How in the post of controller?

    Please answer soon, its urgency.

    Thanks in advance,
    SAN

    OK, need to go with a delicate way,

    1.) create a new table with Jdeveloper and there shud be a replica of the room once except the button submit newly added, pls note button type shud be present the type of button.

    2.) hide the existing table area and create a new stacklayoutbean.

    (3.) this stacklayout bean will have the property to extend, you give the full path of the new custom of advanced table box.

    Now you should be able to get the reference of the line during the click on the "submit" button

  • Count the number of rows in a table (s)

    Hi all

    I have a TKT_PRIORITY_LK table that I want to count the number of rows returned by a priority level... say Low, Medium, High, critical. I want to be able to count how many of each created are they, instead returning ID instead, if making any sense... Can you please help with this.

    Example; Select count (*) in TKT_PRIORITY_LK

    PRIORITY group

    Kind regards

    Sandrine

    Try this

    Select a.PRIORITY, count (*) from TKT_PRIORITY_LK a, TKT_TICKET_MAIN b

    where a.id = b.PRIORITY_ID

    A.PRIORITY group

  • How to get the value of the interactive report into apex 5 column

    Hello

    I want to create the master detail report with ajax.

    If I want to get the value of a specific column of interactive report when click on one line and has a value of element of selected row column value.

    Then use the elements of value to refresh the details report.

    You have a better idea to refresh the report Details according to select line of the master report without refreshing the whole page?

    Hi SYSMAN2007,

    SYSMAN2007 wrote:

    I want to create the master detail report with ajax.

    If I want to get the value of a specific column of interactive report when click on one line and has a value of element of selected row column value.

    Then use the elements of value to refresh the details report.

    You have a better idea to refresh the report Details according to select line of the master report without refreshing the whole page?

    You can do this with the help of dynamic action. You need to get the value of the column of a line click in IR (using jQuery) and set the value to the elements which, in turn, can be used as a filter to other reports on the same page.

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

    Can you reproduce your problem on apex.oracle.com and share the credentials of the workspace, so that I can demonstrate how this can be achieved.

    See an example of how it can be done with dynamic actions: https://apex.oracle.com/pls/apex/f?p=35467:5

    Kind regards

    Kiran

  • How to reset the value of a list of entry of null values

    Hello

    Jdev 12.1.3.0

    How to reset the value of a list of entry of null values

    Thank you

    AR

    Place this code in your ViewRowImpl (base) class and use it when you need to reset _all attributes applied by LOV

    @Cvele: in fact, this will happen "by design" when you set the attribute which has attached lov to null, so there is no need of additional code.

    See also this blog: binary: prevent the execution of query unwanted in British Colombia ADF when used in Non - UI applications

    My previous answer is more related to this approach:

    DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding iterator = bindings.findIteratorBinding("IteratorName");
    Row r = iterator.getCurrentRow();
    r.setAttribute("SomeAttrib", null);
    

    Dario

  • using the function - how to use the values of the input variables on the table select statement names

    Hello community, I have a problem when creating a function. The purpose of this function is to check the table of weather gave yesterday or not. We must check this on different tables on different sachems. We are creating a function with input variables.

    CREATE OR REPLACE FUNCTION IN_SCHEMA.IS_YDAYDATA_TO_TABLE

    (

    in_schema IN VARCHAR2,

    in_tablename IN VARCHAR2,

    in_datefield IN VARCHAR2,

    )

    RETURNS INTEGER

    AS

    -Declaring variables

    v_is_true INTEGER.

    BEGIN

    SELECT

    CASE

    WHEN MAX (in_datefield) = TRUNC(SYSDATE-1)

    THEN 1

    ON THE OTHER

    0

    END

    IN

    v_is_true

    Of

    in_schema.in_tablename

    ;

    RETURN v_is_true;

    END;

    /

    When creating, I got error: [error] ORA-00942 (44:19): PL/SQL: ORA-00942: table or view does not exist

    How to use the values of the input variables on the table select statement names?

    Hello

    Here's a way you can use dynamic SQL statements for this task:

    CREATE OR REPLACE FUNCTION IS_YDAYDATA_TO_TABLE

    (

    in_schema IN VARCHAR2,

    in_tablename IN VARCHAR2,

    in_datefield IN VARCHAR2,

    in_first_date DATE DEFAULT SYSDATE - 1,.

    in_last_date DATE by DEFAULT NULL

    )

    RETURNS INTEGER

    AS

    -IS_YDAYDATA_TO_TABLE returns 1 if in_schema.in_tablename.in_datefield

    -contains all the dates in the in_first_date of the range through included in_last_date

    - and it returns 0 if there is no such lines.

    -If in_last_date is omitted, the search only the data on in_first_date.

    -If in_first_date is omitted, it defaults to yesterday.

    -Time parts of the in_first_date and in_last_date are ignored.

    -Declaring variables

    sql_txt VARCHAR2 (1000);

    v_is_true INTEGER.

    BEGIN

    sql_txt: = 'SELECT COUNT (*).

    || 'FROM ' | in_schema | '.' || in_tablename

    || 'WHERE ' | in_datefield | ' > =: d1'

    || «AND» | in_datefield | '< >

    || 'AND ROWNUM = 1';

    dbms_output.put_line (sql_txt |) '= sql_txt in IS_YDAYDATA_TO_TABLE");  -For debugging

    Sql_txt EXECUTE IMMEDIATE

    IN v_is_true

    With the HELP of TRUNC (in_first_date) - d1

    TRUNC (NVL (in_last_date

    in_first_date

    )

    ) + 1                -- d2

    ;

    RETURN v_is_true;

    END is_ydaydata_to_table;

    /

    DISPLAY ERRORS

    If you must use dynamic SQL statements, put all the SQL statement in a single string variable, such as sql_txt in the example above.  In this way, you can easily see exactly what will be executed.  Comment out the call to dbms_output under test is completed.

    Try to write functions that will address not only the question that you have now, but similar questions that you may have in the future.  For example, now that interest you only to the verification of the data of yesterday, but later, you might want to check another day or range of days.  The above function combines the convenience of a function simple (looks like yesterday data if you don't tell him otherwise) with the power of a more complex function (you can use the same function to check any day or range of days).

  • How to choose the value of a string are numeric together and words of letters (for example, TEST)

    Hi all

    How to choose the value of a string are letters (for example, TEST) and all numeric...

    for example
    TEST 123456
    TEST 34567
    123456 ABCD
    1234 TEST
    TESTING 12345
    TEST 1@234$
    YOUR T 123456

    I want the results of the query as below.
    TEST 123456
    TEST 34567

    And I tried to use regexp_like in this case but without success. See the code below.
    SELECT * FROM TABLE WHERE regexp_like (Description, ' [TEST] % & [[: digit:]] + $');

    How can I do this, please answer.

    Thank you

    WF

    If you want to return only the rows that contain the string 'TEST', followed by zero or more space characters, followed by one or more digits?

    How about this:

    SELECT *.

    FROM my_table

    WHERE REGEXP_LIKE(description,'^TEST\s*\d+$')

  • How to get the value of the outputtext in javascript and send it to backing bean

    Hi Experts ADF,

    JDev Version 11.1.1.7.0

    I have the following: the value of the outputtext must be treated in javascript and the serverlistener method has the same value. I founded this value returns a string that wshould see the mouseover NIJ.

    Help, please. Thanks in advance.

    < af:column sortProperty = "#{bindings." OrderProposalReadClient.hints.exceptions.name}.

    filterable = "true" sortable = "true".

    headerText = "#{suiviewBundle.EXCEPTIONS} '"

    ID = "c16" >

    < af:outputText value = "#{row.exceptions}" id = "ot32" clientComponent = "true" > "

    < af:clientListener type = "mouseOver".

    method = "customJsFunction" / >

    < af:serverListener type = "mycustomserverEvent".

    Method="#{pageFlowScope.ChangeOrderProposalBean.handleServerEvent}"/ >

    < / af:outputText >

    < / af:column >

    JavaScript

    < af:resource type = "javascript" >

    var customJsFunction = function (event)

    {

    var exceptiondata = AdfPage.PAGE.findComponentByAbsoluteId ('ot32');

    AdfCustomEvent.queue ();

    Returns true;

    }

    < / af:resource >

    BackingBean

    public String handleServerEvent(EC ClientEvent)

    {

    Please let me know how to get the value that javascript code sends here.

    Let's say javascript sends the value of outputtext as "001".

    So, I have to check "001" in my list and return a value that appears on mouseover.

    }

    Kind regards
    Roy

    Hello, Roy.

    To use the value on another component of the user interface, I shows an example:

    -code of the page

    shortDesc = "shortDesc" >

    method = "customJsFunction" / >


    -the javascript code

    var customJsFunction = function (event)

    {

    var exceptiondata = event.getSource ().findComponent("ot32").getValue ();

    AdfCustomEvent.queue (event.getSource (),

    "mycustomserverEvent,"

    {param1:exceptiondata},

    (true);

    Returns true;

    }

    -OutputTextCase11.java

    public void handleServerEvent (EC ClientEvent)

    {

    String param = (String) ce.getParameters () .get ("param1");

    RichOutputText outputText = (RichOutputText) ce.getComponent () .findComponent ("ot1");

    outputText.setShortDesc (param);

    outputText.setValue (param);

    AdfFacesContext.getCurrentInstance () .addPartialTarget (outputText);

    }

    I hope this helps you.

    RFH.

  • How to count the number or lines in the file

    Hi Experts,

    I'm file as source and Oracle as target. My folder that contains some data that will load the target.
    My requirement is that I want to count the number of lines that contains my folder. Please help me how to count the total number of lines in the file.


    THX,
    Sara.

    Hi Sahaveda,

    Now, I tried and it works.

    Sorry my mistake again.

    I created HR. ETL_FILE_LOG as below:

    CREATE THE TABLE HR. ETL_FILE_LOG (numero_fichier varchar2 (10))

    Below the code will run without error:

    import java.lang as lang

    import java.sql SQL

    import of java.lang.String

    Import os

    disadvantages is sql. DriverManager.getConnection ("<%=snpRef.getInfo("DEST_JAVA_URL")%>", "<%=snpRef.getInfo("DEST_USER_NAME")%>", "<%=snpRef.getInfo("DEST_PASS")%>")

    dblinks = cons.createStatement)

    File1 = Open ('c:\EMP.txt','r')

    Count = 0

    Line = file1. ReadLine()

    all online! ='' :

    Count += 1

    Line = file1. ReadLine()

    File1. Close()

    sqlQuery = "insert into HR. "The values of ETL_FILE_LOG (numero_fichier) (" + str (count) + ' ") '.

    rqQuery = dblinks.execute (sqlQuery)

    jerks. Close()

    Concerning

  • How to count the number of hit on the page, click

    Hello..
    can someone tell me...
    How to count the number of hit on the page, click

    Thanks in anticipation...

    Somethig like that?
    http://www.baigzeeshan.com/2011/12/Oracle-ADF-storing-temporary-values-in.html

  • How to get the value of an xml element attributes

    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0

    I'm trying to parse an XML document

    < response >
    < well uwi = "102112900816W400" > < / well >
    < production >
    < PRODUCING_ENTITY >
    < NUMBER YEAR = '2009' >
    < NUMBER of MONTHS = LAST_DAY '1' = "31" / >
    < NUMBER of MONTHS = LAST_DAY '2' = "28" / >
    < NUMBER of MONTHS = LAST_DAY "3" = "30" / >
    < / YEAR >
    < NUMBER YEAR = '2010' >
    < NUMBER of MONTHS = LAST_DAY '1' = "31" / >
    < NUMBER of MONTHS = LAST_DAY '2' = "28" / >
    < NUMBER of MONTHS = LAST_DAY "3" = "30" / >
    < / YEAR >
    < NUMBER YEAR = '2011' >
    < NUMBER of MONTHS = LAST_DAY '1' = "31" / >
    < NUMBER of MONTHS = LAST_DAY '2' = "28" / >
    < NUMBER of MONTHS = LAST_DAY "3" = "30" / >
    < / YEAR >
    < NUMBER YEAR = '2012' >
    < NUMBER of MONTHS = LAST_DAY '1' = "31" / >
    < NUMBER of MONTHS = LAST_DAY '2' = "28" / >
    < NUMBER of MONTHS = LAST_DAY "3" = "30" / >
    < / YEAR >
    < / PRODUCING_ENTITY >
    < / production >
    < / well >
    < well uwi = "100092900816U400" > < / well >
    < production >
    < PRODUCING_ENTITY >
    < NUMBER YEAR = "1999" >
    < NUMBER of MONTHS = LAST_DAY '1' = "31" / >
    < NUMBER of MONTHS = LAST_DAY '2' = "28" / >
    < NUMBER of MONTHS = LAST_DAY "3" = "30" / >
    < / YEAR >
    < NUMBER YEAR = '2000' >
    < NUMBER of MONTHS = LAST_DAY '1' = "31" / >
    < NUMBER of MONTHS = LAST_DAY '2' = "28" / >
    < NUMBER of MONTHS = LAST_DAY "3" = "30" / >
    < / YEAR >
    < NUMBER YEAR = '2001' >
    < NUMBER of MONTHS = LAST_DAY '1' = "31" / >
    < NUMBER of MONTHS = LAST_DAY '2' = "28" / >
    < NUMBER of MONTHS = LAST_DAY "3" = "30" / >
    < / YEAR >
    < NUMBER YEAR = "2003" >
    < NUMBER of MONTHS = LAST_DAY '1' = "31" / >
    < NUMBER of MONTHS = LAST_DAY '2' = "28" / >
    < NUMBER of MONTHS = LAST_DAY "3" = "30" / >
    < / YEAR >
    < / PRODUCING_ENTITY >
    < / production >
    < / well >
    < / answer >

    For the purposes of the practice, I have saved this in my table tdw_test_xml_files;

    My goal is to get the /WELL/@uwi and /YEAR/@NUMBER

    UWI YEAR
    ------ ---------------
    102112900816W400 2009
    102112900816W400 2010
    102112900816W400 2011
    102112900816W400 2012
    100092900816U400 1999
    100092900816U400 2000
    100092900816U400 2001
    100092900816U400 2003


    I tried this... but I can't get the value of the attribute for the element < YEAR >

    Select r.uwi, r.year
    of tdw_test_xml_files.
    XMLTABLE
    (
    "for $WELL in $ response/WELL/good.
    for $DEPT to $UWIIDX in $WELL, Production, PRODUCING_ENTITY, YEAR
    return < RESULT >
    University of the West Indies West <>{fn:data($WELL/@uwi)} < / UWI >}
    {
    $WELL/production/PRODUCING_ENTITY/YEAR [$UWIIDX]-> (I don't know how to extract the value of the attribute here)
    }
    < / RESULT > '
    passing FILECONTENT as 'GOOD '.
    columns
    UWI VARCHAR (50),
    YEAR vARCHAR2 (24)
    ) r
    /


    If I do this; I get the Cartesian plan result set, which is not my goal

    SELECT xtab.*, xtab2.*
    OF tdw_test_xml_files, XMLTable (' for $i in/Response/Well)
    Return $i"
    PASSAGE filecontent
    Uwi varchar2 COLUMNS (50) PATH'@uwi'
    rn for ORDINALITE
    ) xtab
    , XMLTable (' for $i in/Response/Well/Production/PRODUCING_ENTITY/YEAR)
    Return $i"
    PASSAGE filecontent
    COLUMNS year varchar2 (50) PATH'@NUMBER'
    ) xtab2;

    Any help will be highly appreciated thanks...

    I'm just curious to know how make the query now in unique XMLTable, not that I am forced by using x number of xmltable; - P, just look more clean...

    Here goes:

    SQL> SELECT x.*
      2  FROM tdw_test_xml_files t
      3     , XMLTable(
      4         'for $i in /Response/Well
      5            , $j in $i/Production/PRODUCING_ENTITY/YEAR
      6            , $k in $j/MONTH
      7          return element r {
      8            $i/@uwi
      9          , element year  {data($j/@NUMBER)}
     10          , element month {data($k/@NUMBER)}
     11          }'
     12         passing t.filecontent
     13         columns uwi   varchar2(50) path '@uwi'
     14               , yr    varchar2(4)  path 'year'
     15               , mon   varchar2(2)  path 'month'
     16       ) x
     17  ;
    
    UWI                            YR   MON
    ------------------------------ ---- ---
    102112900816W400               2009 1
    102112900816W400               2009 2
    102112900816W400               2009 3
    102112900816W400               2010 1
    102112900816W400               2010 2
    102112900816W400               2010 3
    102112900816W400               2011 1
    102112900816W400               2011 2
    102112900816W400               2011 3
    102112900816W400               2012 1
    102112900816W400               2012 2
    102112900816W400               2012 3
    100092900816U400               1999 1
    100092900816U400               1999 2
    100092900816U400               1999 3
    100092900816U400               2000 1
    100092900816U400               2000 2
    100092900816U400               2000 3
    100092900816U400               2001 1
    100092900816U400               2001 2
    100092900816U400               2001 3
    100092900816U400               2003 1
    100092900816U400               2003 2
    100092900816U400               2003 3
    
    24 rows selected
     
    
  • How to count the number of nodes under each parent in any given xml

    How to count the number of nodes under each parent in any given xml. for example the xml below was
    books has 3 childern, library [1] has 4, [2] library has 6 and bookshop [3] has 2. is it possible to get the number of tags in a childnode duplicate IE library [1]
    Book1 Tagus repeated twice... vice versa. do we need to make plsql lie we can achieve through sql

    < book >
    < library >
    ABC < book1 > < / book1 >
    BCA < book2 > < / book2 >
    ACR < book1 > < / book1 >
    Lac < Book4 > < / Book4 >
    < / book >
    < library >
    ABC < book1 > < / book1 >
    BCA < book2 > < / book2 >
    ACR < book3 > < / book3 >
    ACR < book3 > < / book3 >
    tray of < bookn_1 > < / bookn_1 >
    adjusted cost base < bookn > < / bookn >
    < / book >
    < library >
    ABC < book1 > < / book1 >
    BCA < book2 > < / book2 >
    < / book >
    < / books >


    I tried this... query.

    Select
    XMLQUERY ('count($doc/Books/Bookstore[1]/descendant::*)' in the way of xmltype ("< books >
    < library >
    ABC < book1 > < / book1 >
    ACR < book1 > < / book1 >
    Lac < Book4 > < / Book4 >
    < / book >
    < library >
    ABC < book1 > < / book1 >
    BCA < book2 > < / book2 >
    < / book >
    (< / books > ')
    as 'doc' of happy return) .getNumberVal () as node_count
    of the double

    Select
    XMLQUERY ('count($doc/Books/descendant::*)' in the way of xmltype ("< books >
    < library >
    ABC < book1 > < / book1 >
    ACR < book1 > < / book1 >
    Lac < Book4 > < / Book4 >
    < / book >
    < library >
    ABC < book1 > < / book1 >
    BCA < book2 > < / book2 >
    < / book >
    (< / books > ')
    as 'doc' of happy return) .getNumberVal () as node_count
    of the double

    How can I get the counts for each parent in a single query

    Published by: user7955917 on August 24, 2012 07:26

    Generic function how you want the query to be.

    If the structure is known in advance, as in your example a 'books' and then a 'library' root element, it's as simple as:

    SQL> select x1.parent_id, x2.child_name, count(*)
      2  from tmp_xml t
      3     , xmltable(
      4         '/books/bookstore'
      5         passing t.object_value
      6         columns parent_id   for ordinality
      7               , child_list  xmltype path '*'
      8       ) x1
      9     , xmltable(
     10         '/*'
     11         passing x1.child_list
     12         columns child_name varchar2(30) path 'name()'
     13       ) x2
     14  group by x1.parent_id, x2.child_name
     15  order by x1.parent_id, x2.child_name
     16  ;
    
     PARENT_ID CHILD_NAME                       COUNT(*)
    ---------- ------------------------------ ----------
             1 book1                                   2
             1 book2                                   1
             1 book4                                   1
             2 bookn                                   1
             2 bookn_1                                 1
             2 book1                                   1
             2 book2                                   1
             2 book3                                   2
             3 book1                                   1
             3 book2                                   1
    
    10 rows selected
     
    

    If you want a generic solution that works without knowledge of the structure, you will need a recursive approach, and most importantly, you should know which nodes in distinct, I suppose that the leafs?

    Also, please help if you can provide the link of reference on the function name() years what are the other expression, that I can use after the path

    You can start reading the documentation: http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/xdb_xquery.htm#CBAGCBGJ

    The clause PATH expects a XQuery expression however before 11.2, we can put only simple XPath expressions.

  • How to read the value of an independent textInput element inside the method?

    Hello

    I had a group of detail based on a readonly viewobject. I added an independent element textInput, you say, EndDate to this group that the user can enter a value inside. Now, when I run the app I select a row in the table and press a button that triggers a method inside a bean. My question is how I read the value in independent textInput (EndDate) within the method element?

    getTable () .getRowData () does not print the unbound attribute. It seems that it only contains attributes underlying viewobject

    I use JDev 11.1.1.4

    Kind regards
    Will do

    Will do,

    You can better create a transitional attribute for that in your view object, so you can use a regular expression #{row.bindings...} to get the value.

    Steven Davelaar,
    JHeadstart team.

  • How to get the value of viewrow by chain

    With the help of Jdev11.1.1.5.0 - adfbc - ireport3.0.0

    Here I will describe: what I've done.

    use jsff (dynamic region) while hitting the af:tree nodes it opens. Fine OK

    I had somevo manually wroten Query. and the query is fine no problem with it
     here i give sample not a original query
    select * from sometable where acctid = :pacctid
    I do drag and drop the pacctid correspondent run params vo as selectoncechoice


    public static vo
    Value of data - to pay account, advance

    Announcement name - ap, given


    in this jsff
    *page representation*
    
    account type :   account payable (ap) - select one choice type
                            advance           (ad) - select one choice type
    
    like this some select once choice and some inputs.
    
    Run report - command button
     .jsff code 
    <af:selectOneChoice value="#{bindings.ACCT_TYPE.inputValue}"
                              label="Account Type"
                              shortDesc="#{bindings.ACCT_TYPE.hints.tooltip}"
                              id="soc3" required="true" 
                              autoSubmit="true"
                              binding="#{backingBeanScope.SUP1040V.soc3}"
                              valuePassThru="true"
                              valueChangeListener="#{backingBeanScope.SUP1040V.ValueChangeListener1}">
                             
            <f:selectItems value="#{bindings.ACCT_TYPE.items}" id="si3"/>
          </af:selectOneChoice>
    
     <af:commandToolbarButton text="Export in pdf" id="ctb2">
              <af:fileDownloadActionListener method="#{backingBeanScope.SUP1040V.Report}"
                                             />
            </af:commandToolbarButton>
    . Java
         //while hitting the button following logs are appeared i show it as commented format.
    
        public void Report(FacesContext context, OutputStream out) throws IOException,Exception
            {
            
                FacesContext ctx = FacesContext.getCurrentInstance();
                HttpServletRequest request =
                    (HttpServletRequest)ctx.getExternalContext().getRequest();
                HttpServletResponse response =  
                    (HttpServletResponse)ctx.getExternalContext().getResponse();
                
            .....
                         
                BindingContainer bindings1 = BindingContext.getCurrent().getCurrentBindingsEntry();
                System.out.println("print binding" +bindings1 );
           
    //while using sop i get this in my log : :  print binding  ReportsPageFragments_SUP1040VPageDef_WEB_INF_TaskFlows_SUP1040_V_TF_xml_SUP1040_V_TF
    
           
                JUCtrlListBinding listBinding1 = (JUCtrlListBinding)bindings1.get("ACCT_TYPE");
                System.out.println("print list bindings" +listBinding1 );
           
    //while using sop i get this in my log : :  print list  bindings0
    
    
                Object selectedValue1 = listBinding1.getSelectedValue();
                System.out.println("print selected value" + selectedValue1);
    
    //while using sop i get this in my log : :  print selected  valueViewRow [oracle.jbo.Key[AP ]]    
                
                  
     request.setAttribute("ACCT_TYPE", //here i want the value  "AP" in  String  ); 
    
    if i use like this means
    request.setAttribute("ACCT_TYPE", soc1.getValue()  );  i get the index value.
    
    i need the dataname "ap" so i go above method which say wrotes ...
                 
              
                           ...                                    
                request.getRequestDispatcher(response.encodeURL("/sup1040servlet")).forward(request,response);
                
                System.out.println("hihihihih");
                response.flushBuffer();
                ctx.responseComplete();
           
            }
    
        public void ValueChangeListener1(ValueChangeEvent valueChangeEvent) {
            // Add event code here...
            String AcctType = valueChangeEvent.getNewValue().toString();
            System.out.println("AcctType" + AcctType);
            FacesContext contxt = FacesContext.getCurrentInstance();
            valueChangeEvent.getComponent().processUpdates(contxt); 
          
           BindingContainer bindings1 =
           BindingContext.getCurrent().getCurrentBindingsEntry();
           // Get the sepecific list binding
           JUCtrlListBinding listBinding1 =
           (JUCtrlListBinding)bindings1.get("ACCT_TYPE");
           // Get the value which is currently selected
           Object selectedValue1 = listBinding1.getSelectedValue();
           System.out.println(selectedValue1);
        }
    If I get ap means my report runs. or otherwise it will show an empty page.

    How to get the value of class viewrowimpl as string.

    Published by: ADF7 on March 24, 2012 07:27

    ADF7,
    I'm not sure that understand what you're up to.
    For as far as I understand you want to get the value of display rather than the index
    I use this code

        public void StatusChangedListener(ValueChangeEvent valueChangeEvent)
        {
            BindingContext lBindingContext = BindingContext.getCurrent();
            BindingContainer lBindingContainer = lBindingContext.getCurrentBindingsEntry();
            JUCtrlListBinding list = (JUCtrlListBinding) lBindingContainer.get("Status");
            int newindex = (Integer) valueChangeEvent.getNewValue();
            Object row = list.getDisplayData(); // Wichtig um die liste zu laden!!!!
            Row lFromList = (Row) list.getValueFromList(newindex);
            Object lAttribute = lFromList.getAttribute("Value");
            String newVal = (String) lAttribute;
        }
    

    to get the value of a component of selectOneChoice...

    Timo

  • Count the number of rows returned from each view in USER_VIEWS

    For each USER_VIEWS view, I would return the name, creation date, last modified dateand the number of rows returned by this view.

    Here's what I have so far:
    col object_name format a20
    select 
    object_name, 
    created, 
    last_ddl_time
    from user_objects
    where object_type = 'VIEW'
    Returns:
    OBJECT_NAME          CREATED   LAST_DDL_TIME
    -------------------- --------- -------------
    AISLE_AVG            11-FEB-12 11-FEB-12     
    COURSE_AVG           11-FEB-12 20-FEB-12     
    EXE_12_VIEW          11-FEB-12 21-FEB-12     
    L1_P2                17-FEB-12 17-FEB-12     
    L1_P3                17-FEB-12 17-FEB-12     
    L1_P4                17-FEB-12 17-FEB-12     
    L1_P5A               17-FEB-12 17-FEB-12     
    L1_P5B               17-FEB-12 17-FEB-12     
    LAB3_1A              12-FEB-12 20-FEB-12     
    LAB3_1B              12-FEB-12 20-FEB-12     
    LAB3_2A              12-FEB-12 20-FEB-12     
    LAB3_2B              12-FEB-12 20-FEB-12     
    LAB5_1               19-FEB-12 19-FEB-12     
    LAB5_2               19-FEB-12 19-FEB-12     
    LAB5_3               19-FEB-12 19-FEB-12     
    LAB5_4               19-FEB-12 19-FEB-12     
    LAB5_5               19-FEB-12 19-FEB-12     
    LAB5_TIMES           19-FEB-12 19-FEB-12     
    LAB6_1               19-FEB-12 19-FEB-12     
    LAB7_VIEW            20-FEB-12 20-FEB-12     
    PROGRAMS             11-FEB-12 21-FEB-12     
    STUDENT_GPA          11-FEB-12 21-FEB-12     
    
     22 rows selected 
    How can I add a last column that counts the number of rows returned by this view?

    EDIT - here is a dump of my paintings, and here are my views.

    Edit2 - this is possible by using the DECODE function, by chance?

    The function...

    CREATE OR REPLACE FUNCTION view_row_count (view_name VARCHAR2)
    RETURN NUMBER
    AS
    retval NUMBER;
    BEGIN
    EXECUTE IMMEDIATE
    'select count(*) from '||view_name INTO retval;
    RETURN retval;
    END view_row_count;
    /
    

    And now the query...

    select
    object_name,
    created,
    last_ddl_time,
    view_row_count(object_name) as view_row_count
    from user_objects
    where object_type = 'VIEW'
    

Maybe you are looking for