The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

This topic is READ ONLY
import-bot (20211) [Avatar] Offline
#1
[Originally posted by andersom]

Do you know if you can use the SQL word like'<your_string>% ?
My project assumes that the user would enter parts of the string text.
Example: Firstname : M
The Query would really bring back like'M%, this would be one interesting search.

In a nutshell, can one add to the query mode service? if so, how?
Thanks, your book does make a nice memory jogger.

Michelle
import-bot (20211) [Avatar] Offline
#2
Re: Query Mode Service
[Originally posted by rik brooks]

> Do you know if you can use the SQL word like'<your_string>% ?
> My project assumes that the user would enter parts of the string text.
> Example: Firstname : M
> The Query would really bring back like'M%, this would be one interesting
search.
>
> In a nutshell, can one add to the query mode service? if so, how?
> Thanks, your book does make a nice memory jogger.
>
> Michelle

Michelle,

Thanks for the kind words about the book.

In a nutshell I think that you are trying to use the wrong tool, although I
can't tell for sure from your message. Here are a few options for you. You
could create a custom visual object and put a datawindow in it and a single
line edit. In the single line edit you add a user defined event mapped to
pbm_enupdate. This kicks off with every key stroke. Then you do a find on the
datawindow control looking for the lower(left(len(sle_1.text))) =
lower(sle_1.text). This would of course mean that you would have to retrieve
all of the rows into your datawindow at once. This might not be doable if your
result set is restrictive. On the other hand, if the result set doesn't change
much you could retrieve it into a global datastore and do a sharedata with
that... if memory isn't a constraint.

Or, you could create your own service object which lets you register columns
and would get the sql source, then modify the where clause with some text and
your % and re-retrieve for you. Then it would do a scrollToRow(1) and a
setFocus. Doing this you could even set up a hot key for it so the user could
type into a column to change the data, and let the data change or he could
type in and hit, say, Ctrl-Alt S to search. Of course if you did this then
before you re-retrieve you would have to do a getNextModified to see if you
need to prompt them to save the changed data first. Then you inherit from u_dw
and add this service, or add it directly to u_dw if you are allowed to change
the pfc objects.

actually there are lots of things that you could do.

--Rik
import-bot (20211) [Avatar] Offline
#3
Re: Query Mode Service
[Originally posted by andersom]

Thanks for the input. I went with something like the last part of your memo.
Seems to be working great. So good that the other developers used it again,
for their search window.

Thanks,
Michelle Anderson


> > Do you know if you can use the SQL word like'<your_string>% ?
> > My project assumes that the user would enter parts of the string text.
> > Example: Firstname : M
> > The Query would really bring back like'M%, this would be one interesting
> search.
> >
> > In a nutshell, can one add to the query mode service? if so, how?
> > Thanks, your book does make a nice memory jogger.
> >
> > Michelle
>
> Michelle,
>
> Thanks for the kind words about the book.
>
> In a nutshell I think that you are trying to use the wrong tool, although I
> can't tell for sure from your message. Here are a few options for you. You
> could create a custom visual object and put a datawindow in it and a single
> line edit. In the single line edit you add a user defined event mapped to
> pbm_enupdate. This kicks off with every key stroke. Then you do a find on the
> datawindow control looking for the lower(left(len(sle_1.text))) =
> lower(sle_1.text). This would of course mean that you would have to retrieve
> all of the rows into your datawindow at once. This might not be doable if your
> result set is restrictive. On the other hand, if the result set doesn't change
> much you could retrieve it into a global datastore and do a sharedata with
> that... if memory isn't a constraint.
>
> Or, you could create your own service object which lets you register columns
> and would get the sql source, then modify the where clause with some text and
> your % and re-retrieve for you. Then it would do a scrollToRow(1) and a
> setFocus. Doing this you could even set up a hot key for it so the user could
> type into a column to change the data, and let the data change or he could
> type in and hit, say, Ctrl-Alt S to search. Of course if you did this then
> before you re-retrieve you would have to do a getNextModified to see if you
> need to prompt them to save the changed data first. Then you inherit from u_dw
> and add this service, or add it directly to u_dw if you are allowed to change
> the pfc objects.
>
> actually there are lots of things that you could do.
>
> --Rik