DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2007

    Thumbs up How do we check null value for Select Statement


    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
    Ft. Lauderdale, FL
    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
    Colorado Springs
    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
    How about using NVL(computed_columns,0) to update a column on another table?

  5. #5
    Join Date
    Apr 2007
    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

By using this site, you agree to the Privacy Policy