| |
Welcome to the dBforums forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact contact support.
If you prefer not to see double-underlined words and corresponding ads, place your cursor here for ContentLink opt out.
|
 |

12-04-07, 23:36
|
|
Registered User
|
|
Join Date: Apr 2007
Posts: 63
|
|
|
Who can help me to check the syntax?
|
Hi Everyone,
I got the error below when I processed a dimension:
OLE DB error: OLE DB or ODBC error: Insufficient result space for explicit conversion of FLOAT NULL value '2.2400000000000002' to a CHAR field.
In the dimension, I have a column defined like this:
Case WHEN Weight IS NULL THEN 'Unknown' ELSE CONVERT(CHAR (5), Weight) END AS [WeightDesc]
Does it mean that there are something wrong with my query?
Who can helpe me to check it?
Your help will be appreciated.
Thanks^_^
Winnie
|
|

12-05-07, 06:18
|
|
Registered User
|
|
Join Date: Sep 2003
Location: Switzerland
Posts: 371
|
|
Quote:
|
Originally Posted by winniewang
Hi Everyone,
I got the error below when I processed a dimension:
OLE DB error: OLE DB or ODBC error: Insufficient result space for explicit conversion of FLOAT NULL value '2.2400000000000002' to a CHAR field.
In the dimension, I have a column defined like this:
Case WHEN Weight IS NULL THEN 'Unknown' ELSE CONVERT(CHAR (5), Weight) END AS [WeightDesc]
Does it mean that there are something wrong with my query?
Who can helpe me to check it?
Your help will be appreciated.
Thanks^_^
Winnie
|
The syntax is right, but there seems to be a float value '2.2400000000000002' which cant be converted to a char(5). Either Remove the CHAR(5) or Use the round function to truncate the decimals.
|
|

12-05-07, 06:28
|
|
Registered User
|
|
Join Date: Apr 2007
Posts: 63
|
|
|
Actually, the "Weight" column is float, and the values are NULL, 230.0, 231.4...., I didn't find the value '2.2400000000000002', I can remove the Char(5), But If I want to convert a column like "Weight" to Char(5), are there other mothod?
Thanks^_^
Winnie
|
|

12-05-07, 06:40
|
|
Registered User
|
|
Join Date: Sep 2003
Location: Switzerland
Posts: 371
|
|
Quote:
|
Originally Posted by winniewang
Actually, the "Weight" column is float, and the values are NULL, 230.0, 231.4...., I didn't find the value '2.2400000000000002', I can remove the Char(5), But If I want to convert a column like "Weight" to Char(5), are there other mothod?
Thanks^_^
Winnie
|
Hmm I dont remember it exactly, but floats are OS dependant I think and can vary and thats why its probably better to use numeric. You might want to do some research on that.
Try doing something this. convert(char,convert(numeric(3,2),column))
3,2 is precision and scale.
Also, read up on the convert function.
|
|

12-05-07, 07:01
|
|
Registered User
|
|
Join Date: Apr 2007
Posts: 63
|
|
Thank you for your quick reply:-)
I will reread Convert function and try you suggestion tomorrow. it is the time to go home, Thank you for your reply.
Thanks^_^
Winnie
|
|

12-05-07, 07:04
|
|
Registered User
|
|
Join Date: Sep 2003
Location: Switzerland
Posts: 371
|
|
No Problem.
Its either 3,2 or 5,2 for your problem.
|
|

12-05-07, 21:43
|
|
Registered User
|
|
Join Date: Apr 2007
Posts: 63
|
|
Yeah, you are right. Now I can process successfully :-)
Thanks^_^
Winnie
|
|

12-06-07, 02:25
|
|
Registered User
|
|
Join Date: May 2005
Location: South Africa
Posts: 830
|
|
|
|

12-06-07, 02:32
|
|
Registered User
|
|
Join Date: Apr 2007
Posts: 63
|
|
Aha, Thanks for your detail info:-)
Thanks^_^
Winnie
|
|

12-06-07, 12:34
|
|
Registered User
|
|
Join Date: Sep 2003
Location: Switzerland
Posts: 371
|
|
Quote:
|
Originally Posted by pdreyer
|
Thanks pdreyer 
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|