You need to register a new function with-state to do this. Something
like this:

void f(sqlite_func *ctx, int arg, const char **argv)
{
        int *state = (int *)sqlite_user_data(ctx);
        if (atoi(argv[0]) == atoi(argv[1])) *state = 1;
        sqlite_set_result_int(ctx, *state);

}
static int state = 0;
sqlite_create_function(db, "f", 2, f, &state);


Could be used to evaluate an additional where clause:

WHERE f(ROWID, 12345)=1


On Tue, 2003-11-11 at 19:11, Bronislav Klucka wrote:
> > Hi,
> >
> > I have a set of records selected, for example, with:
> >
> > "select * from NewsData where (upper(Zip)>='HX1' and
> > upper(Zip)<'HX2') order by Zip,Address,No"
> >
> > There is an INTEGER PRIMARY KEY field in the database called ID
> >
> > Given that I know I have a record with an ID of 12345, how would
> > it be possible to "jump" to that
> > record, and still maintain my original select parameters and order?
> >
> > I guess that this is down to a select within a select, but I'm
> > not sure how to go about it. Well, I'll
> > qualify that - anything that I've tried hasn't worked yet!
> 
> define "jump" to that record, and still maintain my original select
> parameters and order".
> Be more specific..
> 
> Bronislav Klucka
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to