2010/5/15 Peter Danenberg <[email protected]>: > When I attempt to collate a prepared statement, the arguments to the > collation function are the names of the column and not the values > thereof. > [...]
Hello, I just tested this on Linux with CHICKEN 4.5.0, SQLite3 3.6.22 and version 3.5.1 of my sqlite3 egg: I cannot reproduce the problem. > [...] > "SELECT * FROM test ORDER BY ? COLLATE COLLATETHIS LIMIT ? OFFSET ?;" > [...] What's strange about this statement is that it tries to order the data by the first query parameter, which is a constant for purposes of the SQL statement, and hence recent versions of SQLite3 will never call the collation function at all, since the ordering between a single constant value and itself must never change. So maybe your version of SQLite3 does less optimization and continues to call the collation function on two copies of the first query parameter for every row in the table you query. If you actually intended to make the column by which the query results are ordered variable, the statement you used is not suitable for that purpose, neither is any prepared statement. In that case you actually have to construct and compile a new SQL string for every column by which you want to sort. Ciao, Thomas -- When C++ is your hammer, every problem looks like your thumb. _______________________________________________ Chicken-hackers mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/chicken-hackers
