Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Default Value for double precision

Author  Topic 

newbie16
Starting Member

8 Posts

Posted - 2012-08-05 : 23:21:04
Hello,

I have created a test table with the data type double precision


String sql = "create table doub1 ( value double precision)";

fCursor.execute(sql);

sql = "insert into doub1 values(null)";
fCursor.parse(sql);
fCursor.execute();
fSession.commit();
sql = "select value from doub1";
fCursor.executeQuery(sql);


When I execute this in the Query Analyzer my output is null.
This is given as "•When query results are viewed in SQL Query Analyzer, null values are shown as (null) in the result set." in the following link

http://msdn.microsoft.com/en-us/library/aa196106(v=sql.80).aspx

But when I execute the above through Junit, My outout is 0.0.

I would like to know why this is happening.
Could someone provide a clarification on this please?

Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-08-06 : 00:39:48
whats Junit? you may be better off posting it in Junit forums as i dont think there are people familar with Junit here.

Also is this t-sql? there's no datatype called double precision in t-sql

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

newbie16
Starting Member

8 Posts

Posted - 2012-08-06 : 01:16:57
Junit is used for unit testing in Java.
I have the set of statments in java and testing with a remote SQL Server 2000 system.

This is a datatype in SQL 2000.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-08-06 : 11:04:03
quote:
Originally posted by newbie16

Junit is used for unit testing in Java.
I have the set of statments in java and testing with a remote SQL Server 2000 system.

This is a datatype in SQL 2000.



Nope.. datatype corresponding to double precision in sql server is real

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2012-08-06 : 11:42:21
Isn't it float? I know the VB type single mapped to SQL real and double mapped to float.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-08-06 : 12:22:27
quote:
Originally posted by robvolk

Isn't it float? I know the VB type single mapped to SQL real and double mapped to float.


yep you're correct


The synonym for double precision is float(53).
and synonym for real is float(24).


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -