Page 1 of 1

timport and counter

Posted: Fri Dec 10, 2004 6:00 pm
by mpressnall
I know this has to be a simple answer but I've spent three hours on it and it is driving me batty.

I have a table:
create table flat_section
(
flatID counter NOT NULL,
status integer NOT NULL,
name varchar(16) NOT NULL,
location varchar(32) NOT NULL,
description varchar(64) NOT NULL,
keywords varchar(32) NOT NULL
);

that has data in it already and I want to add some more rows using timport.

so I have a schema file
=====================================
createtable false
user _SYSTEM
database /path/to/db
table flat_section
noid
csv \t
keepfirst
field flatID counter 1
field status integer 2
field name varchar(16) 3
field location varchar(32) 4
field description varchar(64) 5
field keywords varchar(32) 6
===================================================

My question is for the first column (flatID -- the counter) what do I put in the data file to automatically generate a normal looking counter (the kind that looks like "41ba26cf0")? I have tried leaving it blank (the flatID then is 000000000), tried incrementing a number for each line (the flatID looks like 000000010, 000000020, 000000030, etc), and a whole bunch of other stuff.

My data file looks like:
<blank column>*TAB*1*TAB*a name*TAB*http://url*TAB*description of stuff*TAB*some keywords

Where <blank column> is blank and *TAB* is a real tab.

Many thanks,
Matt

timport and counter

Posted: Sat Dec 11, 2004 11:12 am
by mark
Put the word "counter" in the first column of the data.

If you can't control the input data or want to do other manipulations to the data while loading it use <timport> in vortex. It will parse the input data into variables which you can manipulate then insert however you wish.

timport and counter

Posted: Mon Dec 13, 2004 4:50 pm
by mpressnall
Many thanks...That did the trick!