Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: owa_util.listprint question
A copy of this was sent to AleX <korrozia_at_my-deja.com>
(if that email address didn't require changing)
On Mon, 28 Jun 1999 20:04:42 GMT, you wrote:
> Hi!
>
>
>I have a simple pl/sql question.
>
>I'm trying to create a select drop-down list for a pl/sql query.
>My code looks like this:
>
>procedure session_selector
> is
> p_query varchar2(100);
> v_cursorID integer;
> begin
> htp.bodyopen;
> htp.formOpen ('presentation_builder.get_session_data');
> p_query:='SELECT session_id FROM SESSION_LIST_TABLE';
> v_cursorID:=owa_util.bind_variables (p_query);
> owa_util.listprint (v_cursorID, 'p_value',10);
> htp.para;
> htp.formSubmit;
> htp.formclose;
> htp.bodyclose;
> end session_selector;
>
>=======
>
>I get 'variable not in select list' when I run this procedure. However,
> owa_util.cellsprint works just fine with the same cursor. I'm on 8.0.5
>on NT. Please help!
You must use a query that returns 3 columns:
-- -- Create a multi select list, a drop down list or a single select list. -- You send it a query that selects out in ORDER: -- COLUMN 1 - What your procedure will get back -- COLUMN 2 - What your user will see in the list box -- COLUMN 3 - a null or non-null field. If the field is non-null, -- the current row will be flagged as SELECTED in the list box --
So, at a minimum you can try:
p_query:='SELECT session_id, session_id, NULL FROM SESSION_LIST_TABLE';
that will show to the user the same thing your procedure gets back and have none of them selected by default. Another example might be:
select user_id, username, decode(username,'SYS',1,NULL) from all_users
that would create a list that returns to your procedure the USER_ID but lets the end user pick from a list of USERNAMES and has the SYS user selected by default.
--
See http://govt.us.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Part I of V, Autonomous Transactions" updated June 21'st
Thomas Kyte tkyte_at_us.oracle.com Oracle Service Industries Reston, VA USA
Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Mon Jun 28 1999 - 15:36:13 CDT