10-07-2019 10:36 AM - edited 10-07-2019 10:37 AM
I have a really simple problem and I've tried a couple of solutions found elsewhere but just can't seem to get this right.
I have two values, which are initially imported via a Database query (SQL), then the value written into a DBL Control. Once altered, I then want to put it back using Database Insert and create a new record. My problem lies with once I've changed the value, and pressed the button, the value sent to the Database isn't the formatted value I need (and I have tried converting to a string, setting the width, setting the display format of the control - nothing seems to work).
Screenshot attached shows the resultant data, it errors as my SQL column is set to Decimal(6,2).
All I want is a value like 1234.56
Am I just being really stupid here?!
Solved! Go to Solution.
10-07-2019 11:15 AM
What is the error message?
10-07-2019 11:19 AM
Possible reason(s): ADO Error: 0x80040E57 Exception occured in Microsoft OLE DB Provider for ODBC Drivers: [Microsoft][ODBC SQL Server Driver][SQL Server]Arithmetic overflow error converting float to data type numeric. in NI_Database_API.lvlib:Rec Create - Command.vi->NI_Database_API.lvlib:Cmd Execute.vi->NI_Database_API.lvlib:DB Tools Insert Data.vi->Update CdV Factor.vi
10-07-2019 11:31 AM
Are your column names [1] and [10]? I doubt that special characters are allowed. Give your columns an actual name with alpha characters.
10-07-2019 11:33 AM
Yes they are called 1 & 10, I've used the square brackets to ensure they a relative name, not an actual value, but I will test that theory, but I usually write data back to this table by other methods and have no issues.
10-08-2019 03:51 AM
@aputman wrote:
Are your column names [1] and [10]? I doubt that special characters are allowed. Give your columns an actual name with alpha characters.
Having amended the table and changed the column names to the words "One" and "Ten", I can confirm this still doesn't resolve the issue. It was worth a try but was 99.9% sure this wasn't the issue, but having learned from LabVIEW experience, sometimes expect the unexpected!