> actually Stephen he doesnt have this in a db yet, hes getting it from
> a csv file then trying to do all that.
Doesn't matter.... He's loading the CSV into a query using CFHTTP. ;)
>
> personally, i think he should break it down, put it in the db then do
> just like u showed.
>
> but his problem is that this csv file is a friggin mess (i think) and
> hes trying to get to clever with the code. But the csv file is
> generated by a pharmacys software program which means he probably has
> no control over how its made.
Doesn't really matter as long as each row is in the same format you can
load the csv into a query using cfhttp. ie. each row is : medicareno,
firstname,lastname,medication,quantity,description
Once you've loaded the CSV into a query, you can then use Query of Query
to reorder etc etc without the overhead of having to insert everything
into a DB and then requery everything out of the DB.
>
> i'd say get the csv & rip it out 1 line at a time, get the info for 1
> line (1 record), break the line down & insert it to the db then delete
> the line and loop it.
Don't need to. CFHTTP will take the first line as the column names for
the query it generates and insert the rest of the CSV data into the
query, as long as there are no data errors of course. If there are
errors in the data, its not going to matter if you load it into a query
using cfhttp or parse the contents of the csv into a database, it will
still fail.
Stephen
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

