Page 1 of 1

Error inserting float values into real fields via parameters

Posted: Thu 02 Jun 2011 17:26
by jeremyw
I've run into an error trying to insert float values into fields with an underlying type of real using parameterized SQL INSERT commands. Upon executing the command, an exception is thrown saying "Unknown BLOB field type", even if no BLOB fields exist within the table. I've been able to reproduce this issue within a simple demo app that I would be happy to forward along.

I can trigger this with code as simple as this:

Code: Select all

Command->SQL->Text = "INSERT [TableName] ( [ValueReal] ) VALUES ( :ValueReal )";
Command->Params->Items[0]->Value = float(3.14);
Command->Execute();
My development environment consists of:
• Windows 7 (64-bit)
• RAD Studio 2010
• MS SQL Server Compact 3.5 (also occurs within MS SQL Server)
• SDAC 4.80.0.58

Posted: Fri 03 Jun 2011 07:38
by AndreyZ
Hello,

To avoid this problem, you should use the following code:

Code: Select all

Command->Params->Items[0]->AsFloat = float(3.14);

Posted: Wed 15 Jun 2011 16:46
by jeremyw
As always, I appreciate the quick response, and I apologize for my own delay. I've been out on vacation.

Unfortunately, the code provided does not solve the problem. A different error message is generated saying "Requested conversion is not supported [,,,,,]".

Posted: Thu 16 Jun 2011 09:45
by AndreyZ
Thank you for the information. We have reproduced this problem and fixed it. We are going to release a new SDAC version today, and we cannot include this fix in it. That's why this fix will be included in the next nearest SDAC build. Also note that you will have to use the following code:

Code: Select all

Command->Params->Items[0]->AsSingle = 3.14;

Posted: Thu 16 Jun 2011 15:39
by jeremyw
Awesome, I'm glad you guys were able to address the issue so quickly. I don't think we have support anymore, however, so will we have to renew our support plan to get this fix?

Posted: Fri 17 Jun 2011 06:42
by AndreyZ
If your subscription isn't expired then you can upgrade SDAC to the latest version freely. When you buy SDAC you receive a registration mail where you can find a link, username, and password for Registered Users' Area ( http://secure.devart.com ). If there is no link in Registered Users' Area to download the latest SDAC version, it means that your subscription is expired and you need to renew it. You can renew your subscription here (in the Subscription Renewals section): http://www.devart.com/sdac/ordering.html