Calculation of the sum of a column on a XML editor RTF with NULL values

Hello

I have a problem to get the sum of a column in XML editor RTF, if one of the lines has a null value.

say, I have 4 columns and values

CASES1:
NULL, NULL, 4, NULL
Sum, I expect is: 4

CASE2:
NULL, NULL, NULL, NULL
I'm waiting for is a null

Is there a way to do this?

Thank you
Anita

Try this

AMT's column

Tags: Business Intelligence

Similar Questions

  • Is there an alternative way to compute the sum of a column without accessor view

    Hi Experts,

    JDev 12 c,

    I have a column A and I'm total calculation of column A with the same VO as a view accessor. And calculating as below

    EmployeeViewAccessor.sum ("ColumnA").

    But this way, it loads the VO 2 times as it loads the accessor aswell.

    So is there an alternative way to calculate the sum of a column.

    Thank you

    Roy

    Use the analytical function, please see below Ex

    http://docs.Oracle.com/CD/B19306_01/server.102/b14200/functions163.htm

  • How to display the line empty as a line with null values

    Hi all

    Pls advise me if it is possible to use a single query statement to display
    Empty row (i.e. not a single return line) as a line with null values.

    For example,.

    Select the names of names_mst whose name = "sgasfgs".

    Result:
    Names of
    =====
    < null >

    Hello
    If you desire to join external to double, as shown below, you still get at least a line of production

    SELECT  nm.names
    FROM            dual
    LEFT OUTER JOIN names_mst   nm  ON nm.name='sgasfgs';
    
  • JavaScript for the sum of a column cells

    Hi all -

    I have a table in expansion (lines can be added) and I am using the line of the column footer to calculate the average of the cells which do not have the value 0.

    Form Calc is usually great, but in this case, I need to divide the sum by the number of cells that are not zero and I don't know how to do this via form Calc.

    Successfully used javascript to identify the total number of occurrences and identify the number of instances that are zero, then the part of the denominator of the equation is fine. (Number of cases - number of zeros = denominator.)

    Now, it's just the numerator. There must be a loop, right?

    Is called table: table1

    Line is called: data

    cell is called: rated

    Any thoughts? Or more effective methods? Thank you very much.

    B

    Hello

    a solution in FormCalc could look this way:

    form1.#subform[0].table1.footer.sum::calculate - (FormCalc, client)
    var c = 0
    var s = 0
    for i = 0 upto (_data.count - 1) do
      if (data[i].eValue gt 0) then
      c = Sum(c, 1)
      s = Sum(s, data[i].eValue)
      endif
    endfor
    
    if (s gt 0 and c gt 0) then
      $ = Round(s / c)
    else
      $ = 0
    endif
    

    Put this scriot in the calculate of the cell of the footer line event.

  • How to get the last row and the sum of all columns in a query

    Hello

    is there a way to get the last record for a column and the sum of all the Archives to another column in the same query.

    Best regards

    You must set your needs correctly volunteers to help here...

    Your data are not good enough to bring you a precise solution. Purpose, you do not have a column, which draws a distinction between the first and the last entry.

    The solution becomes easy based on your design.

    I introduced a grouping called 'id' column and a time column called 'time_of_insert' (only this way you can say with confidence that you can differentiate between the first and last (also a foolproof solution) - you can possibly use sequence (instead of date but if you say that you can insert two lines at the same time) ((and then likely sequence would be a better choice to differentiate instead of a timestamp field) etc...)

    With your sample data, something like this can be done to get the desired results.

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

    WITH dataset AS

    (SELECT 1 id, 10 used, 8 remain, systimestamp + 1/24 time_of_insert FROM DUAL

    UNION ALL

    SELECT the 1 id, 1, 7, systimestamp + 2/24 FROM DUAL

    UNION ALL

    SELECT the id 1, 2, 5, systimestamp + 3/24 FROM DUAL

    UNION ALL

    SELECT 1 id, 1, 0, systimestamp + 4/24 FROM DUAL

    UNION ALL

    SELECT 1 id, 0, 0, systimestamp + 5/24 FROM DUAL

    UNION ALL

    SELECT the 1 id, 1, 4, systimestamp + 6/24 FROM DUAL)

    SELECT *.

    (SELECT SUM (used) ON sum_all)

    FIRST_VALUE (stay)

    COURSES (PARTITION BY id ORDER BY time_of_insert DESC)

    last_row

    Of THE dataset)

    WHERE ROWNUM = 1;

    Output:

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

    SUM_ALL LAST_ROW

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

    15                  4

    See you soon,.

    Manik.

  • A simple query to write for the SUM of a column

    Hello

    I have a Quantity column. I want his total.
    For a PURCHASE, I would like to add the value in the column Qunatity.
    For a COPY, I want to subtract the value in the column Qunatity.
    So overall, the sum of the column should give me total buy less total sells.

    Any help is welcome.
    Thank you.

    Published by: TechVortex on August 11, 2011 11:49

    Like this?

    SQL> ed
    Wrote file afiedt.buf
    
      1  with sample_data as
      2  (
      3  select 100 quantity, 'B' flag from dual union all
      4  select 200, 'B' from dual union all
      5  select 100, 'S' from dual union all
      6  select 500, 'B' from dual union all
      7  select 200, 'S' from dual
      8  )
      9  SELECT SUM(quantity),
     10         SUM(DECODE(flag, 'B', quantity,
     11                          'S', -quantity)) absolute_sum
     12* FROM   sample_data
    SQL> /
    
    SUM(QUANTITY) ABSOLUTE_SUM
    ------------- ------------
             1100          500
    
  • the sum of a column where date column is converted in year + 1

    Hello

    I want the sum, said the column of taAmt where he is not null and the column fromPeriod is converted to the format of the year and has 1 year. This syntax does not work, can anyone help?

    <? sum (taAmt [.! = "and fromPeriod ('YYYY') + 1])? >

    Assigning :) Points If you wish

  • SQL for the sum of a column while avoiding the repetition of values

    Dear all
    I have this table called Loans_installments that contains the client's loan payments.

    sample data:
    the client_id loan_no inst_mat_date inst_seq original_inst_amt int_amt currency management
    110 2 222 100 1/1/2013 1 0 50
    110 2 222 100 1/2/2013 2 0 52
    110 2 222 100 1/3/2013 3 0 54
    110 2 222 100 1/4/2013 4 500 90
    110 2 222 100 1/5/2013 5 0 50
    110 2 222 100 1/6/2013 6 0 51
    110 2 222 100 7/1/2013 7 0 50
    110 2 222 100 1/8/2013 8 600 105
    110 2 222 100 1/9/2013 9 0 50
    110 2 222 10 100 1/10 / 2013 0 54
    110 2 222 100 1/11 / 2013 11 0 50
    110 2 222 100 1/12 / 2013 12 700 120



    now what I want to do the sum of int_amt field based on original_inst_amt value (0 or a value) and put the result on the int_amt who has an orig_inst_amt value <>0.

    the result should be like this:


    the client_id loan_no inst_mat_date inst_seq original_inst_amt int_amt currency management
    110 2 222 100 1/1/2013 1 0 0
    110 2 222 100 1/2/2013 2 0 0
    110 2 222 100 1/3/2013 3 0 0
    110 2 222 100 1/4/2013 4 500 246
    110 2 222 100 1/5/2013 5 0 0
    110 2 222 100 1/6/2013 6 0 0
    110 2 222 100 7/1/2013 7 0 0
    110 2 222 100 1/8/2013 8 600 256
    110 2 222 100 1/9/2013 9 0 0
    110 2 222 100 1/10 / 2013 10 0 0
    110 2 222 100 1/11 / 2013-11 0 0
    110 2 222 100 1/12 / 2013 12 700 274


    any help please.

    With the help of the clause type

    SQL> with t
      2  as
      3  (
      4  select 110 branch, 2 currency, 222 client_id, 100 loan_no, to_date('1/1/2013','mm/dd/yyyy') inst_mat_date, 1  inst_seq, 0   original_inst_amt, 50 int_amt from dual
      5  union all
      6  select 110 branch, 2 currency, 222 client_id, 100 loan_no, to_date('1/2/2013','mm/dd/yyyy') inst_mat_date, 2  inst_seq, 0   original_inst_amt, 52 int_amt from dual
      7  union all
      8  select 110 branch, 2 currency, 222 client_id, 100 loan_no, to_date('1/3/2013','mm/dd/yyyy') inst_mat_date, 3  inst_seq, 0   original_inst_amt, 54 int_amt from dual
      9  union all
     10  select 110 branch, 2 currency, 222 client_id, 100 loan_no, to_date('1/4/2013','mm/dd/yyyy') inst_mat_date, 4  inst_seq, 500 original_inst_amt, 90 int_amt from dual
     11  union all
     12  select 110 branch, 2 currency, 222 client_id, 100 loan_no, to_date('1/5/2013','mm/dd/yyyy') inst_mat_date, 5  inst_seq, 0   original_inst_amt, 50 int_amt from dual
     13  union all
     14  select 110 branch, 2 currency, 222 client_id, 100 loan_no, to_date('1/6/2013','mm/dd/yyyy') inst_mat_date, 6  inst_seq, 0   original_inst_amt, 51 int_amt from dual
     15  union all
     16  select 110 branch, 2 currency, 222 client_id, 100 loan_no, to_date('1/7/2013','mm/dd/yyyy') inst_mat_date, 7  inst_seq, 0   original_inst_amt, 50 int_amt from dual
     17  union all
     18  select 110 branch, 2 currency, 222 client_id, 100 loan_no, to_date('1/8/2013','mm/dd/yyyy') inst_mat_date, 8  inst_seq, 600 original_inst_amt, 105 int_amt from dual
     19  union all
     20  select 110 branch, 2 currency, 222 client_id, 100 loan_no, to_date('1/9/2013','mm/dd/yyyy') inst_mat_date, 9  inst_seq, 0   original_inst_amt, 50 int_amt from dual
     21  union all
     22  select 110 branch, 2 currency, 222 client_id, 100 loan_no, to_date('1/10/201','mm/dd/yyyy') inst_mat_date, 10 inst_seq, 0   original_inst_amt, 54 int_amt from dual
     23  union all
     24  select 110 branch, 2 currency, 222 client_id, 100 loan_no, to_date('1/11/201','mm/dd/yyyy') inst_mat_date, 11 inst_seq, 0   original_inst_amt, 50 int_amt from dual
     25  union all
     26  select 110 branch, 2 currency, 222 client_id, 100 loan_no, to_date('1/12/201','mm/dd/yyyy') inst_mat_date, 12 inst_seq, 700 original_inst_amt, 120 int_amt from dual
     27  )
     28  select branch
     29       , currency
     30       , client_id
     31       , loan_no
     32       , inst_mat_date
     33       , inst_seq
     34       , original_inst_amt
     35       , decode(original_inst_amt, 0, 0, sum(int_amt) over(partition by cnt)) int_amt
     36    from (
     37            select branch
     38                 , currency
     39                 , client_id
     40                 , loan_no
     41                 , inst_mat_date
     42                 , inst_seq
     43                 , original_inst_amt
     44                 , int_amt
     45                 , cnt
     46              from t
     47             model
     48             dimension by
     49             (
     50                inst_seq
     51             )
     52             measures
     53             (
     54                branch, currency, client_id, loan_no, inst_mat_date, original_inst_amt, int_amt, 1 cnt
     55             )
     56             rules
     57             (
     58                 cnt[any] = case
     59                                   when original_inst_amt[cv()-1] > 0 then
     60                                      cnt[cv()-1] + 1
     61                                   else
     62                                      nvl(cnt[cv()-1], cnt[cv()])
     63                               end
     64             )
     65         )
     66  /
    
        BRANCH   CURRENCY  CLIENT_ID    LOAN_NO INST_MAT_   INST_SEQ ORIGINAL_INST_AMT    INT_AMT
    ---------- ---------- ---------- ---------- --------- ---------- ----------------- ----------
           110          2        222        100 01-JAN-13          1                 0          0
           110          2        222        100 02-JAN-13          2                 0          0
           110          2        222        100 03-JAN-13          3                 0          0
           110          2        222        100 04-JAN-13          4               500        246
           110          2        222        100 05-JAN-13          5                 0          0
           110          2        222        100 06-JAN-13          6                 0          0
           110          2        222        100 08-JAN-13          8               600        256
           110          2        222        100 07-JAN-13          7                 0          0
           110          2        222        100 09-JAN-13          9                 0          0
           110          2        222        100 11-JAN-01         11                 0          0
           110          2        222        100 10-JAN-01         10                 0          0
           110          2        222        100 12-JAN-01         12               700        274
    
    12 rows selected.
    
    SQL>
    
  • Throw the records with null values columns

    Hi all.

    Anyone know how to dispose of records containing null column values?

    In the target table, I have the set Null option? with "N"... then the process sqlldr load some records. I need to load all of this without the records with null column values. by result, if the field X is null then load the file.

    Kind regards.

    Published by: ASzo on 05/06/2013 12:37

    Published by: ASzo on 05/06/2013 12:38

    Published by: ASzo on 05/06/2013 12:42

    load data
    INFILE...
    in the table...
    When x! = ''
    fields completed by...
    (x ...)

  • Alter the State of Session? -Apex form publishes text with null value

    Recently I discovered a problem with our Apex facility in which all selected as source for a text field value will eventually be displayed as a null value in the database.
    We run APEX version 3.2 in an Oracle 10.2.0.4 database using Oracle HTTP Server from 10 g companion disc.

    At first glance, everything seems to work as expected; I created a simple table called "oracle_sr" with 2 columns, as both not null:

    SQL > desc capacity.oracle_sr
    Name Null? Type
    ORACLE_SR_ID NOT NULL NUMBER
    TIMESTAMP NOT NULL DATE

    In APEX, the form wizard has been used to create a form on this table.
    After execution of the pages and you enter a value for the timestamp field, I can create folders without problem.

    The question arises when I choose a source for the timestamp field value.
    All the source options causes the same error (including a static value) so I'll focus on the SQL query to the source as:

    Select sysdate double;

    This should replace the date system in the area of text timestamp when the page is executed.
    As expected, the value appears in the text box, but when I submit the form to create the folder I get the error:

    ORA-01400: cannot insert NULL into ('ABILITY'. "" "" ORACLE_SR '. "" TIMESTAMP")

    I have worked with APEX for quite awhile and have successfully used this technique in many applications but just to begin to see this error in recent days. What's particularly odd about this message is by default postings "not null" created by the form wizard sees timestamp class as having a value. Session state information included below reports a value yet the database is to launch the ORA-01400.

    Someone has a similar problem? I have spent a good amount of time to try looking for this problem but can't seem to find any similar messages.

    I have included the release of my test page, debugging from what I see, it seems to be a value associated with the filed timestamp:

    0.00: a C C E P t: request = "CRΘER."
    0.00: metadata: go look up the definition and application shortcuts
    0.00: NLS: wwv_flow.g_flow_language_derived_from = FLOW_PRIMARY_LANGUAGE: wwv_flow.g_browser_language = en - us
    0.00: alter session set nls_language = "AMERICAN."
    0.00: alter session set nls_territory = 'AMERICA '.
    0.00: NLS: CSV charset = WE8MSWIN1252
    0.00:... "NLS: decimal separator Set =". »
    0.00:... NLS: Set NLS Group separator = ",".
    0.00:... NLS: Date Format Set = "DD-MON-RR.
    0.01:... Setting session time_zone in-06: 00
    0.01: setting NLS_DATE_FORMAT application date format: DD-MON-RR
    0.01:... NLS: Date Format Set = "DD-MON-RR.
    0.01: fetch database session state
    0.01:... Check the owner of the 2303701116904676 session
    0.01: setting NLS_DATE_FORMAT application date format: DD-MON-RR
    0.02:... NLS: Date Format Set = "DD-MON-RR.
    0.02:... Check for expiration of the session:
    0.02:... Metadata: Page Fetch, calculation, process and branch
    0.02: session: extract information from session header
    0.02:... Metadata: Retrieve the attributes of the page for application 109, page 50
    0.02:... Validate page affinity point.
    0.02:... Check off the items hidden_protected.
    0.03:... Check authorization security systems
    0.03: session state: Save elements of form and p_arg_values
    0.03: *... Session state: you save newValue of the object "P50_ORACLE_SR_ID" = "" "escape_on_input ="N"* 0.03: *..." " Session state: you save the object "P50_TIMESTAMP" = newValue ' 26 May 09 "" escape_on_input = "N" * ""»
    0.03:... Session state: Save "P0_CURRENT_PERSONNEL_ID" - registration of same value: "1."
    0.03:... Session state: Save "P0_OFFSET" - registration of same value: "0".
    0.03:... Session state: Save "P0_ACTIVE_WEEK" - registration of same value: "24 May 09".
    0.03: point of treatment: ON_SUBMIT_BEFORE_COMPUTATION
    0.03: branch point: BEFORE_COMPUTATION
    0.03: point of calculation: AFTER_SUBMIT
    0.03: tabs: make the connection for the tab queries
    0.03: branch point: BEFORE_VALIDATION
    0.03: perform validations:
    0.03:... Point Not Null Validation: P50_TIMESTAMP
    0.04: branch point: BEFORE_PROCESSING
    0.04: point of treatment: AFTER_SUBMIT
    0.04:... Process 'PK get': PLSQL (AFTER_SUBMIT) declare function get_pk return varchar2 is begin C1 in (select ORACLE_SR_SEQ.nextval double next_val) loop return c1.next_val; end loop; end; Start: P50_ORACLE_SR_ID: = get_pk; end;
    0.04:... * session state: saved point new value "P50_ORACLE_SR_ID" = "6."
    0.04:... Treat "Line of ORACLE_SR process": DML_PROCESS_ROW (AFTER_SUBMIT) #OWNER #:ORACLE_SR:P50_ORACLE_SR_ID:ORACLE_SR_ID | IUD
    0.04: see the error page...
    0.04: execute rollback...

    ORA-01400: cannot insert NULL into ('ABILITY'. "" "" ORACLE_SR '. "" TIMESTAMP")

    Cannot process the row in the ORACLE_SR table.
    Back by demand.

    Any thoughts would be appreciated.

    Thank you

    Justin.

    If you have changed the Source Type of an element of database column to something else, so he cannot participate in the automated line choreography Fetch/automatic line processing (DML). You must leave the Type of Source, as it was and change the default value of the element fill when the ARF process retrieves a null value for the column.

    Scott

  • Add filter slot table form to show the lines with null values

    Hello

    I have a tabular presentation where we need to add a filter with two values (selection list) so that if one of the columns in a table (column1) is zero, then I need to display all records where column1 is null.

    I was wondering how do I put this in the Source of tabular forms where condition. This filter has only two values,

    All the
    NULL for the error

    So when the user selects all, then all the records in the table are shown
    If the user selects 'Value Null in error', while the records where Column1 is null will be shown

    For example
     column1        column2
                           A
                           B
          1               C
          3               D
     
    If the user selects, then

    all four files will show up. Else, only the first and the second will be returned.

    Thank you

    Hi, Ryan.

    Try a static LOV like this

    STATIC2:;,--- All ---;--- All ---
    

    and a Where clause, like this

    where column1 is null or :p1_filter like '%%'
    

    Jeff

  • REGEXP_SUBSTR for the list delimited by commas with null values

    Hello

    I have a column that stores a list of values comma-delimited. Some of these values in the list may be null. I'm having some trouble trying to extract the values using the REGEXP_SUBSTR function when null values are present. Here are two things I've tried:
    SELECT
       REGEXP_SUBSTR (val, '[^,]*', 1, 1) pos1
      ,REGEXP_SUBSTR (val, '[^,]*', 1, 2) pos2
      ,REGEXP_SUBSTR (val, '[^,]*', 1, 3) pos3
      ,REGEXP_SUBSTR (val, '[^,]*', 1, 4) pos4
      ,REGEXP_SUBSTR (val, '[^,]*', 1, 5) pos5
    FROM (SELECT 'AAA,BBB,,DDD,,FFF' val FROM dual);
    
    POS P POS P P
    --- - --- - -
    AAA   BBB
    SELECT
       REGEXP_SUBSTR (val, '[^,]+', 1, 1) pos1
      ,REGEXP_SUBSTR (val, '[^,]+', 1, 2) pos2
      ,REGEXP_SUBSTR (val, '[^,]+', 1, 3) pos3
      ,REGEXP_SUBSTR (val, '[^,]+', 1, 4) pos4
      ,REGEXP_SUBSTR (val, '[^,]+', 1, 5) pos5
    FROM (SELECT 'AAA,BBB,,DDD,,FFF' val FROM dual);
    
    POS POS POS POS P
    --- --- --- --- -
    AAA BBB DDD FFF
    As you can see that neither calls work correctly. Anyone know how to change the regular expression pattern to handle null values? I tried various other models but could not get anyone to work in all cases.

    Thank you

    Martin
    -----
    http://www.ClariFit.com
    http://www.TalkApex.com

    Hi, Martin,.

    That's what you want:

    SELECT
       RTRIM (REGEXP_SUBSTR (val, '[^,]*,', 1, 1), ',') pos1
      ,RTRIM (REGEXP_SUBSTR (val, '[^,]*,', 1, 2), ',') pos2
      ,RTRIM (REGEXP_SUBSTR (val, '[^,]*,', 1, 3), ',') pos3
      ,RTRIM (REGEXP_SUBSTR (val, '[^,]*,', 1, 4), ',') pos4
      ,RTRIM (REGEXP_SUBSTR (val || ','
                          , '[^,]*,', 1, 5), ',') pos5
    FROM (SELECT 'AAA,BBB,,DDD,,FFF' val FROM dual);
    

    The query above works in Oracle 10 or 11, but in Oracle 11, you can also do it with only REGEXP_SUBSTR, without using RTRIM:

    SELECT
       REGEXP_SUBSTR (val, '([^,]*),|$', 1, 1, NULL, 1) pos1
      ,REGEXP_SUBSTR (val, '([^,]*),|$', 1, 2, NULL, 1) pos2
      ,REGEXP_SUBSTR (val, '([^,]*),|$', 1, 3, NULL, 1) pos3
      ,REGEXP_SUBSTR (val, '([^,]*),|$', 1, 4, NULL, 1) pos4
      ,REGEXP_SUBSTR (val, '([^,]*),|$', 1, 5, NULL, 1) pos5
    FROM (SELECT 'AAA,BBB,,DDD,,FFF' val FROM dual);
    

    The problem with your first request was that he was looking for sub channels of 0 or more non-virgules. There was as a substring. consisting of 3 characters starting at position 1, he returned "AAA", as expected. Then there was an another substring, the 0 characters, starting at position 4, so it returned NULL. Then, there was a substring of 3 characters starting at position 5, so he returned 'BBB '.

    The problem with your 2nd request was that he was looking for 1 or more non-virgules. 'DDD' is the 3rd this substring.

    Published by: Frank Kulash, on February 16, 2012 11:36
    Added Oracle 11 example

  • ORDER BY a column with NULL values only

    Hello

    The order of column has all null values for the results of my query set.

    Ex:

    Select a, b, c from table1 where type = 'type1' and ID = "id1" order by column1

    In the above query, "column1" contains nulls for 'type1 '. The order of the records in the result set is different for different ID values if the values of a, b and c are always the same.
    What is happening in the 10g database.

    I have also observed that the order of the records for the same query conforms in the 9i database.

    (1) is the difference due to the difference in versions of database?
    (2) is there a way to get the order even records independently entry ID?
    (3) I cannot in the same order in 10 g DB too as the order in 9i DB?

    Thank you.

    Hello

    Madhuri says:
    Hello

    The order of column has all null values for the results of my query set.

    Ex:

    Select a, b, c from table1 where type = 'type1' and ID = "id1" order by column1

    In the above query, "column1" contains nulls for 'type1 '. The order of the records in the result set is different for different ID values if the values of a, b and c are always the same.
    What is happening in the 10g database.

    I have also observed that the order of the records for the same query conforms in the 9i database.

    If two or more rows have the same values (or NULL) for each ORDER BY expressions, then you may not be sure what order they will be. The system is free to do whatever he finds convenient. What the system identifies Dresser can vary depending on many factors, including the version, the size of the table, the conditions in the WHERE clause, there is a GROUP BY clause, or not... In all cases, it is not something that you can depend on. If you want the output in a certain order, to specify the order in the ORDER BY clause.

    (1) is the difference due to the difference in versions of database?

    Could be. In all versions, Oracle said that you cannot count on the order being compatible, except if the ORDER BY clause, it is consistent.

    (2) is there a way to get the order even records independently entry ID?

    Add more expressions at the end of the ORDER BY clause, as tie-breakers.
    For example:

    ORDER BY  column1
    ,         a
    ,         b
    ,         c
    

    If table1 is really a table (not a view), you can add a ROWID.
    In most cases, you can ORDER BY expressions that are not in the SELECT clause. So if you have a primary key, you can usually ORDER BY it, even if you don't see it.

    (3) I cannot in the same order in 10 g DB too as the order in 9i DB?

    Of course, ORDER BY works the same in all versions. If you have an ORDER BY clause to unambiguously, the output will be exactly the same order in any version.
    Remember that the absence of ORDER BY has no effect in all versions. If you have an ORDER BY of ambiguous clause, you can not count on the coming out in a particular order in any version.

  • NPE for rows with null values in the table of the adv

    I created the table adv, 2 columns, equipped with two text fields. Initially the col2 is empty,
    say that the structure is as follows:
                  col1          col2
    Hdr         Question    Answer
    row1       abc           zxc
    row2       pdd           null (user doesnt enter anything)
    row3       zxc            lkj
    
    APPLYBUTTON
    When the user clicks on apply button I want to update these values in the table.

    I don't know how to do that, but that's what I'm trying to do. Please guide me the right way if its wrong.

    in LICS, I took the APPLYBUTTON action, got all lines of the object corresponding to the view, consulted with everyrow and I'm checking if there are values in the fields in the table, if the value zero, are simply print null. (we would not update on this line). . I could get o the part update, due to null pointer exception
    I get on the row line null pointer exception [1].getAttribute("Answer") for row2, it prints the value of row1 however.

    Here is the code I wrote:
    Set of rows from the rowset = (RowSet) vo.getRowSet ();
    Rank rank [] = vo.getAllRowsInRange ();
    System.out.println ("row.length" + row.length);
    for (int i = 0; i < row.length; i ++) {}
    String question = row.getAttribute("Question").toString ();
    String response = row [i].getAttribute("Answer").toString ();
    If (question! = null & &!("".)) Equals (question. Trim()))
    {
    System.out.println ("Question line" + i + "-" + question);
    }
    on the other
    {
    System.out.println ("Question line" + i + "is null");
    }

    If (response! = null & &!("".)) Equals (Answer.Trim ()))
    {
    System.out.println ("Response line" + i + "-" + response);
    }
    on the other
    {
    System.out.println ("Response line" + i + "is null");
    }

    Why the NPE survey code, I'm checking for null value and you want to print the value null in the logfile... I can not to getAttribute() on the null field, why can not just give me null in the variable I'm assigning to?

    You can guide me what approach to take, if it is not correct.
    I must examine DataDictionary and collect data there?
    Thanks in advance.

    Hello

    handle the exception of null on these two statements like this pointer

    String question = "";
    String response = "";

    Try
    {
    question = row.getAttribute("Question").toString ();
    }
    catch (NullPointerException e)
    {
    question = "";
    }

    Try
    {
    answer = row.getAttribute("Answer").toString ();
    }
    catch (NullPointerException e)
    {
    response = "";
    }

    Si ( !("". Equals (question. Trim()))
    {
    System.out.println ("Question line" + i + "-" + question);
    }
    on the other
    {
    System.out.println ("Question line" + i + "is null");
    }

    Si ( !("". Equals (Answer.Trim ()))
    {
    System.out.println ("Response line" + i + "-" + response);
    }
    on the other
    {
    System.out.println ("Response line" + i + "is null");
    }

    Thank you
    Gerard

  • display of the output cursor empty with null values

    I have the below procedure of the State where he is shown the output to the client.

    The requirement now is if the select statement does not return a value any with the input given then output parameter should see NULL values instead of no line at all.


    One method is to get the number of the select query that is written in "open p_out for." And then write the condition as if count is 0 then null other show data.

    Could you please suggest me any other alternative to this.

    Create or replace procedure test (p_empno in number , p_out out sys_refcursor) is
    
    begin
     open p_out for 
     select e.ename, d.deptname, s.sal , p.addr , v.age
      from emp e ,dept d, sal s, padress p , age v
     where e.deptno = d.deptno and d.deptno = s.deptno
     s.sal_id = p.sal_id and p.id = v.id
    and e.empno = p_empno ;
    
     
    exception when others then
     open p_out for 
     select null , null,null,null,null from dual;
    
     
    end test.
    

    Thank you

    Maybe NOT TESTED!

    Select x.ename, x.deptname, x.sal, x.addr, x.age

    of the double

    left outer join

    (select e.ename, d.deptname, s.sal, p.addr, v.age

    from emp e,.

    d Dept,

    SAL s,

    padress p,

    v of the age

    where e.deptno = d.deptno

    and d.deptno = s.deptno

    and s.sal_id = p.sal_id

    and p.id = v.id

    and e.empno = p_empno

    ) x

    1 = 1

    Concerning

    Etbin

    Select x.*

    of the double

    left outer join

    (select *)

    WCP

    where ename = 'ETBIN.

    ) x

    1 = 1

    EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
    - - - - - - - -

Maybe you are looking for