Import data as a String

Thoughts, comments and discussion from Baycastle staff and partners

Moderators: Tom, ian

Import data as a String

Postby ian » Thu Jan 09, 2014 9:55 am

Returning to the question of if to import data as text.

The support team was asked just last week if to import data into DataSlave as text (or string) or in other data formats: Int, Date, DateTime, Decimal, Float, Boolean and others. The response was if in doubt, import data as Text.

Here is some of the discussion.

We advise that you generally import data as text because if you try to import, for example, as a datetime there may be mal-formed data that will not import correctly as it will not conform to the data type and will be interpreted as Null. If you import as text you can then work on the data and make corrections using DataSlave’s many string manipulations functions where necessary and then translate or cast to the suitable data type later in the DataSlave Map. If the data is to poor to correct then after validation write out into a file for inspection.

So what is a Null?

A Null is no data at all and should not be confused with an empty string. So a Date can be a valid date or Null. Reading in for example 32 July 2008 will lead to a Null if the data type is Date. However if read in as Text it could be corrected, perhaps to 31 July 2003 and then used as a valid date when imported into your target system. This Data Import approach will retain as much information as possible.

DataSlave will automatically cast data type if you set the output type to for example DateTime. You can also use cast functions. Be under control of the treatment of data as part of your Data Import plan.

Talk to us and we can help you build your plan for data migration, Data Import or Data Export.
ian
 
Posts: 364
Joined: Sat Dec 18, 2004 8:13 am
Location: UK

Return to Baycastle Blog

Who is online

Users browsing this forum: No registered users and 1 guest

cron