I try to convert guid to an integer for a new database

One Star

I try to convert guid to an integer for a new database

Hello,
For my migration of two CRM i need to convert many GUID into integer id ...
How can I do that with a tmap ?
Thank you i'm looking for a while !
Seventeen Stars

Re: I try to convert guid to an integer for a new database

It depends what you want. You could use the hashCode() method to build an integer from the String guid.
use as expression
row1.GUID.hashCode()
But please keep in mind an hashCode is not fully unique. If your GUID string has always nearly the same length it is very likely unique but if the guid has wide spread length, this will not work for a huge number of values.

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Download