Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] tMSSqlOutputBulkExec: Mapping datatype boolean to bit does not work

Hello,
i have a java TOS project.
When reading the schema information from the MS-SQL-Server database the type bit is mapped to the java type boolean. That's o.k.
But when using the tMSSqlOutputBulkExec component to write data to the MS-SQL-Server
- the file generated contains 'true' or 'false' (without the ') in the boolean columns
- and an error "not able to convert" is raised

So it seems that the values 'true' / 'false' are not mapped to 1 / 0 in the database.
If this implicit mapping is not possible then i would prefer that the mapping when reading the schema information should be "bit => int" and not "bit => boolean".
Regards Hartmut
Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hello
If this implicit mapping is not possible then i would prefer that the mapping when reading the schema information should be "bit => int" and not "bit => boolean".

You can change data type mapping, go to Windows-->Preferences--->Talend-->Specific Settings-->metadata of TalendType, open mapping_MSSQL.xml and modify it:

...
<language name="java">
...
<dbToTalendTypes><!-- Adviced mappings -->
...
<dbType type="BIT">
<talendType type="id_Boolean" default="true" />
<talendType type="id_Byte" />
</dbType>

Change to :

...
<language name="java">
...
<dbToTalendTypes><!-- Adviced mappings -->
...
<dbType type="BIT">
<talendType type="id_Integer" default="true" /> //add this line and set it as true by default
<talendType type="id_Boolean" />
<talendType type="id_Byte" />
</dbType>

Best regards

shong

View solution in original post

2 Replies
Anonymous
Not applicable
Author

Hello
If this implicit mapping is not possible then i would prefer that the mapping when reading the schema information should be "bit => int" and not "bit => boolean".

You can change data type mapping, go to Windows-->Preferences--->Talend-->Specific Settings-->metadata of TalendType, open mapping_MSSQL.xml and modify it:

...
<language name="java">
...
<dbToTalendTypes><!-- Adviced mappings -->
...
<dbType type="BIT">
<talendType type="id_Boolean" default="true" />
<talendType type="id_Byte" />
</dbType>

Change to :

...
<language name="java">
...
<dbToTalendTypes><!-- Adviced mappings -->
...
<dbType type="BIT">
<talendType type="id_Integer" default="true" /> //add this line and set it as true by default
<talendType type="id_Boolean" />
<talendType type="id_Byte" />
</dbType>

Best regards

shong
Anonymous
Not applicable
Author

Hello Shong,
thank you very much for this information!
I wish all the best for 2010.
Regards Hartmut