set field's type for CSV file
Last post Nov 06, 2012 10:38 PM by ron_bo
Sep 03, 2012 11:37 AM|LINK
Hi, I'm not sure if this has been discussed before, at least I couldn't find anything. I have a question regarding field types in case of CSV input files. Is it possible somehow change the type of the field? I have some fields which consists only from digits,
so LogParser interprets them as integers. The problem is that these fields are supposed to be text strings. In some cases they have leading zeros and those are droped by LogParser. Is there a way to tell LogParser that particular field is string?
Sep 04, 2012 04:13 PM|LINK
Take a look at TO_STRING:
TO_STRING( argument <INTEGER | REAL> ) | ( timestamp <TIMESTAMP>, format <STRING> )
Converts a value of the REAL or INTEGER data type into a value of the STRING data type.
Sep 06, 2012 12:09 PM|LINK
Well, it's not doing what I want. If I have, for example, string 04092012, both "SELECT start FROM file" and "SELECT to_string(start) FROM file" return me 4092012. I.e., leading zero is removed in both cases.
Nov 06, 2012 10:38 PM|LINK