Question

Asked on 1999-08-23 at 12:37:05ID: 25453292

Adding Null and Blank fields

by: rickwinterkorn100

Rating7.8Very Good

Sybase developer here, Looking for the oracle syntax (sql)
that will retrieve a zero when two null or empty numeric fields are selected and added.

I have created a View that returns a blank column when
adding two database fields. Some records have fields
containing numbers, blanks, and nulls.  How do I add them,
and return a zero as the default when no numbers are present, and return a number when possible?  

  1. query to Return the number of records and outpu…
    What I am looking to do is do a select count(*) on every column in a table where it is not null and then output it to a text file. Can someone give me an example of this and send it over. Below is what I am looking to do. BEGIN   //Perform a Query  for multiple fields:  Select count(*) from CC_TABLENAME where CC_TABLENA…
  2. Query or stored procedure to return next unused…
    This hopefully is an interesting question for someone, and maybe there are some elegant solutions already out there. What I have is a table that contains a name field for a company. This name field is obviously a varchar, BUT, some of our clients only use numbers as their names. This table can be populated either via my application, or via an import r…
  3. Character with zero
    I have a field called staff_id and the values start with zero like 0143. When inserting the data it gets inserted as 413 and truncates the 0 In posat query when I want the staff name it says not found since 0 is missing. How to insert data with 0 as starting number.
  4. PL/SQL Easy Question - Null or Blank
    Is there a length I should use where I need to say if not null and not blank so I was thinking there is a length in PL/SQL on a field that may be best unless another way is better. Also I am doing some calculation and a divide by 100. Should I be doing something with the value that I am dividing just in case its 0 as I am thinking that may throw a divisible by 0 erro…
  5. Return Null when No Records Returned
    All, I need to some help building a sql script using the tables in the attachment. Basically I need to return a value from tableB where MAX(tableB.date) < tableA.date. See below for more details. Thanks in advance.! table A ID VAL DATE ID1 ABC 8/25/2010 ID2 EFG 8/25/2010…

Solution

Sign up now to view this solution! It's quick, easy, and secure to subscribe. We will return you to this solution, unlocked, when you’re done.

About this Solution
View This Solution - Start Your 30 Day Free Trial
Zone
General
Tags
blank oracle fields null
Participating Experts
2
Solution Grade
A

Replies

 by:

Posted on 1999-08-23 at 12:51:04ID: 28202593

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: mshaikh

Posted on 1999-08-23 at 13:34:41ID: 28202594

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: rickwinterkorn

Posted on 1999-08-23 at 13:44:50ID: 28202595

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: mshaikh

Posted on 1999-08-23 at 14:07:29ID: 28202596

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: rickwinterkorn

Posted on 1999-08-23 at 14:14:53ID: 28202597

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 by: mshaikh

Posted on 1999-08-23 at 14:19:17ID: 28202598

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

Stay Connected

Oracle Around the Web

The latest Oracle news, tips, and tricks

Oracle Unveils Netra SPARC T3 Servers

New Carrier-Grade Blade and Rackmount Servers Deliver Better Performance, Density and Power Efficiency for the Communications Industry ...

read more

Oracle fixes 21 flaws in Java SE, Java for Business

Oracle is fixing 21 flaws in its Java SE and Java for Business products in its February critical patch update issued this week ...

read more

Obama’s Silicon Valley “Tech Supper”

Why was he there? Who wasn’t invited and why? What did they talk about? Why was he really there? These are the questions being debated ...

read more

Featured Oracle Experts

slightwv

slightwv has answered more than 2,000 Oracle questions and oversees database management within the U.S. Government. Slightwv

sdstuber

A regular presenter at the Collaborate conference, Oracle developer sdstuber is a top expert in PL/SQL and Oracle 9, 10 and 11. sdstuber

Testimonials

What users are saying about our experts

"The Oracle gurus provide answers, solutions and valuable workarounds"

User: schwertner

"Wow! Excellent, valuable explanation. Hats off to you"

User: aseshu70

"Solution worked fantastic and performs excellent! Thanks heaps"

User: klausbrandlhuber

Top Experts

  1. slightwv

    2,000

    0 points yesterday

    Profile

BrowseBecome an Expert