Current Position:Home > Select in PL/SQL

Select in PL/SQL

Update:11-30Source: network consolidation
Advertisement
I have a select in a procedure with a multiple select option to "on"...or user can select multiple items....
I want to know which items user has selected....what is the best way to do it...
Thanks,
Harsimrat

The Best Answer

Advertisement
It this what you are looking for?
create or replace package msw_pkg as
type array_type is table of varchar2(100) index by binary_integer;
v_arr array_type;
procedure msw1;
procedure msw2(pcourses               in array_type default v_arr);
end msw_pkg;
show errors
create or replace package body msw_pkg as
procedure msw1 is
begin
htp.p('<form action="msw_pkg.msw2" method="post">
<select size="6" multiple name="pcourses">
<option value="1">opt1</option>
<option value="2">opt2</option>
<option value="3">opt3</option>
</select>
<input type="submit">
</form>
end msw1;
procedure msw2(pcourses               in array_type default v_arr) is
begin
for i in 1..pcourses.count
loop
htp.p(pcourses(i));
end loop;
end msw2;
end msw_pkg;
show errors
  • Using select * in pl/sql Update:11-30

    Hi, Yesterday Karthick mentioned that using SELECT * in PL/SQL is not a good idea. But I tried by creating a table and different procedures with selecting all columns using * and specifying the columns individually. Later I altered the table and both

  • Select Expert or SQL Expression Fields help Update:11-30

    I am trying to do something I would consider very simple but can figure it out. I have two tables.  FDC_Trips & Facility.  On the report I can get the FDC_Trips.DivertedbyFacility field to populate a number value because that field is an integer.  Bu

  • Select works with SQL Server but not with Oracle! Update:11-30

    Hello this select works on SQL Server correct, but it don't work on Oracle! Can someone help me? Select * from Tabelle, Tabelle as XXX Where Tabelle.ID=XXX.IDTabelle Thanks ThomasHi, These are the things which I have noticed, which wont work in Oracl

  • Insert into using a select and dynamic sql Update:10-11

    Hi, I've got hopefully easy question. I have a procedure that updates 3 tables with 3 different update statements. The procedure goes through and updates through ranges I pass in. I am hoping to create another table which will pass in those updates a

  • Setting current values in Multiple Select List in SQL Query based Report Update:10-11

    Hi, I have a report based on a sql query that contains a multiple select list. Unfortunately I cannot get the multiple select list to display the current values (p_value) correctly. I have created a page item, :p311_current_versions, that is set usin

  • Selecting from a SQL Server 2005 with long column names ( 30 chars) Update:10-11

    Hi, I was able to set up a db link from Oracle 11.2.0.1 to SQL Server 2005 using DG4ODBC. My problem is that some column names in the Sql Server are longer than 30 chars and trying to select them gives me the ORA-00972: identifier is too long error.

  • Select in pl/sql stored proc. Update:10-11

    Hi friends, I am new to oracle development and were trying to write some basic stored procedure,when i try to put a simple stored select statment in between my 'BEGIN' and 'END' clause it never let me do that,it says that 'INTO' clause is expected,I

  • Select works in SQL Workshop, but not as an LOV Update:10-11

    I want all venues to appear in my LOV With their affiliated Performing Arts Center, if one exists. I get the perfect results when I run it in SQL Workshop. When I try to create the LOV, I'm told it's invalid, because it includes an in-line query and

  • Select from in SQL Developer fails - SQL*Plus works Update:10-11

    Hello All, I've got the HS connection to MySLQ working correctly and most of the requirements I have with respect to the data is working. However, i"m only able to test my procedures and functions in SQL*PLus. IN SQL Developer 4.0.0.12 there is alway

  • Sub selects in a SQL statement Update:10-11

    Hi, I have a query with an obsene amount of sub selects, for example : SELECT p.ID, (select something from data where id = p.id) data1, (select somelse from data2 where id = p.id) data2, (select someelse from data3 where id = p.id) data3, (select som