The named parameters need not match the column names, and the column names
are probably what you want to match the CSV file.  As such, you could make
P1 throught P25 to be the named parameters for your 25 columns, and insert
them into columns with the real name.  The named parameters are there only
so that the SQL command and the API user can be matched up, particularly
when one or more value need to be reused.

--David Garfield

On Wed, Jan 11, 2012 at 19:01, Steven Michalske <[email protected]>wrote:

> On Tue, Jan 10, 2012 at 4:11 PM, Simon Slavin <[email protected]>
> wrote:
> >
> > On 10 Jan 2012, at 11:57pm, Steven Michalske wrote:
> >
> >> Some day they might have a field that is named with the underscore as
> >> a second column; not saying it makes sense.  We find all kinds on the
> >> internet :-)
> >
> > Well some day they might have a field that is named with a space, too.
>  There's nothing in SQLite to forbid it.  The real solution is to use named
> parameters the way they were designed, not try to match the name of the
> parameter with the name of the field.
>
> This statements is not quite true.
> I want to auto generate the fields based on csv files that may or may
> not have spaces in them.
> This makes the named parameter match the column names in the CSV file.
>  I used the python csv DictReader object that creates a key value
> mapping for column name and value.  i wanted to not have to manipulate
> the field names and such.
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to