[EMAIL PROTECTED] wrote: > > Given a user-defined function of Foo(), and a query such as > > select * from sometable where foo() > > Is it possible from within the body of Foo() to access data from the > current row of the database that is being examined? > > For instance, if I have a text field in the db record named 'MetaText' > that contains a list of name/value pairs as one large string, is it > possible for the code in Foo ( c++ in this case ) to be able to access > the field data from MetaText? I know I could do > > select * from sometable where Foo(MetaText) > > and the data would be available as a parameter, but it would be nicer if > I had some kind of visibility into the current row being processed. >
You can't do that directly, but you could pass the rowid to your custom function and it can use embedded SQL queries to pull data from other columns using the rowid to locate the record quickly (since it is already in the page cache). If the function foo() can be used with multiple tables, you would also need to pass the table name along with the rowid. HTH Dennis Cote _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users