Hello,
I'm using FlexiCapture and I'm trying to export some int value defined in a text Field to a SQL Server database.
Everything is OK when there is a value, but I want it to be NULL in SQL when the field is empty.
I have an error during export : Type does not match
French error is "Exporter vers une base de données compatible ODBC: Le type ne correspond pas."
What i Got :
The DataType of the field is Number
Validation : Can't be empty is unchecked
What I tried
Chek/unckeck the box "treat as text"
Type "NULL" in default value
Launch SQL Server profiler to see what's going on with ODBC but Flexicapture is only getting the columns : it is just getting the table definition and column definitions.
Any ideas ?
Sincerely.
Laurent.
I'm using FlexiCapture and I'm trying to export some int value defined in a text Field to a SQL Server database.
Everything is OK when there is a value, but I want it to be NULL in SQL when the field is empty.
I have an error during export : Type does not match
French error is "Exporter vers une base de données compatible ODBC: Le type ne correspond pas."
What i Got :
The DataType of the field is Number
Validation : Can't be empty is unchecked
What I tried
Chek/unckeck the box "treat as text"
Type "NULL" in default value
Launch SQL Server profiler to see what's going on with ODBC but Flexicapture is only getting the columns : it is just getting the table definition and column definitions.
Any ideas ?
Sincerely.
Laurent.
コメント
3件のコメント
Type mismatch is happening because integer fields from FlexiCapture are exported as float values.
Another thing you should be aware of is that if such fields are empty a "0" is exported instead of a null, this is due to float being a non-nullable value type.
If you need NULLs in your database then check Treat as text option and configure corresponding fields in SQL server to be of nvarchar type.
Best regards,
Tim
Thanks for replying on Christmas Day..
It makes sense, even if in SQL Server, an int or a float can be null : I need NULL when there is no response, and 0 when it's written 0.
What i've done is to set a calculated column in SQL server defined as cast(X as int) where X is the exported field.
So a NULL value stays NULL, and is not converted to 0.
I wish you all the best for the upcoming year.
Laurent
Hi Laurentp,
Are you using customized script to export ? if not then how you did manage this
"What i've done is to set a calculated column in SQL server defined as cast(X as int) where X is the exported field."
Kind Regards
Ibrar Shah
サインインしてコメントを残してください。