timport and counter

Post Reply
mpressnall
Posts: 16
Joined: Thu Apr 29, 2004 7:02 pm

timport and counter

Post 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
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

timport and counter

Post 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.
mpressnall
Posts: 16
Joined: Thu Apr 29, 2004 7:02 pm

timport and counter

Post by mpressnall »

Many thanks...That did the trick!
Post Reply