• Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Change the default mapping type

#1 2008-07-31 17:34:24

WC2007
New member
Registered: 2008-07-22
Posts: 4

Change the default mapping type

Tags: [mapping, mssql]

Hi,

I work with a SQL SERVER 2005 database.
When I do a retrieve schema on a table the fields DB Type "Numeric" are mapped on Java Type "Float".
I would like know how I could change the default mapping as the DB Type Numeric would be mapped on Java Type "Double"?

Thanks,

Offline

#2 2008-07-31 20:05:55

cymat_mc
Member
Registered: 2008-07-18
Posts: 34

Re: Change the default mapping type

Hello, I am new to talend, but I believe you can change this in preferences.

In the Menu bar at the top of talend, go to Window --> Preferences.

Then expand the Talend Menu and go to Metadata of TalendType.

Choose Mapping_"Your Database Type".XML and choose edit.

Find the area of code that refers to "dbtoTalendTypes" (it is most likely after the area of code for "TalendtoDBTypes").

Look for something like this: (Note: This is an excerpt from the MSSQL XML file)
________________________
<dbType type="NUMERIC">
                    <talendType type="id_Float" default="true" />
                    <talendType type="id_Double" />                   
                    <talendType type="id_BigDecimal" />
________________________

Adjust the code as required to change id_double to the default.

Please be aware that I am no expert on Talend and you follow this instructions at your own risk.

ADMINISTRATOR: If I have advised incorrectly feel free to remove this post.

Offline

#3 2008-10-29 22:17:54

bpruss
Guest

Re: Change the default mapping type

I tried this and could not make it work.  I have resorted to exporting my schema's to xml doing a search and replace and importing them back in...

This is obviously not optimal.  Does anyone else have a suggestion for this issue?

#4 2008-10-29 22:51:25

mhirt
Talend team
Registered: 2006-09-19
Posts: 1658

Re: Change the default mapping type

cymat_mc gave you the exact correct answer.
Regards,

Offline

#5 2008-10-29 23:25:40

bpruss2
New member
Registered: 2008-10-29
Posts: 3

Re: Change the default mapping type

I'm sorry right after I hit submit I realized that I would have to be more specific.
I am using the 3.0.0 production release. 

I went to Window>Preferences>Talend>Metadata of TalendType
then selected "mapping_MSSQL.xml"  and clicked Edit.

I found the section referenced and changed it thus:
Before:

Code:

            <dbToTalendTypes><!-- Adviced mappings  -->
 ... 
                <dbType type="NUMERIC">
                    <talendType type="id_BigDecimal" default="true" />
                    <talendType type="id_Float" />
                    <talendType type="id_Double" />
                </dbType>

After:

Code:

            <dbToTalendTypes><!-- Adviced mappings  -->
 ... 
                <dbType type="NUMERIC">
                    <talendType type="id_Double" default="true" />
                    <talendType type="id_Float" />
                    <talendType type="id_BigDecimal" />
                </dbType>

but now when I import metadata through the database connection all of the NUMERIC types are "Float" instead of Double. 

Thanks for any ideas or suggestions...


10/30/2008
I tried something today that seems to be working:

Code:

                <dbType type="NUMERIC">
                    <talendType type="id_Double" default="true" />
                </dbType>
                <dbType type="NUMERIC IDENTITY">
                    <talendType type="id_Double" default="true" />
                </dbType>

Last edited by bpruss2 (2008-10-31 01:08:56)

Offline

  • Index
  •  » Talend Open Studio for Data Integration » Usage, Operation
  •  » Change the default mapping type

Board footer

Powered by FluxBB