Use a Pipeline Function.
Inside the Function
- split the string into words ( x := apex_util.string_to_table)
- get last word ( w := x( x.count ) )
- do your "suggested words" SQL and loop results ( where word like w || '%' )
- append the new letters to the input string
- PIPE ROW( ... )
- end loop;
Go into my application page 8, I have a search box that acts like a suggest list. To test, enter some text in the search box.
User Name: mydevfellow
Hi, I have successfully logged in to the workspace, but when I tried to run Page 8 it keeps asking for username/password again. And it seems they are different from the workspace's username/password?
When you log into the workspace, you are login as a developer. On the other hand, when you run the application, you need to login as a user. In this case, you can enter the same developer credential one more time to test the application.
Hi LA County, I tried your search box. It indeed gave me suggestions, but not for each separate word I am typing for (as I pointed out in my question).
To elaborate my Google Search example, if I typed "ora", the search field might give suggestion "oracle". And then if I typed "oracle ap", it continues giving another suggestion: "oracle apex". So it should gives suggestion for each separate word.
You can modify the query to get what you need. And this is the query structure I created for this sample:
create or replace function sellist(p_search in varchar2)
cursor l_cur is
where employee_id || '-' || upper(first_name || ' ' || last_name) like '%' || upper(nvl(p_search,'~~')) || '%'
and rownum < 11
order by first_name;
for i in l_cur loop
l_list := l_list || '''' || i.employee_id || ':' || i.employee_id || '-' || i.first_name || ' ' || i.last_name || ''',';