I want to copy in some data from a tab-delimited flat file, but one of the
columns that should translate into a datetime is in Unix timestamp format
(seconds since epoch).
The data should go into this table:
create table logins (
uname varchar(100),
timein datetime,
duration int,
[EMAIL PROTECTED] writes:
I want to copy in some data from a tab-delimited flat file, but one of the
columns that should translate into a datetime is in Unix timestamp format
(seconds since epoch).
The data should go into this table:
create table logins (
uname varchar(100),
[EMAIL PROTECTED] writes:
I want to copy in some data from a tab-delimited flat file, but one of the
columns that should translate into a datetime is in Unix timestamp format
(seconds since epoch).
COPY isn't going to apply any datatype conversions for you. What you
could do, though, is
insert into RealTable select uname, timestamp(abstime(timeinAsInt4)),
duration, etc from TempTable;
Another side comment: afaik an explicit conversion to abstime is not
required to go from Unix time to timestamp. So
insert into RealTable select uname,