Mload delimited file with delimiter embedded in field
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


Mload delimited file with delimiter embedded... Expand / Collapse
Author
Message
Posted 4/11/2006 5:14:04 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 5/18/2006 4:01:00 AM
Posts: 1, Visits: 1
Hi

Trying to load a (tab) delimited file into Teradata (V2R5) using Mload. The supplier of the file has stated that any character may appear in the text fields, including the delimiter. In this case any field containing the delimiter character(s) will be enclosed in double quotes.

Does anyone know whether Mload can deal with this without resorting to an Inmod?

Thanks

Mike
Post #3952
Posted 4/11/2006 2:08:59 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 10/7/2008 12:54:51 PM
Posts: 116, Visits: 20
Mike,
If the file is not huge I would do the follwing steps

if you are on a unix env.
assume the delimiter is comma , and all the actual text commas are specified as ","

replace all the "," s with a char that is not available in the text file assume tilde ~
then replace all the commas (the actual delimiters) with a pipe |
then replace all the ~ 's with ","

By doing this we are creating pipe delimited file.
But make sure we dont have any pipes in our data to start with.
All you have to do is find a char that cannot exist in the file and use that as delimiter.
In some cases we had perl scripts that did all these modifications.
(well if you tried all these steps earlier and if that does not work then inmod is the way i guess)

i am not sure if an inmod will slow the process.
Lets hear from the GURUS



Feroz Shaik
Post #3957
Posted 5/3/2006 10:24:44 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 10/24/2008 2:58:55 AM
Posts: 19, Visits: 6
Can pipe delemited file be read by the MLOAD utility. If you can please send the sample .LAYOUT and FIELD definitions.

Thanks


Pervez Ahmed
Post #4094
Posted 5/17/2006 6:29:32 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 11/25/2008 1:20:39 PM
Posts: 91, Visits: 119
Example of MLOAD using pipe delimiters

.LOGTABLE ML_FOO;

.LOGON .....

.BEGIN IMPORT MLOAD
SESSIONS 4
TABLES FOO
WORKTABLES WT_FOO
ERRORTABLES ET_FOO
UV_FOO
ERRLIMIT 100;

.LAYOUT DATAIN_LAYOUT;
.FIELD FOO_ID * VARCHAR(12);
.FIELD FOO_DT * VARCHAR(10);
.FIELD FOO_NAME * VARCHAR(100);

.DML LABEL INSERT_DML;

INSERT INTO FOO
(
:FOO_ID,
:FOO_DT,
:FOO_NAME
);

.IMPORT INFILE foo.dat
FORMAT VARTEXT
LAYOUT DATAIN_LAYOUT
APPLY INSERT_DML;

.END MLOAD;

.LOGOFF &SYSUVCNT + &SYSRJCTCNT + &SYSETCNT + &SYSRC;
Post #4195
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 2 ( 2 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 12:12am

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.266. 8 queries. Compression Disabled.