DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: How do we check null value for Select Statement

  1. #1
    Join Date
    Apr 2007
    Posts
    1

    Thumbs up How do we check null value for Select Statement

    HI,

    I have written one co-related query for performance issue. In that select statement i am taking some balances fields from some different tables to calculate the balances and i am updating to some other table. i have checked null value check for each balance field. but while updating it is throwing "Cannot update the balance to NULL".some times the table is giving null value while selecting the balances from other tables. coz the table doesnt have any record on the particular day. how do i resolve this problem? can any one answer for this question?

    thanks & regards,
    Amar M

  2. #2
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    Would you mind to copy/paste whole ORA error including ORA-NNNNN error code?
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

  3. #3
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    Don't attempt to update rows where the new value would be a null, or detect that the new value is null and substitute the current value, effectively not changing it. Code, please!
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  4. #4
    Join Date
    May 2000
    Location
    ATLANTA, GA, USA
    Posts
    3,135
    How about using NVL(computed_columns,0) to update a column on another table?

  5. #5
    Join Date
    Apr 2007
    Posts
    2
    You can use decode function in select statement & outer join in your defficient column for eg:
    select decode(column_name,NULL,'Any String',Column_name or value)
    from table_name
    where a.column_name(+)=b.column_name;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width