OK, I've played with this a bit. Adding new columns to the datatable through a custom function is really slow because it enumerates every cell in the column. I don't need that -- I just need a blank column -- full of nulls -- but with a column name.
I can add the columns to the datatable after I've retreived it, or store the empty columns in the database. Seems like there might be something better. Thanks __________ My original question: I have to read thousands of tables and operate on each one in sequence. I need to do this fast. I want to read the data from 6 stored columns and many rows from each table. Once the table is read, I need to create derived columns (e.g. (new) Column C = column A + ColumnB). I'm finding it pretty slow to add the new columns to each table before working on it. I'm finding it faster to store the columns to be derived (empty) in the database -- but this makes the db larger. Is there an established, best practice, method for this problem? More generally, is there a place I could look for advice on how to optimize these procedures? Thanks ----- Original Message ----- From: "Szomraky, Stefan" <[EMAIL PROTECTED]> To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org> Sent: Tuesday, July 15, 2008 8:40 AM Subject: Re: [sqlite] General help, a bit OT >> -----Original Message----- >> From: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] On Behalf Of cstrader >> Sent: Tuesday, July 15, 2008 2:28 PM >> To: General Discussion of SQLite Database >> Subject: Re: [sqlite] General help, a bit OT >> >> Oh, sorry, the example was just an example. The calculations >> I need to make on on ColC cannot be done within SQLite. >> >> > Why does SELECT ColA, ColB, ColA+ColB AS ColC FROM tab1; not work? >> > > > AFAIK, the current .NET provider for SQLITE supports custom functions > implemented in .NET. > Maybe this will work? > > SELECT ColA, ColB, custCLRfct(ColA, ColB) AS ColC FROM tab1; > > You might also want to implement the function in C for speed > improvements. > > Greetings, > Stefan. > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users