Eloqua recommended way to identify records with a null value in a specific field?

What is the recommended Eloqua the way to identify records with a null value in a specific field in a contact filter.  For example, in the segment 'lead State cleaning-11/21/12', I look for records with a value zero in LeadID and ContactID... How Eloqua recommends to do this?

Replied to your message here: http://topliners.eloqua.com/message/19075#19075

Tags: Marketers

Similar Questions

  • How to leave db field with a Null value if no value is entered in the form?

    I have a short form that has optional fields. If the optional fields are not filled in the form, I want to leave the field with a Null value in the SQL db. SQL columns allow Null, but whenever this code runs, it seems to insert a space rather than leave the field with a null value. I forget to do?

    Here is the solution...

  • History of backfilling with non-null values

    Hi gurus,

    in Oracle 11 g, which would be the best way to update a null with the next available non-null value?

    For example: in the code below, I need to update the null in 20130201 record (key = 1) (key date) with a value of 100 available at the next available date IE 20130203.
    Same key = 3 value will be updated with key = 4 value i.e. 200.
    1,ABCD, 20130201, NULL
    2,ABCD,20130203, 100
    3,ABCD, 20130205, NULL
    4, ABCD,20130207, 200
    Thank you
    S
    with t as (
               select  tbl.*,
                       last_value(nvl2(c4,c1,null) ignore nulls) over(order by c1) prev_c1,
                       last_value(c4 ignore nulls) over(order by c1) prev_c4,
                       first_value(nvl2(c4,c1,null) ignore nulls) over(order by c1 rows between current row and unbounded following) next_c1,
                       first_value(c4 ignore nulls) over(order by c1 rows between current row and unbounded following) next_c4
                 from  tbl
              )
    select  c1,
            c2,
            c3,
            c4,
            case
              when c4 is not null then c4
              when c1 - prev_c1 < next_c1 - c1 then prev_c4
              else next_c4
            end new_c4
      from  t
    /
    
            C1 C2           C3         C4     NEW_C4
    ---------- ---- ---------- ---------- ----------
             1 ABCD   20130201                   100
             2 ABCD   20130203        100        100
             3 ABCD   20130205                   200
             4 ABCD   20130207        200        200
    
    SQL> 
    

    SY.

  • Several lines in duplicate with the null value displayed in the combined analysis rpt

    Dear all,

    Our requirement is to display users open tasks (my open tasks) on the home page. So I created a report called open my tasks.

    The columns to display are subject, account name, due date, owner. If I use only the 'activities' notification area, and then I can not retrieve tasks that have NULL of the account name. SOD ignore and filter the tasks with the NULL account name if I display the name of the account.

    So I used a combined analysis of activity report activity with itself i.e. area statement. All columns except account name in one of them where I used "instead of the name of Account.Account.

    It now also displays tasks with NULL account name. But there is another question. These activities when there is an account name, display double - double rows - an account name and othet without account name (for example, NULL).

    Please can you help how to solve above or meet the requirement in an alternative way?

    Thank you
    Niraj

    VR;

    (1. any activity with account) + (2. All activities - 3. Activities with account)

    1 account name because it is
    2 maintain a column empty "
    3 write the instruction box and change the name of the account by white ")

    Dinesh

  • Place the missing documents in the list of records with a rank value

    Hi all

    I have this table:
    WITH taba AS (SELECT 99 AS id,
                         '2011-08-08' AS date_ini,
                         10 AS VALUE,
                         1 AS RANK
                    FROM DUAL
                  UNION ALL
                  SELECT 99 AS id,
                         '2011-09-08' AS date_ini,
                         11 AS VALUE,
                         2 AS RANK
                    FROM DUAL
                  UNION ALL
                  SELECT 99 AS id,
                         '2011-10-08' AS date_ini,
                         10 AS VALUE,
                         4 AS RANK
                    FROM DUAL
                  UNION ALL
                  SELECT 999 AS id,
                         '2011-08-08' AS date_ini,
                         10 AS VALUE,
                         1 AS RANK
                    FROM DUAL
                  UNION ALL
                  SELECT 999 AS id,
                         '2011-09-08' AS date_ini,
                         10 AS VALUE,
                         2 AS RANK
                    FROM DUAL
                  UNION ALL
                  SELECT 999 AS id,
                         '2011-10-08' AS date_ini,
                         10 AS VALUE,
                         3 AS RANK
                    FROM DUAL
                  UNION ALL
                  SELECT 9999 AS id,
                         '2011-08-08' AS date_ini,
                         10 AS VALUE,
                         2 AS RANK
                    FROM DUAL
                  UNION ALL
                  SELECT 9999 AS id,
                         '2011-09-08' AS date_ini,
                         15 AS VALUE,
                         3 AS RANK
                    FROM DUAL
                  UNION ALL
                  SELECT 9999 AS id,
                         '2011-10-08' AS date_ini,
                         10 AS VALUE,
                         4 AS RANK
                    FROM DUAL)
    SELECT *
      FROM taba
    And I need to return the same results but with the addition of records that have no rank. For new records the VALUE must always be zero (0) and the value of DATA_INI must have the same value as the order of the records immediately following. Just like that:
    99       2011-08-08     10     1
    99       2011-09-08     11     2
    *99       2011-10-08     0     3*
    99       2011-10-08     10     4
    999      2011-08-08     10     1
    999      2011-09-08     10     2
    999      2011-10-08     10     3
    *9999     2011-08-08     0     1*
    9999     2011-08-08     10     2
    9999     2011-09-08     15     3
    9999     2011-10-08     10     4
    I can do this using a loop procedure, but I want a filter query. ;)

    Thanks in advance.
    Filipe Almeida

    Hi, Felipe,.

    So, you want multiple copies of a few lines. In other words, if a value or rnk (RANK is not a column name right) is missing in a given id you want to with the next highest rnk and the same id line repeated 2 or maybe even several times. All copies will be identical, except that rnk will have the missing numbers, and the value will be 0 on all additional copies.

    A way to do that is to join your table (or something very similar to it, as in the example below) to a Meter of Table , which is a table (or a result set, in this example) counts 1, 2, 3,... up to however many copies may be required.

    WITH     got_rows_needed          AS
    (
         SELECT     id, date_ini, value, rnk
         ,     rnk - LAG (rnk, 1, 0) OVER ( PARTITION BY  id
                                                ORDER BY          rnk
                                )         AS rows_needed
         FROM    taba
    )
    ,     cntr               AS
    (
         SELECT     LEVEL - 1     AS n
         FROM     (
                   SELECT     MAX (rows_needed)     AS max_rows_needed
                   FROM     got_rows_needed
              )
         CONNECT BY     LEVEL <= max_rows_needed
    )
    SELECT    r.id
    ,       r.date_ini
    ,       CASE
              WHEN  c.n  = 0
              THEN  r.value
              ELSE  0
             END               AS value
    ,       r.rnk - c.n          AS rnk
    FROM       got_rows_needed  r
    JOIN       cntr             c     ON  c.n  < r.rows_needed
    ORDER BY  id
    ,            rnk
    ;
    

    By elsewhere, store date information in a VARCHAR2 column, such as date_ini, is a very bad idea. Use a DATE column.

    Published by: Frank Kulash, August 8, 2012 11:02

    RANK is a keyword from Oracle. (It is the name of a built-in function). If you specify your own columns of RANK, it will confuse people reading the code, and it can result in compiler errors, too.
    ID is also an Oracle keyword. To be sure, you can use another name, such as grp_id, instead of id.
    It is best not to name your own objects with any name of fArrondi in v$ reserrved_words.keyword.

  • How to create a new record with the old values

    Hi all

    I have the creation with 45 page are there fields
    the user will enter all areas and save, it will call the uneditable mode

    If the change button is clicked it will call for the editable mode

    My requirement is user will not change among these ites (45 items) clcik on save again it will call to view mode

    in this user will change one value among 45 Articles and click on the button Save I need to create more than one record in the database

    If the user will not modify one of the field elements of the 45 I will not create a new record in the database

    How can we achieve this feature


    Concerning
    Anthony

    Hi Mary,

    Please try this method to copy a line in the new line...

    public void copy()
    {
    Pervert SuppliersVOImpl = getSuppliersVO1();
    Rank rank [] = pervo.getFilteredRows ("SelectFlag", "Y");
    for (int i = 0; i)<>
    {
    Rowi rank (SuppliersVORowImpl)= SuppliersVORowImpl;
    OADBTransaction trx (OADBTransaction) = getTransaction ();
    Number b = trx.getSequenceValue ("FWK_TBX_SUPPLIERS_S");
    AttributeList a rowi = (AttributeList);
    R = (SuppliersVORowImpl) pervo.createAndInitRow SuppliersVORowImpl (a);
    Define your unique attribute values here, I'll put here Ref supplier as with each new line, it must be different.
    r.setSupplierId (b);
    pervo.insertRow (r);
    }
    }

    Kind regards
    Out Sharma

  • Use Insert all but want only to insert records for non-null values

    Hi, New here and could use some help with my sql statement.  I have a portfolio with denormalized data table that has been inserted via .csv file.  It is a contract with a base, options and extensions.  I need to create a contract record, then a separate record in the table for each base/option/extension contract Details.  I use INSERT ALL so I maintain the CONTRACT_ID for the secondary table.  My problem is that my statement puts a line in the table of details for the null records, that I don't want.  (i.e. 123 contract has a Base, Option 1, Option 2 and Option 3, but I'm getting a line for these lines with dates more null for Option 4, Ext 1, Ext 2, Ext 3 and Ext 4).  I want to insert only when the % CTRT_STRT_DT is NOT NULL.  It will be different for each contract.  Where should I put the IS NOT NULL statement?  Here is my complete insert statement:

    -Contract data

    INSERT ALL

    IN LRTC)

    CTRT_ID,

    PRGRM_OFC_TYP_CD,

    CTRT_NME,

    CREN_DT)

    VALUES)

    CTRT_ID_SEQ. NEXTVAL,

    PRGRM_OFC_TYP_CD,

    SPLS_SRVS_DESC,

    SYSDATE)

    -Contract detail for another period of performance data

    IN CTRT_DTLS)

    CTRT_ID,

    CTRT_STAT_CD,

    CTRT_PER_NME,

    CTRT_STRT_DT,

    CTRT_END_DT,

    CTRT_CURR_AMT,

    CTRT_NO,

    CTRT_VNDR_NME,

    CREN_DT)

    VALUES)

    CTRT_ID_SEQ. NEXTVAL,

    1,

    "Other."

    OTHER_CTRT_STRT_DT,

    OTHER_CTRT_END_DT,

    OTHER_CTRT_CURR_AMT,

    CTRT_NO,

    CTRTR_NME,

    SYSDATE)

    -Contract detail data for the reference period of performance

    IN CTRT_DTLS)

    CTRT_ID,

    CTRT_STAT_CD,

    CTRT_PER_NME,

    CTRT_STRT_DT,

    CTRT_END_DT,

    CTRT_CURR_AMT,

    CTRT_NO,

    CTRT_VNDR_NME,

    CREN_DT)

    VALUES)

    CTRT_ID_SEQ. NEXTVAL,

    1,

    'Base ',.

    BASE_CTRT_STRT_DT,

    BASE_CTRT_END_DT,

    BASE_CTRT_CURR_AMT,

    CTRT_NO,

    CTRTR_NME,

    SYSDATE)

    -Data contract detail for Option 1 execution time-out

    IN CTRT_DTLS)

    CTRT_ID,

    CTRT_STAT_CD,

    CTRT_PER_NME,

    CTRT_STRT_DT,

    CTRT_END_DT,

    CTRT_CURR_AMT,

    CTRT_NO,

    CTRT_VNDR_NME,

    CREN_DT)

    VALUES)

    CTRT_ID_SEQ. NEXTVAL,

    1,

    "Option 1",

    OPT1_CTRT_STRT_DT,

    OPT1_CTRT_END_DT,

    OPT1_CTRT_CURR_AMT,

    CTRT_NO,

    CTRTR_NME,

    SYSDATE)

    -Data contract detail for Option 2 execution time-out

    IN CTRT_DTLS)

    CTRT_ID,

    CTRT_STAT_CD,

    CTRT_PER_NME,

    CTRT_STRT_DT,

    CTRT_END_DT,

    CTRT_CURR_AMT,

    CTRT_NO,

    CTRT_VNDR_NME,

    CREN_DT)

    VALUES)

    CTRT_ID_SEQ. NEXTVAL,

    1,

    'Option 2',

    OPT2_CTRT_STRT_DT,

    OPT2_CTRT_END_DT,

    OPT2_CTRT_CURR_AMT,

    CTRT_NO,

    CTRTR_NME,

    SYSDATE)

    -Data contract detail for Option 3 lead time

    IN CTRT_DTLS)

    CTRT_ID,

    CTRT_STAT_CD,

    CTRT_PER_NME,

    CTRT_STRT_DT,

    CTRT_END_DT,

    CTRT_CURR_AMT,

    CTRT_NO,

    CTRT_VNDR_NME,

    CREN_DT)

    VALUES)

    CTRT_ID_SEQ. NEXTVAL,

    1,

    'Option 3',

    OPT3_CTRT_STRT_DT,

    OPT3_CTRT_END_DT,

    OPT3_CTRT_CURR_AMT,

    CTRT_NO,

    CTRTR_NME,

    SYSDATE)

    -Data contract detail for Option 4 execution time-out

    IN CTRT_DTLS)

    CTRT_ID,

    CTRT_STAT_CD,

    CTRT_PER_NME,

    CTRT_STRT_DT,

    CTRT_END_DT,

    CTRT_CURR_AMT,

    CTRT_NO,

    CTRT_VNDR_NME,

    CREN_DT)

    VALUES)

    CTRT_ID_SEQ. NEXTVAL,

    1,

    'Option 4',

    OPT4_CTRT_STRT_DT,

    OPT4_CTRT_END_DT,

    OPT4_CTRT_CURR_AMT,

    CTRT_NO,

    CTRTR_NME,

    SYSDATE)

    -Data contract detail for Extension 1 execution time-out

    IN CTRT_DTLS)

    CTRT_ID,

    CTRT_STAT_CD,

    CTRT_PER_NME,

    CTRT_STRT_DT,

    CTRT_END_DT,

    CTRT_CURR_AMT,

    CTRT_NO,

    CTRT_VNDR_NME,

    CREN_DT)

    VALUES)

    CTRT_ID_SEQ. NEXTVAL,

    1,

    'Extension 1',

    EXT1_CTRT_STRT_DT,

    EXT1_CTRT_END_DT,

    EXT1_CTRT_CURR_AMT,

    CTRT_NO,

    CTRTR_NME,

    SYSDATE)

    -Data contract detail for Extension 2 execution time-out

    IN CTRT_DTLS)

    CTRT_ID,

    CTRT_STAT_CD,

    CTRT_PER_NME,

    CTRT_STRT_DT,

    CTRT_END_DT,

    CTRT_CURR_AMT,

    CTRT_NO,

    CTRT_VNDR_NME,

    CREN_DT)

    VALUES)

    CTRT_ID_SEQ. NEXTVAL,

    1,

    '2 Extension',

    EXT2_CTRT_STRT_DT,

    EXT2_CTRT_END_DT,

    EXT2_CTRT_CURR_AMT,

    CTRT_NO,

    CTRTR_NME,

    SYSDATE)

    -Data contract detail for Extension 3 lead time

    IN CTRT_DTLS)

    CTRT_ID,

    CTRT_STAT_CD,

    CTRT_PER_NME,

    CTRT_STRT_DT,

    CTRT_END_DT,

    CTRT_CURR_AMT,

    CTRT_NO,

    CTRT_VNDR_NME,

    CREN_DT)

    VALUES)

    CTRT_ID_SEQ. NEXTVAL,

    1,

    '3 Extension',

    EXT3_CTRT_STRT_DT,

    EXT3_CTRT_END_DT,

    EXT3_CTRT_CURR_AMT,

    CTRT_NO,

    CTRTR_NME,

    SYSDATE)

    -Data contract detail for Extension 4 execution time-out

    IN CTRT_DTLS)

    CTRT_ID,

    CTRT_STAT_CD,

    CTRT_PER_NME,

    CTRT_STRT_DT,

    CTRT_END_DT,

    CTRT_CURR_AMT,

    CTRT_NO,

    CTRT_VNDR_NME,

    CREN_DT)

    VALUES)

    CTRT_ID_SEQ. NEXTVAL,

    1,

    '4 Extension',

    EXT4_CTRT_STRT_DT,

    EXT4_CTRT_END_DT,

    EXT4_CTRT_CURR_AMT,

    CTRT_NO,

    CTRTR_NME,

    SYSDATE)

    SELECT

    PRGRM_OFC_TYP_CD,

    SPLS_SRVS_DESC,

    CTRT_NO,

    CTRTR_NME,

    To_date(PER_OF_PFRM_OTHER_ST_DT,'MM/DD/YYYY') as OTHER_CTRT_STRT_DT,

    To_date(PER_OF_PFRM_OTHER_END_DT,'MM/DD/YYYY') as OTHER_CTRT_END_DT,

    CUR_VAL_BY_POP_OTHER_AMT as OTHER_CTRT_CURR_AMT,

    To_date(PER_OF_PFRM_BASE_ST_DT,'MM/DD/YYYY') as BASE_CTRT_STRT_DT,

    To_date(PER_OF_PFRM_BASE_END_DT,'MM/DD/YYYY') as BASE_CTRT_END_DT,

    CUR_VAL_BY_POP_BASE_AMT as BASE_CTRT_CURR_AMT,

    To_date(PER_OF_PFRM_OPT1_ST_DT,'MM/DD/YYYY') as OPT1_CTRT_STRT_DT,

    To_date(PER_OF_PFRM_OPT1_END_DT,'MM/DD/YYYY') as OPT1_CTRT_END_DT,

    CUR_VAL_BY_POP_OPT1_AMT as OPT1_CTRT_CURR_AMT,

    To_date(PER_OF_PFRM_OPT2_ST_DT,'MM/DD/YYYY') as OPT2_CTRT_STRT_DT,

    To_date(PER_OF_PFRM_OPT2_END_DT,'MM/DD/YYYY') as OPT2_CTRT_END_DT,

    CUR_VAL_BY_POP_OPT2_AMT as OPT2_CTRT_CURR_AMT,

    To_date(PER_OF_PFRM_OPT3_ST_DT,'MM/DD/YYYY') as OPT3_CTRT_STRT_DT,

    To_date(PER_OF_PFRM_OPT3_END_DT,'MM/DD/YYYY') as OPT3_CTRT_END_DT,

    CUR_VAL_BY_POP_OPT3_AMT as OPT3_CTRT_CURR_AMT,

    To_date(PER_OF_PFRM_OPT4_ST_DT,'MM/DD/YYYY') as OPT4_CTRT_STRT_DT,

    To_date(PER_OF_PFRM_OPT4_END_DT,'MM/DD/YYYY') as OPT4_CTRT_END_DT,

    CUR_VAL_BY_POP_OPT4_AMT as OPT4_CTRT_CURR_AMT,

    To_date(PER_OF_PFRM_EXT1_ST_DT,'MM/DD/YYYY') as EXT1_CTRT_STRT_DT,

    To_date(PER_OF_PFRM_EXT1_END_DT,'MM/DD/YYYY') as EXT1_CTRT_END_DT,

    CUR_VAL_BY_POP_EXT1_AMT as EXT1_CTRT_CURR_AMT,

    To_date(PER_OF_PFRM_EXT2_ST_DT,'MM/DD/YYYY') as EXT2_CTRT_STRT_DT,

    To_date(PER_OF_PFRM_EXT2_END_DT,'MM/DD/YYYY') as EXT2_CTRT_END_DT,

    CUR_VAL_POP_EXT2_AMT as EXT2_CTRT_CURR_AMT,

    To_date(PER_OF_PFRM_EXT3_ST_DT,'MM/DD/YYYY') as EXT3_CTRT_STRT_DT,

    To_date(PER_OF_PFRM_EXT3_END_DT,'MM/DD/YYYY') as EXT3_CTRT_END_DT,

    CUR_VAL_BY_POP_EXT3_AMT as EXT3_CTRT_CURR_AMT,

    To_date(PER_OF_PFRM_EXT4_ST_DT,'MM/DD/YYYY') as EXT4_CTRT_STRT_DT,

    To_date(PER_OF_PFRM_EXT4_END_DT,'MM/DD/YYYY') as EXT4_CTRT_END_DT,

    CUR_VAL_BY_POP_EXT4_AMT as EXT4_CTRT_CURR_AMT

    OF CTRT_HLDG A, PRGRM_OFC_TYP_LKUP B

    WHERE UPPER (A.OFC_NME) = UPPER (B.PRGRM_OFC_TYP_NME);

    Thanks for any help.

    Chris

    You're close.  Basically, you add one when befire each Inserts lines.  Something like:

    INSERT ALL

    When the ctrt_id is not null then

    IN LRTC (PRGRM_OFC_TYP_CD, CTRT_NME, CTRT_ID, CREN_DT)

    VALUES (CTRT_ID_SEQ. NEXTVAL, PRGRM_OFC_TYP_CD,

    SPLS_SRVS_DESC, SYSDATE)

    -Contract detail for another period of performance data

    When the OTHER_CTRT_STRT_DT is not null then

    IN (CTRT_ID, CTRT_STAT_CD, CTRT_PER_NME, CTRT_DTLS

    CTRT_STRT_DT, CTRT_END_DT, CTRT_CURR_AMT,

    CTRT_NO, CTRT_VNDR_NME, CREN_DT)

    VALUES (CTRT_ID_SEQ. NEXTVAL, 1, 'Other', OTHER_CTRT_STRT_DT,

    OTHER_CTRT_END_DT, OTHER_CTRT_CURR_AMT,

    CTRT_NO, CTRTR_NME, SYSDATE)

    -Contract detail data for the reference period of performance

    When the BASE_CTRT_STRT_DT is not null then

    IN (CTRT_ID, CTRT_STAT_CD, CTRT_PER_NME, CTRT_DTLS

    CTRT_STRT_DT, CTRT_END_DT, CTRT_CURR_AMT,

    CTRT_NO, CTRT_VNDR_NME, CREN_DT)

    VALUES (CTRT_ID_SEQ. NEXTVAL, 1, 'Base', BASE_CTRT_STRT_DT,

    BASE_CTRT_END_DT, BASE_CTRT_CURR_AMT, CTRT_NO,

    CTRTR_NME, SYSDATE)

    You may need to adjust my predicates, but it should give you the idea.

    John

  • Complete with matching null values

    Hi all
    Take into consideration the following:

    create table X_T2
    (
      COL1 VARCHAR2(2),
      COL2 VARCHAR2(2)
    )
    insert into x_t2 (COL1, COL2)
    values ('1', 'A');
    
    insert into x_t2 (COL1, COL2)
    values ('2', '');
    
    insert into x_t2 (COL1, COL2)
    values ('3', '');
    
    insert into x_t2 (COL1, COL2)
    values ('4', '');
    
    insert into x_t2 (COL1, COL2)
    values ('5', '');
    
    insert into x_t2 (COL1, COL2)
    values ('6', '');
    
    insert into x_t2 (COL1, COL2)
    values ('7', 'B');
    
    insert into x_t2 (COL1, COL2)
    values ('8', '');
    
    insert into x_t2 (COL1, COL2)
    values ('9', '');
    
    insert into x_t2 (COL1, COL2)
    values ('10', '');
    
    insert into x_t2 (COL1, COL2)
    values ('11', '');
    
    insert into x_t2 (COL1, COL2)
    values ('12', 'C');
    
    insert into x_t2 (COL1, COL2)
    values ('13', '');
    
    insert into x_t2 (COL1, COL2)
    values ('14', '');
    
    insert into x_t2 (COL1, COL2)
    values ('15', '');
    
    insert into x_t2 (COL1, COL2)
    values ('16', '');
    
    insert into x_t2 (COL1, COL2)
    values ('17', 'D');
    
    insert into x_t2 (COL1, COL2)
    values ('18', '');
    
    insert into x_t2 (COL1, COL2)
    values ('19', '');
    
    insert into x_t2 (COL1, COL2)
    values ('20', '');
    Required result:
    1     A
    2     A
    3     A
    4     A
    5     A
    6     A
    7     B
    8     B
    9     B
    10     B
    11     B
    12     C
    13     C
    14     C
    15     C
    16     C
    17     D
    18     D
    19     D
    20     D
    Any ideas?

    Oracle 11g


    Thanks in advance,
    Alexander.

    Hello, Alexander.

    Here's one way:

    SELECT    col1
    ,       LAST_VALUE (col2 IGNORE NULLS)
               OVER (ORDER BY  LPAD (col1, 2))     AS c2
    FROM       x_t2
    ORDER BY  LPAD (col1, 2)
    ;
    

    a.Stoyanov wrote: Hi all,.
    Take into consideration the following:

    create table X_T2
    (
    COL1 VARCHAR2(2),
    COL2 VARCHAR2(2)
    )
    
    insert into x_t2 (COL1, COL2)
    values ('1', 'A');
    ...
    

    If you want to '2' and '3' in front of '10' and 11', then you might consider col1, a NUMBER, rather than a VARCHAR2, or add a constraint (and possibly a trigger) to make sure he always has 2 characters.

    Please include the information and sample version; It's very useful!
    You didn't say if you have Oracle 11.1 or 11.2. From 11.2, there is another way to specify IGNORE NULLS; but as noted above will work in both versions (or any version starting with Oracle 10.1).

  • Find columns with only NULL values

    I have a list of tables around 30 in number. Among them i need to generate a report with Table Name and Column Names, for which all values are NULL.
    In other words, i need to find all the columns for which all the values are NULL.
    
    
    I thought of dealing it with cursors, and comparing the total count with null count in each column. But i need to loop "Number of columns" times. Is there any better way to do this?

    If your statistics are up to date, you can use the datadictionary:

    select tab.table_name
    ,      tab.num_rows
    ,      col.column_name
    ,      case
             when tab.num_rows = col.num_nulls then '*100% NULL*'
             else to_char(col.num_nulls)
           end num_nulls
    from   user_tab_columns col
    ,      user_tables tab
    where  col.table_name = tab.table_name
    and    tab.num_rows > 0
    and    tab.table_name IN (YOUR_TABLE NAMES)
    order by tab.table_name, column_id;
    

    Set the query for your needs.

  • Number of rows in each partition is displayed with a NULL value for a table partitioned in user_tab_partitions. Why?

    I created a table and partitioned on the date of the entry and added a local partitioned index.

    Now, I use a query to extract "num_rows" of user_tab_partitions to know the number of rows in each partition.

    Getting this value as null num_rows, wonder why?

    After looking to explain the Plan after interrogation ("select * from my_table1 where entry_date = 1 January 2015" ;))

    to find out if she actually partitioned table and its data in different partitions, I interpreted in effect because the query plan had a line like Partition_range (Single).

    My Question is:

    (a) is actually partitioned data (have I misinterpreted the Explain plan)

    (b) why is the num_rows null column in the query (Pasted below)

    (c) also in addition what difference it would have been if I had created a Global Index instead of the Local Index in my case?

    The following code Snippet:

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

    create the table my_table1
    (
    roll_no number constraint my_table1_pk primary key,
    date of entry_date
    )
    partition of range (entry_date)
    (
    PARTITION data_p1 VALUES LESS THAN (TO_DATE (December 31, 2014 ',' DD-MM-YYYY ""));
    PARTITION data_p2 VALUES LESS THAN (MAXVALUE)
    );


    create an index only my_table1_indx on my_table1 (entry_date) local;

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

    I now insert two lines:
    insert into my_table1 values (1, to_date ('01-01-2015', ' dd-mm-yyyy'));
    insert into my_table1 values (2, to_date('01-02-2015','dd-mm-yyyy'));

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

    These have been inserted successfully, now using the query below shows num_rows column as null. I don't know why?

    SELECT table_name, num_rows, high_value, nom_partition
    Of user_tab_partitions
    where table_name = 'MY_TABLE1 '.
    ORDER BY table_name, nom_partition;

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


    (a) is actually partitioned data (have I misinterpreted the Explain plan)

    Yes, it is partitioned. You can query this particular partition SELECT * FROM my_table1 (data_p1) PARTITION to check that.

    (b) why is the num_rows null column in the query (Pasted below)

    As already mentioned that you have not collected statistics.

    (c) also in addition what difference it would have been if I had created a Global Index instead of the Local Index in my case?

    In fact, you have created two types of indexes without knowing (can be)! One is not partitioned (although this column is not partition key) and another is partitioned (LOCAL). They are MY_TABLE1_PK and MY_TABLE1_INDX. You can check that USER_INDEXES.

    You can read this article to get an early jump on the partitioning of decision. Partition: Partition decisions

  • parameter with a null value

    I write this code to report and

    I put parameters to filter data when the user needs data

    but when he needs all the data in the report returns all data

    but the following code returns all the data when I put the settings

    SELECT get_full_name (a.user_stud_id), a.amount, a.user_stud_id, a.amount_detial,

    a.std_cost_id, a.grade_stud, a.twread_number, a.twread_date, a.user_move_id,

    a.move_date, a.safe_id, a.safe_name

    OF std_main_money one

    where

    std_cost_id =: P1 or: P1 is null

    and Grade_stud =: P2 or: P2 is null

    ORDER BY std_cost_id, Grade_stud, move_id, user_stud_id

    Hello

    If std_cost_id and Grade_stud are not null columns, you can also do

    SELECT get_full_name (a.user_stud_id), a.amount, a.user_stud_id, a.amount_detial,

    a.std_cost_id, a.grade_stud, a.twread_number, a.twread_date, a.user_move_id,

    a.move_date, a.safe_id, a.safe_name

    OF std_main_money one

    where

    std_cost_id =nvl(:P1,std_cost_id)

    and Grade_stud =nvl(:P2,Grade_stud)

    ORDER BY std_cost_id, Grade_stud, move_id, user_stud_id

    Best regards

  • update to column values (false) in a copy of the same table with the correct values

    Database is 10gr 2 - had a situation last night where someone changed inadvertently values of column on a couple of hundred thousand records with an incorrect value first thing in the morning and never let me know later in the day. My undo retention was not large enough to create a copy of the table as it was 7 hours comes back with a "insert in table_2 select * from table_1 to timestamp...» "query, so I restored the backup previous nights to another machine and it picked up at 07:00 (just before the hour, he made the change), created a dblink since the production database and created a copy of the table of the restored database.

    My first thought was to simply update the table of production with the correct values of the correct copy, using something like this:


    Update mnt.workorders
    Set approvalstat = (select b.approvalstat
    mnt.workorders a, mnt.workorders_copy b
    where a.workordersoi = b.workordersoi)
    where exists (select *)
    mnt.workorders a, mnt.workorders_copy b
    where a.workordersoi = b.workordersoi)

    It wasn't the exact syntax, but you get the idea, I wanted to put the incorrect values in x columns in the tables of production with the correct values of the copy of the table of the restored backup. Anyway, it was (or seem to) works, but I look at the process through OEM it was estimated 100 + hours with full table scans, so I killed him. I found myself just inserting (copy) the lines added to the production since the table copy by doing a select statement of the production table where < col_with_datestamp > is > = 07:00, truncate the table of production, then re insert the rows from now to correct the copy.

    Do a post-mortem today, I replay the scenario on the copy that I restored, trying to figure out a cleaner, a quicker way to do it, if the need arise again. I went and randomly changed some values in a column number (called "comappstat") in a copy of the table of production, and then thought that I would try the following resets the values of the correct table:

    Update (select a.comappstat, b.comappstat
    mnt.workorders a, mnt.workorders_copy b
    where a.workordersoi = b.workordersoi - this is a PK column
    and a.comappstat! = b.comappstat)
    Set b.comappstat = a.comappstat

    Although I thought that the syntax is correct, I get an "ORA-00904: 'A'. '. ' COMAPPSTAT': invalid identifier ' to run this, I was trying to guess where the syntax was wrong here, then thought that perhaps having the subquery returns a single line would be cleaner and faster anyway, so I gave up on that and instead tried this:

    Update mnt.workorders_copy
    Set comappstat = (select distinct)
    a.comappstat
    mnt.workorders a, mnt.workorders_copy b
    where a.workordersoi = b.workordersoi
    and a.comappstat! = b.comappstat)
    where a.comappstat! = b.comappstat
    and a.workordersoi = b.workordersoi

    The subquery executed on its own returns a single value 9, which is the correct value of the column in the table of the prod, and I want to replace the incorrect a '12' (I've updated the copy to change the value of the column comappstat to 12 everywhere where it was 9) However when I run the query again I get this error :

    ERROR on line 8:
    ORA-00904: "B". "" WORKORDERSOI ": invalid identifier

    First of all, I don't see why the update statement does not work (it's probably obvious, but I'm not)

    Secondly, it is the best approach for updating a column (or columns) that are incorrect, with the columns in the same table which are correct, or is there a better way?

    I would sooner update the table rather than delete or truncate then re insert, as it was a trigger for insert/update I had to disable it on the notice re and truncate the table unusable a demand so I was re insert.

    Thank you

    Hello

    First of all, after post 79, you need to know how to format your code.

    Your last request reads as follows:

    UPDATE
      mnt.workorders_copy
    SET
      comappstat =
      (
        SELECT DISTINCT
          a.comappstat
        FROM
          mnt.workorders a
        , mnt.workorders_copy b
        WHERE
          a.workordersoi    = b.workordersoi
          AND a.comappstat != b.comappstat
      )
    WHERE
      a.comappstat      != b.comappstat
      AND a.workordersoi = b.workordersoi
    

    This will not work for several reasons:
    The sub query allows you to define a and b and outside the breakets you can't refer to a or b.
    There is no link between the mnt.workorders_copy and the the update and the request of void.

    If you do this you should have something like this:

    UPDATE
      mnt.workorders     A      -- THIS IS THE TABLE YOU WANT TO UPDATE
    SET
      A.comappstat =
      (
        SELECT
          B.comappstat
        FROM
          mnt.workorders_copy B   -- THIS IS THE TABLE WITH THE CORRECT (OLD) VALUES
        WHERE
          a.workordersoi    = b.workordersoi      -- THIS MUST BE THE KEY
          AND a.comappstat != b.comappstat
      )
    WHERE
      EXISTS
      (
        SELECT
          B.comappstat
        FROM
          mnt.workorders_copy B
        WHERE
          a.workordersoi    = b.workordersoi      -- THIS MUST BE THE KEY
          AND a.comappstat != b.comappstat
      )
    

    Speed is not so good that you run the query to sub for each row in mnt.workorders
    Note it is condition in where. You need other wise, you will update the unchanged to null values.

    I wouold do it like this:

    UPDATE
      (
        SELECT
          A.workordersoi
          ,A.comappstat
          ,B.comappstat           comappstat_OLD
    
        FROM
          mnt.workorders        A      -- THIS IS THE TABLE YOU WANT TO UPDATE
          ,mnt.workorders_copy  B      -- THIS IS THE TABLE WITH THE CORRECT (OLD) VALUES
    
        WHERE
          a.workordersoi    = b.workordersoi      -- THIS MUST BE THE KEY
          AND a.comappstat != b.comappstat
      ) C
    
    SET
      C.comappstat = comappstat_OLD
    ;
    

    This way you can test the subquery first and know exectly what will be updated.
    This was not a sub query that is executed for each line preformance should be better.

    Kind regards

    Peter

  • Remove data with null value

    Hello

    I'm using Oracle 11 g. I have a table with an id of 3, node, the value column. Combination of the column id and node, that must be taken account for deletion on the registers.

    Here, I need to delete lines with the NULL value in the value column. If for a combination of id and node with non-null values, then I need to delete rows with a null value for this combination.

    If the combination of id, node is not null value then this records should not delete.

    Below table, I need to remove the second row, for which is a value not zero VOICE CAL '10' is there, so I need to delete the row with null values. (VOICE, CAL, NULL)

    Network, FL, there is no value is non-null then I should NOT delete this line.

    This table is to have 100 s of this association, we can delete data in a single delete query?

    Or how I can delete rows with nulls for this combination.

    Tab1

    VALUE OF THE NŒUD ID

    VOICE CAL 10
    VOICE CAL NULL
    NETWORK NULL FL

    Thank you

    Hello

    oradba11 wrote:

    Hello

    I'm using Oracle 11 g. I have a table with an id of 3, node, the value column. Combination of the column id and node, that must be taken account for deletion on the registers.

    Here, I need to delete lines with the NULL value in the value column. If for a combination of id and node with non-null values, then I need to delete rows with a null value for this combination.

    If the combination of id, node is not null value then this records should not delete.

    Below table, I need to remove the second row, for which is a value not zero VOICE CAL '10' is there, so I need to delete the row with null values. (VOICE, CAL, NULL)

    Network, FL, there is no value is non-null then I should NOT delete this line.

    This table is to have 100 s of this association, we can delete data in a single delete query?

    Or how I can delete rows with nulls for this combination.

    Tab1

    VALUE OF THE NŒUD ID

    VOICE CAL 10
    VOICE CAL NULL
    NETWORK NULL FL

    Thank you

    You can do this in a single DELETE statement (it is not a request), using an EXISTS or IN the subquery.  For example:

    REMOVE table_x m

    WHERE the value IS NULL

    AND THERE ARE)

    SELECT 0

    FROM table_x s

    WHERE s.id = m.id

    AND s.node = m.node

    AND s.value IS NOT NULL

    )

    ;

    If you would care to post CREATE TABLE and INSERT instructions for the sample data, and then I could test it.

  • check NULL values with expressions

    I'm having a problem with an expression that I work with.

    I'm trying to produce a dynamic graph (among other information) that seems to be controlled by a stream - stream artificial is created by a handful of sliders and a wiggle expression.

    The chart is a simple graphic line which works very well. It is created with a null value (MarkPos) that the position is controlled by Captain wiggle expression that I've mentioned before, that follows.

    This next bit is where I have problems:

    I want to score minimum or maximum, the line has reached on the chart by moving a dotted line, one for weak points and the other for the top.

    Focus only on the bottom line;

    I have the following expression associated with the line, which brings together the current position of the value null (MarkPos) and compared with the current position of the line to see if it has all moved further away down, if she has it moving the line to the new pos are lower. However, all that happens is the line following the null value.

    x = thisComp.layer("MarkPos").transform.position.valueAtTime (time) [1];

    y = transform.position.valueAtTime (time) [1];

    z = transform.position.valueAtTime(time-thisComp.frameDuration) [1];

    If (x > y) {}

    [0, x]

    } else {}

    [0, z]

    }

    After a lot of debugging, I now know the issue is with the else statement - what his weight is compensating the to the high movement frame by frame 1 - so how do you define an order of "keep your current position in y ' in this case?

    [0.1] just it back to its original position and it is not possible to just have the ' if(x>y) {[0, x]} "bit without the"else {}.

    Suggestions fo how to fix this, or a better way to do it?

    This should give you the value of y min:

    p = thisComp.layer("MarkPos").transform.position;

    minVal = 999999;

    for (f = timeToFrames (time); f > = 0; f-) {}

    minVal = Math.min (digraph, p.valueAtTime (framesToTime (f)) [1]);

    }

    [value [0], minVal]

    and this should give you the most:

    p = thisComp.layer("MarkPos").transform.position;

    maxVal = - 999999;

    for (f = timeToFrames (time); f > = 0; f-) {}

    maxVal = Math.max (maxVal, p.valueAtTime (framesToTime (f)) [1]);

    }

    [value [0], maxVal]

    Dan

  • Best/Recommended way to record information in the Release version

    Hello

    I've searched around, but don't see any results on the issue yet. Then I would ask what is the best/recommended way to record Release version information?

    I use Momentics IDE 10.2. When I choose run or Debug, qDebug() & qWarning display information very well in the console of the IDE, but with "run" they don't show anything in the console. Tested on both Q10 & Simulator.

    Thank you

    Install your own messages QDebug Manager, do write to a file, for example newspapers newspaper. Then open a terminal on the device, navigate to the file and the type of your application:

    # tail -f logs/log
    

    to view the log file.

    Change your main.cpp along these lines:

    #include 
    
    static FILE * logFile;
    
    void logger(QtMsgType type, const char * msg)
    {
        Q_UNUSED(type);
        std::fprintf(logFile, "%s\n", msg);
        std::fflush(logFile);
    }
    
    Q_DECL_EXPORT int main(int argc, char **argv)
    {
        logFile = fopen("logs/log", "a");
        qInstallMsgHandler(logger);
        Application app(argc, argv);
    
        // Create the Application UI object, this is where the main.qml file
        // is loaded and the application scene is set.
        new ApplicationUI(&app);
    
        // Enter the application main event loop.
        return Application::exec();
    }
    

    Note: the file will be closed by the operating system, more messages are seen if you don't shut it down at the bottom of the hand. Why? because c is destorying local variables (app) at the end of the main, and who calls the string whole qt of parent-child destructor for your class of application as well.

Maybe you are looking for