> I have a text file with about 200 lines in it, and I want
> the value of
> each line to be a column in the database. How do I go
> about this? I
> tried first row has colum name, but it just gives me the
> first row as a
> column name and the other 299 rows as values.
>
> Example:
>
> I want all these to be column names
>
> client_first_name
> co_client_first_name
> client_last_name
> co_client_last_name
> client_middle_initial
> co_client_middle_initial
> client_email
> co_client_email
> client_home_phone
How the heck would you know what data type to assign to 200 of these?
It'd be dead simple to construct a query to do this in CF tho ...
<cffile action="read" file="#myfile#" variable="myvariable">
<cfquery name="maketable" datasource="...">
CREATE TABLE mynewtable (
<cfloop index="x" from="1"
to="#listlen(myvariable,CHR(13))#">
#listgetat(myvariable,x,CHR(13))# varchar(8000)
<cfif x gt 1>,</cfif></cfloop> )
</cfquery>
hth
Isaac
www.turnkey.to
954-776-0046
______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists