Null values v IOT with primary constraint

Hi gurus.
I've overheard boss' conversation with client, who complaints that one of the columns in a system IOT table with NOT NULL and PRIMARY KEY returns nulls.
Do you have any ideas? I do not have access to this DB, I just wonder, how it could be and what are these points, that we should start with.
Thank you in advance,
Maria.

ou, sorry if I was not so clear, but I'm absolutely calm and even more: it's not my responsibility at all to fix that problem :-))
all that I wanted is just to find some weak places where the reason of the problem could exists and give it my boss while he is busy with his time consuming project (in short, i just wanted to help him to resolve it, not waiting while he will ask me to do that). nobody is in panic, everything is ok in a world.
clear description:
client has a system table (IOT) that sometimes returns null values from column with NOT NULL and PRIMARY KEY constraint. as I remember from school, it's impossible. client wonders if it's an Oracle 9i bug and upgrade to 10g will fix it, or it's a block corruption. I do't know the answer, that's why I'm asking you, Oracle's gurus.
Thank you all,
M.

Similar Messages

  • Delete after trigger returns a NULL value for the old primary key??

    I am creat an After trigger that I was using to delete a row from another table. However, the OLD value returned for my primary key is a NULL value. I have an UPDATE and an INSERT portion to this same trigger that work fine with just grabbing NEW values, but this OLD value cannot be grabbed for some reason, although it seems to work on other tables when the owner is me, the problem table is not owned by me though. Has anyone run into this before? Is there a view that I need access to from this table or perhaps a setting I need to turn on? I am at a loss. Thanks.

    Cannot reproduce with this modified trigger code … right now I believe the problem is in this part:
    BEGIN
      col_ret := vpack.vOPCollectIO(tpid, User, 'SCOTT.OINFTABL', dmltype, vdata);
    EXCEPTION
      WHEN lost_connection OR lost_connection2 THEN
        col_ret := vpack.vOPCollectIO(tpid, User, 'SCOTT.OINFTABL', dmltype, vdata);
    END;
    In schema CORE:
    SQL> create table oinftabl
      2  ( akey     number(9) primary key
      3   ,astring  varchar2(10)
      4   ,astring2 varchar2(10)
      5  );
    Table created.
    SQL>
    SQL> grant all on oinftabl to flip;
    In schema FLIP (which has “CREATE ANY TRIGGER”):
    flip@FLOP> CREATE OR REPLACE TYPE VDAT AS VARRAY(100000) OF VARCHAR2(50);
    2     /
    create or replace trigger sbt3_system_oinftabl_x
    after insert or update or delete on core.oinftabl
    REFERENCING NEW as n OLD as o
    FOR EACH ROW
    DECLARE
      col_ret INT;
      dmltype CHAR(1);
      tpid VARCHAR2(30);
      vdata VDAT; --varray datatype I created;
      lost_connection EXCEPTION;
      lost_connection2 EXCEPTION;
      already_there EXCEPTION;
      PRAGMA EXCEPTION_INIT(lost_connection, -28576);
      PRAGMA EXCEPTION_INIT(lost_connection2, -28579);
      PRAGMA EXCEPTION_INIT(already_there,-1);
    BEGIN
      tpid := SYS.DBMS_TRANSACTION.LOCAL_TRANSACTION_ID();
      IF INSERTING THEN dmltype := 'I';
      ELSIF UPDATING THEN dmltype := 'U';
      ELSE dmltype := 'D';
      END IF;
      IF INSERTING OR UPDATING THEN
        dbms_output.put_line('new akey='||nvl(to_char(:n.akey),'null'));
        dbms_output.put_line('new astring='||:n.astring);
        vdata := VDAT(
        to_char(:n.AKEY),
        :n.ASTRING,
        :n.ASTRING2,
        NULL);
      ELSIF DELETING THEN
        dbms_output.put_line('old akey='||nvl(to_char(:o.akey),'null'));
        vdata := VDAT(
          to_char(:o.AKEY),
          NULL);
      END IF;
      for i in 1..vdata.count
      loop
        dbms_output.put_line('vdata('||i||')='||nvl(vdata(i),'null'));
      end loop;
    --BEGIN
    --  col_ret := vpack.vOPCollectIO(tpid, User, 'SCOTT.OINFTABL', dmltype, vdata);
    --EXCEPTION
    --  WHEN lost_connection OR lost_connection2 THEN
    --    col_ret := vpack.vOPCollectIO(tpid, User, 'SCOTT.OINFTABL', dmltype, vdata);
    --END;
    END;
    Trigger created.
    flip@FLOP> show errors
    No errors.
    flip@FLOP> insert into core.oinftabl values (1,'abc',null);
    new akey=1
    new astring=abc
    vdata(1)=1
    vdata(2)=abc
    vdata(3)=null
    vdata(4)=null
    1 row created.
    flip@FLOP>  update core.oinftabl set akey=2, astring='cba' where akey=1;
    new akey=2
    new astring=cba
    vdata(1)=2
    vdata(2)=cba
    vdata(3)=null
    vdata(4)=null
    1 row updated.
    flip@FLOP> delete from core.oinftabl where akey=2;
    old akey=2
    vdata(1)=2
    vdata(2)=null
    1 row deleted.
    So the trigger has the OLD AKEY value when DELETING and it does successfully store it in the VARRAY.
    Hence the problem is in that pl/sql block at the end.
    What are you doing in there?

  • In which case composite primary key allows NULL values in it

    Hi to all
    In what case composite primary key allows nulls in it.
    Let us suppose, I created a composite primary key with 2 attributes.
    CREATE TABLE sample
    BNK_Id NUMBER(6),
    BNK_Name VARCHAR2(20),
    CONSTRAINT BNK_Id_Name_PK PRIMARY KEY(BNK_Id,BNK_Name)
    When it allows null values in it.
    thanks in advance

    Are you sure that your instructor was not talking about unique keys? As Solomon said, a primary key always implies not null on all of the columns of the PK. However a unique key does not automatically imply not null, and can have nulls in a column as long as the values in the populated columns are unique.
    SQL> create table test (
      2     id number,
      3     pid number,
      4     descr varchar2(10));
    Table created.
    SQL> alter table test add constraint test_unq
      2     unique (id, pid);
    Table altered.
    SQL> insert into test values (1, null, 'desc1');
    1 row created.
    SQL> insert into test values (2, null, 'desc2');
    1 row created.
    SQL> insert into test values (2, null, 'fail1');
    insert into test values (2, null, 'fail1')
    ERROR at line 1:
    ORA-00001: unique constraint (OPS$ORACLE.TEST_UNQ) violatedJohn

  • Oracle 11.1.0.7.0 Issue with Streams when using NULL value in a key field

    Hi,
    we have an issue in our replicated environment using Streams.
    We have a replicated table using the following index:
    UK_S01_TEXT_FORMAT_TBL01 SOGID
    UK_S01_TEXT_FORMAT_TBL01 INDEX_TEXT_FORMAT_ID
    UK_S01_TEXT_FORMAT_TBL01 INDEX_LANGUAGE_LABEL
    UK_S01_TEXT_FORMAT_TBL01 INDEX_TEXT_FORMAT_COUNTER
    UK_S01_TEXT_FORMAT_TBL01 INDEX_PROVIDER_ID
    UK_S01_TEXT_FORMAT_TBL01 INDEX_TARIFF_PLAN_COSP_ID
    with field INDEX_PROVIDER_ID allowing NULL values. Actually we insert empty strings in there, but as far as I understand Oracle will convert it sliently in a NULL value, which is fine to our application.
    When we apply a change on that table (either update or delete) we get errors at streams level and the transaction is not propagated.
    Local Transaction ID: 6.28.11170
    Source Commit SCN: 25397175
    Source Commit Time: Dec-03-2012 12:21:30
    Error in Message: 1
    Error Message: ORA-26787: The row with key ("INDEX_LANGUAGE_LABEL", "INDEX_PROVIDER_ID", "INDEX_TARIFF_PLAN_COSP_ID", "INDEX_TEXT_FORMAT_COUNTER", "INDEX_TEXT_FORMAT_ID", "SOGID") = (ITALIAN, , , 0, MIKE, 124) does not exist in table
    SMS.S01_TEXT_FORMAT_TBL
    ORA-01403: no data found
    message: 1
    TableName: S01_TEXT_FORMAT_TBL
    Operation Type: DELETE
    _____ Old Data _____
    SOID : 1010000008
    SOGID : 124
    INDEX_TEXT_FORMAT_ID : MIKE
    INDEX_LANGUAGE_LABEL : ITALIAN
    INDEX_TEXT_FORMAT_COUNTER : 0
    TEXT_FORMAT : Hai raggiunto i 100MB di traffico incluso nello scatto
    APPLICA_PERIOD_CRI_ID :
    INDEX_TARIFF_PLAN_COSP_ID :
    INDEX_PROVIDER_ID :
    If I force the set of primary keys to be only the NOT NULL fields, I can successfully apply the error, but since we may have them storing both NULL and NOT NULL values, this is not a solution.
    I'm wondering why the DB on one hand converts the empty string in a NULL while inserting, but it looks the Apply process onStandby is not able to do the same when looking for the record before applying the transaction.
    Thanks in advance!
    Cheers,
    Mike

    Its showing all objects the user has permission to see- why does that need to be restricted?

  • Sql query slowness due to rank and columns with null values:

        
    Sql query slowness due to rank and columns with null values:
    I have the following table in database with around 10 millions records:
    Declaration:
    create table PropertyOwners (
    [Key] int not null primary key,
    PropertyKey int not null,    
    BoughtDate DateTime,    
    OwnerKey int null,    
    GroupKey int null   
    go
    [Key] is primary key and combination of PropertyKey, BoughtDate, OwnerKey and GroupKey is unique.
    With the following index:
    CREATE NONCLUSTERED INDEX [IX_PropertyOwners] ON [dbo].[PropertyOwners]    
    [PropertyKey] ASC,   
    [BoughtDate] DESC,   
    [OwnerKey] DESC,   
    [GroupKey] DESC   
    go
    Description of the case:
    For single BoughtDate one property can belong to multiple owners or single group, for single record there can either be OwnerKey or GroupKey but not both so one of them will be null for each record. I am trying to retrieve the data from the table using
    following query for the OwnerKey. If there are same property rows for owners and group at the same time than the rows having OwnerKey with be preferred, that is why I am using "OwnerKey desc" in Rank function.
    declare @ownerKey int = 40000   
    select PropertyKey, BoughtDate, OwnerKey, GroupKey   
    from (    
    select PropertyKey, BoughtDate, OwnerKey, GroupKey,       
    RANK() over (partition by PropertyKey order by BoughtDate desc, OwnerKey desc, GroupKey desc) as [Rank]   
    from PropertyOwners   
    ) as result   
    where result.[Rank]=1 and result.[OwnerKey]=@ownerKey
    It is taking 2-3 seconds to get the records which is too slow, similar time it is taking as I try to get the records using the GroupKey. But when I tried to get the records for the PropertyKey with the same query, it is executing in 10 milliseconds.
    May be the slowness is due to as OwnerKey/GroupKey in the table  can be null and sql server in unable to index it. I have also tried to use the Indexed view to pre ranked them but I can't use it in my query as Rank function is not supported in indexed
    view.
    Please note this table is updated once a day and using Sql Server 2008 R2. Any help will be greatly appreciated.

    create table #result (PropertyKey int not null, BoughtDate datetime, OwnerKey int null, GroupKey int null, [Rank] int not null)Create index idx ON #result(OwnerKey ,rnk)
    insert into #result(PropertyKey, BoughtDate, OwnerKey, GroupKey, [Rank])
    select PropertyKey, BoughtDate, OwnerKey, GroupKey,
    RANK() over (partition by PropertyKey order by BoughtDate desc, OwnerKey desc, GroupKey desc) as [Rank]
    from PropertyOwners
    go
    declare @ownerKey int = 1
    select PropertyKey, BoughtDate, OwnerKey, GroupKey
    from #result as result
    where result.[Rank]=1
    and result.[OwnerKey]=@ownerKey
    go
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to transfer database table contain null values, primary key, and foreign key to the another database in same server. using INSERT method.

    how to transfer database table contain null values, primary key, and foreign key to the another database in same server. using INSERT method.  thanks

    INSERT targetdb.dbo.tbl (col1, col2, col3, ...)
       SELECT col1, col2, col3, ...
       FROM   sourcedb.dbo.tbl
    Or what is your question really about? Since you talke about foreign keys etc, I suspect that you want to transfer the entire table definition, but you cannot do that with an INSERT statement.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • JDBC MS Access--- cannot extract entry with null value with data type Meta

    I'm trying to extract a data entry with null value by using JDBC. The database is MS Access.
    The question is how to extract null entry with data type memo? The following code works when the label has data type Text, but it throws sqlException when the data type is memo.
    Any advice will be appreciated! thanks!
    Following are the table description and JDBC code:
    test table has the following attributes:
    Field name Data Type
    name Text
    label Memo
    table contents:
    name label
    me null
    you gates
    Code:
    String query = "SELECT name, label FROM test where name like 'me' ";
    ResultSet rs = stmt.executeQuery(query);
    while (rs.next())
    String name = rs.getString("name");
    rs.getString("val");
    String label = rs.getString("label");
    System.out.println("\t"+name+"\t"+label);
    catch (SQLException ex)
    System.out.println(ex.getSQLState());
    System.out.println(ex.getErrorCode());
    System.out.println("in sqlexception");
    output:
    C:\Temp\SEFormExtractor>java DBTest
    yet SELECT name, label FROM test
    null
    0
    in sqlexception

    The question is how to extract null entry with data type memo?Okay, what you need to do is this:
    if (rs.getString("val") == null)
      // do something
    }This way, when it's a null value, you can check it first, and then handle it how you want, rather than getting an exception.

  • How to validate if a column have NULL value, dont show a row with MDX

    Hello,
    I have this situation, I have a Result from MDX that return rows with values NULL on columns, I tried with NON EMPTY and NONEMPTY but the result is the same. That I want to do is validate if a column have a Null value discard the row, but I dont know how
    to implement it, could somebody help me?, please.
    Thanks a lot.
    Sukey Nakasima
    Sukey Nakasima

    Hello,
    I found the answer in this link https://social.technet.microsoft.com/Forums/sqlserver/en-US/f9c02ce3-96b2-4cd6-921f-3679eb22d790/dont-want-to-cross-join-with-null-values-in-mdx?forum=sqlanalysisservices
    Thanks a lot.
    Sukey Nakasima
    Sukey Nakasima

  • Need help with NULL values in Crosstables

    Hello everybody,
    I need some help with NULL values and crosstables. My issue is the following:
    I have a query (BW - MDX-Query) that gives me turnover measures for each month. In Crystal Reports I choose crosstable to display this whereby I put all month in columns and all turnover-measures in rows. Each month that has a value (measures are not empty) is chown in the crosstables rows. So far so good. The problem occures when there are month that actually have no values (measures are empty). In that case these months are not chown in columns. But I need CR to display these columns and show the value 0. How can I do that?

    Hi Frank,
    Cross tab shows the data based on your column and these column fields are grouped and based on the group it will show your summaries. 
    If there is no data for any of your group it will not display that group.  In this case you will have to create a standard report which should look like cross tab and to get zero values you need to write formulas .
    Example if you want to display Moth wise sales :
    if Month() = 01 Then
    sum() else 0
    Now this formula will check if your month is Jan, then it will sum up the values else it will display zero value. 
    This is possible only through standard report not with Cross Tab.
    Thanks,
    Sastry

  • Does Endeca Integrator Loads Attribute with Null value?

    I have a table in DB , with a column , lets say, supply_id. This is null for all rows.
    When i load data from this table using clover ETL graph and lets say source this data to another table , will my final table will have a column as supply_id?
    Or will this column will get dumped.
    I discussed on clover etl forum, it seems this column will be picked. However, when we use EID Intgrator the column is getting dropped always..
    I tried a sample graph passing an attribute having null value and having property nullable=true. But still it was dropped.
    I posted same question on clover etl forum long back. They explained its not something out of the box from Clover but a change Oracle EID made to the engine.
    http://forum.cloveretl.com/viewtopic.php?f=4&t=6508
    Could you please confirm if this is expected behavior and if so , is there any workaround?

    Yes, if an attribute doesn't contain any values that attribute doesn't exist in the Endeca Server. Why do you want an attribute that doesn't contain values?

  • Problem with QofQ and Null Values

    Just converted from CF5 to CF7. Finally figured out what was
    causing the error message :
    "The value "" cannot be converted to a number" when running a
    QofQ. It happens whenever there is a NULL (and I think a ZERO)
    value in the QofQ. I'm using the QofQ in a seperate chart program.
    The main query merges data from a store and a region table.
    I'm doing a LEFT OUTER JOIN to combine the REGION with the STORE,
    AND so that stores with NO SALES for a given day will show up as
    ZERO. On the main report, when I don't use a QofQWhen grouping by
    DAY or MONTH, I can test the value in the CFOUTPUT for NULL or ZERO
    and display "0" or "N/A" on the report.
    But when I try to chart it, using a QofQ to read in the
    values from the main query, and format the numbers, I get this
    error message. I've tried using the CAST function, using FLOAT,
    DOUBLE, BIGINT, etc., but still get same error message.
    The only way I could fix this is to add a WHERE statement to
    the QofQ, that only includes sales values greater than ZERO. But
    then, I have gaps in my chart because stores with NO SALES for a
    given day or MONTH don't appear. Because they are removed from the
    query. The whole point of LEFT JOINS is to include items with no
    values (or NULL) values.
    Does anyone know if it's possible to keep these values in a
    QofQ? So that items (e.g., store locations in my case) with NULL or
    ZERO values for some or all days or months can be charted? Even
    with a ZERO value? I've read everything I can get my hands on
    regarding QofQ, the CAST function, etc., but nothing seems to work.
    Thanks for any help. (FYI, didn't have this problem with CF5. It's
    QofQ could handle NULL or ZERO values without providing an error).
    Gary

    Well, I tried the IsNull function on the 3 SUM() values I was
    calculating in my SELECT statement (on a LEFT OUTER JOIN QUERY),
    and I STILL got another "cannot convert "" to a number" but this
    time the error message was more direct, and pointed me to a DATE
    field in my query, where I was SORTING AND GROUPING either by DAY
    or MONTH (depending on what user selected on form).
    In my QofQ, I'm not just reformating the integer SUM()
    values, but also the date values. So, I applied the IsNull()
    function to the DATE values in my main query. I still kept getting
    errors. But after experimenting ((SQL Server BOL docs doesn't give
    ISNULL() examples for DATE FIELDS, only NUMBER fields), I tried
    putting the dates in SINGLE QUOTES in my IsNull() function, the
    QUERY RAN. Then I wasn't sure WHAT date to enter, e.g., 1/1/1889 or
    1/1/2001, etc.
    Then, I discovered, after experimenting, that you cannot just
    blindly enter ANY date when using IsNull in a date field,
    especially if you are using CFGRAPH to chart the results by day.
    You have to select a date within the date range the user selected,
    so this means using the FORM.DATE (or URL.DATE) value from the
    form. Here's the working example from my SELECT main query:
    SELECT SUM(ISNULL(d.ttldb,0)) AS SumOfDB,
    SUM(ISNULL(d.ttldbv,0)) AS SumOfDBV,
    SUM(ISNULL(d.ttldbi,0)) AS SumOfDBI,
    <CFIF '#url.reptype#' IS "DAILY">
    ISNULL(d.depday, '#url.date1#') AS depday
    <CFELSE>
    month(ISNULL(d.depday, '#url.date2#')) AS TranMonth,
    year(ISNULL(d.depday, '#url.date2#')) AS TranYear
    </CFIF>
    Then I discovered that whatever date was used in the URL.DATE
    field (in my case it would be one of the two date field from the
    form, and depended on whether you coded DATE1 or DATE2, the chart
    would always show ZERO values for that date. So I tried putting the
    IsNull() date values in the GROUP BY and ORDER BY statements, e.g.,
    <CFIF '#url.reptype#' IS "DAILY">
    GROUP BY ISNULL(d.depday, '#url.date1#')
    ORDER BY ISNULL(d.depday, '#url.date1#') DESC
    <CFELSE>
    GROUP BY year(ISNULL(d.depday, '#url.date2#')),
    month(ISNULL(d.depday, '#url.date2#'))
    ORDER BY year(ISNULL(d.depday, '#url.date2#')),
    month(ISNULL(d.depday, '#url.date2#'))
    </CFIF>
    And this worked. The report ran just fine, and the chart
    charted every value correctly.
    I guess you have to learn all the little "quirks" about CF7
    and how it's QofQ and chart programs work. But so far, so good.
    Thank you all for your help. Now I've got to update other old
    CF5 programs that are returning errors when there are null values
    from my LEFT OUTER JOIN queries. Will take some time, but at least
    I know how to do it. Thanks to your help.
    I really appreciate your time and efforts to help with this
    issue.
    Gary

  • How to create a dimension object in SAP BW Unv with Null value

    Hello,
    for query syncronisation task, I need a dimension object in my BW universe with NULL value. Does someone know, how to do it or if its possible?
    Regards,
    Thilo

    Hi Thilo,
    so the only common item is Material then - correct ?
    Query 1                                                                                Query 2
    Formulation (grouping of materials)                                                  (No counterpart)
    Material                                                                                Material
    dummy key figure (why?)                                                                Company Code
                                                                                    10 Keyfigure
    Is this something you regular have to do ? what about a MultiProvider ?
    did you try "merged dimensions" in the Web Intelligence Report ?
    Ingo

  • Getting null value while parsing "XML String" with  encoding WINDOWS-1252.

    Hi,
    when I am converting the Follwoing "xml string " to Document, I am getting the "null" as a document value.
        String strXML =  "<?xml version="1.0" encoding="WINDOWS-1252"?>
                              <category name="SearchByAttributes" value="Search By Attributes">
                                <item name="ORDER_LINE_ID" description="Application Search Attributes" >
                                   <attribute name="Sequence" value="0001"/>
                                 </item>
                                </category>"      
    My "xml string" has the encoding vaule: WINDOWS-1252.
    I am using the following code to convert the "xml string" to Document. I am getting the Document values as a "null" while converting the above "string xml"
            String strXML = //my above string xml.
            DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
            docBuilderFactory.setIgnoringElementContentWhitespace(true);
            docBuilder = docBuilderFactory.newDocumentBuilder();
            doc = docBuilder.parse(new InputSource(new StringReader(strXML)));              
            System.out.println("doc value.."+doc)//I am getting null value for "doc".
    Can anyone help me to resolve the issue.

    Thagelapally wrote:
    I am coverting the below "XML string" to Document, once it is converted I am reading that Document,which have an "attribue" Element in.
      String strXML = "<?xml version="1.0" encoding="WINDOWS-1252"?>
    <category name="SearchByAttributes" value="Search By Attributes">
    <item name="ORDER_LINE_ID" description="Application Search Attributes" >
    <attribute name="Sequence" value="0001"/>
    </item>
    </category>" I am using the above code to read the Document. When run the code in "OC4J Server" and using Jdeveloper as an editor,I am able to perfectly read the "attribute" element in the document with out any problem.Println statement printing as I expected.
    System.out.println("Element Name..."+listOfAtt.getNodeName());
    //getting Element Name as...."attribute"(as expected)
    System.out.println("Element Attibrute list....."+elementAtt);
    //getting Element Attribute list as an...."oracle.xml.parser.v2.XMLAttrList@afe"But when run the same code(reading the same Document) in Tomcat and Eclipse,println satatement not printing as i expected.
    System.out.println("Element Name..."+listOfAtt.getNodeName());
    //getting Element Name as...."#text"(I am expecting output value "attribute" but it is printing "#text" which i don't know)
    System.out.println("Element Attibrute list....."+elementAtt);
    //getting Element Attribute list as an...."null"(I am expecting output value object reference but it is printing "null"
    (without the rest of the code, i'm guessing that) most likely you are grabbing the first child node of the item element. however, you are not accounting for some text nodes that are most likely in that list, like the whitespace between the item element and the attribute element. please go read some tutorials on xml, there are thousands of them out there, and they will answer all you initial questions much more efficiently than posting each step to the forums.

  • Problem in summation on a column with possible null values

    Hi,
    I want to do summation on a column.
    If I use <?sum(amount)?>, if there is any null value,its giving NaN as output.
    From the forum I got the below syntax
    <?sum(AMOUNT[number(.)!='NaN'])?>
    but it is also not giving me the expected result. Its always displays 0.
    I want some thing like sum(NVL(amount,0)). Could some body please help me out?
    Thanks in Advance,
    Thiru

    If the column has many, many null values, and you want to use the index to identify the rows with non-null values, this is a good thing, as a B*Tree index will not index the nulls at all, so, even though your table may be very large, with many millions of rows, this index will be small and efficient, cause it will only contain index entries for those rows where the column is not null.
    Hope that helps,
    -Mark

  • How to replace a "notfound" output with a null value?

    hi,
    I'm just getting a output of "Rows Notfound" for a script..
    instead of this , i just need to show the output with a record as null value or some value..
    do we have any option to use this in oracle..

    Apart from capturing with an exception in PL/SQL code, if you're wanting something in a script as pure SQL, you'd have to generate an additional row and only select that where no data is found e.g...
    SQL> ed
    Wrote file afiedt.buf
      1  select ename from emp where ename = 'FRED'
      2  union all
      3* select 'No Data' from dual where not exists (select * from emp where ename = 'FRED')
    SQL> /
    ENAME
    No Data
    SQL>Of course this does effectively double-up on the queries being executed, so if you're dealing with a heavily complex query, it may be best just just have the regular exception come out, but then this will also depend on your actual requirements and why you want to do this in the first place.

Maybe you are looking for

  • How do I find the number of physical CPUs , number of cores in OEL ?

    In RHEL , it is easy to find the number of Physical CPUs and the number of cores within each CPU -- Ouput from Red Hat Enterprise Linux 5.4 -- This a real machine. Not a VM $ cat /proc/cpuinfo processor       : 0 vendor_id       : GenuineIntel cpu fa

  • Where can I get fancy text fonts for Adobe Photoshop?

    I have Adobe Photoshop CS(old) and I would like to know where I can obtain fancy fonts for some creative designing. Please see sample attached. Thanks in advance.

  • D2kWutil error at runtime, but not in Forms Developer

    Hi, I need 'Form on top as SDI' (C/S 6.0.8.) and it works on my WNT machine stabil, also at runtime: W-N-F-I Trigger OnTop.Window_On_Top('WINDOW1'); On my WXP machine the same code The runtime start with usesdi=NO is OK, but not with usesdi=YES : the

  • IPhoto 6 G3 Compatible

    iPhoto 6 can run on G3 Macintoshes quite easily. I tested this on an iMac G3 500 with 16MB VRAM and 1GB RAM. The iLife '06 installer will not allow for the software to be installed directly onto any G3 model; instead you have to remove the Hard Disk

  • HR Organisation Chart : Showing Position as Presently occupied by other

    As per our Business Practice, there are some Positions which are Vacant but occupied by some Employee as their Secondary assignment (over and above their primary assignment, which is some other position). And this position we don't want to show it as