Null Values 
Author Message
 Null Values

Hi All

I have created a SQL Server 7 database which allows nulls into numeric
fields. Data is being transferred to the database via Com.  I've been
told that the programmers are having problems because they declare a
variable as integer and try to assign a null value to it however they
get an error because null is considered a string. They want me to change
the database to be all char or varchar data.  I find it
hard to believe that C++ can't allow for NULLS.

Can anybody help with a solution to this problem?

Thanks



Fri, 07 Mar 2003 03:00:00 GMT  
 Null Values

If you use ODBC, there is a function SetFieldNull() or something like that
for CRecordSet class.

Yan Shaohui


Quote:
> Hi All

> I have created a SQL Server 7 database which allows nulls into numeric
> fields. Data is being transferred to the database via Com.  I've been
> told that the programmers are having problems because they declare a
> variable as integer and try to assign a null value to it however they
> get an error because null is considered a string. They want me to change
> the database to be all char or varchar data.  I find it
> hard to believe that C++ can't allow for NULLS.

> Can anybody help with a solution to this problem?

> Thanks



Sat, 08 Mar 2003 03:00:00 GMT  
 Null Values
I agree with you.  I use Sybase Adaptive Server and MS Access 2000 and both
accept NULL values for numeric fields.  Something like this should work:

    UPDATE mytable
     SET mynumber = NULL

Quote:

> Hi All

> I have created a SQL Server 7 database which allows nulls into numeric
> fields. Data is being transferred to the database via Com.  I've been
> told that the programmers are having problems because they declare a
> variable as integer and try to assign a null value to it however they
> get an error because null is considered a string. They want me to change
> the database to be all char or varchar data.  I find it
> hard to believe that C++ can't allow for NULLS.

> Can anybody help with a solution to this problem?

> Thanks



Wed, 26 Mar 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Global pointer is null sometimes even when initialized to some non-null value

2. Checking Null Value in a datarecord

3. Guid and null values

4. NULL value

5. Null values & data binding in Wndows Forms

6. DateTimePicker does not accept Null Values

7. NULL value ?

8. casting null value

9. How to return a null value?

10. NULL value in integer

11. OpenSubKey null value returned.

12. Passing NULL values to a stored procedure????

 

 
Powered by phpBB® Forum Software