Owa_util.ident_arr
Does anyone know how to use this datatype? From what I understand, I use this to capture multiple selections from a drop list. That's all well and good, but is there any way to convert that into a string (delimited) that I can stick into a database column of type varchar2? Help! Please!
You should define an empty variable for the package where you will use this type as a default and for the procedure that will read the array. The code should look something like this...
create package test_package as
empty_array owa_util.ident_arr;
procedure read_proc (the_array owa_util.ident_arr default empty_array);
procedure read_proc is
end;
To grab the data from the array you can then have the procedure perform a loop through the array and reads the values as follows:
create procedure read_proc (the_array owa_util.ident_arr default empty_array) is
begin
for i in 1..the_array loop
htp.p('Value at '| |i| |'= '| |the_array(i));
end loop;
(This is pretty much a high level example). Hope this helps,
- Alex
null
Similar Messages
-
Reg. owa_util.ident_arr
Hi Experts,
I'm stuck up with a procedure where i need to pass multiple checkbox values. So, i'm using owa_util.ident_arr.
But i'm not able to pass any default value for the same (required when 1st time loading the page).
Please consider this a bit urgent.
Help really appreciated.
Best Regards,
Ranit B.ranitB wrote:
Hi Experts,
I'm stuck up with a procedure where i need to pass multiple checkbox values. So, i'm using owa_util.ident_arr.
But i'm not able to pass any default value for the same (required when 1st time loading the page).
Please consider this a bit urgent.
Help really appreciated.
Best Regards,
Ranit B.Urgent issues should be raised with Oracle Support. Urgent issues typically relate to commercially live systems, so posting urgent issues here is a breach of the terms of use of the forums...
>
You may use Community Services subject to the following: (a) Community Services may be used solely for your personal, informational, noncommercial purposes; (b) Content provided on or through Community Services may not be redistributed; and (c) personal data about other users may not be stored or collected except where expressly authorized by Oracle.
>
It is also considered very rude to expect the volunteers of these forums to ignore all other things they are doing or other posts they are answering to help you with your urgent issue, and it is also rude to all the other people posting questions to assume that your question is somehow more important than theirs.
Read the FAQ: {message:id=9360002} especially point 2.
Also, consider that SQL and PL/SQL does not have checkboxes, so your question isn't likely to be relevant to this particular forum, so read that FAQ and ensure you either a) provide sufficient information so that people can help you or b) post sufficient information in the correct forum. -
Cannot Pass owa_util.ident_arr variable to function
I have the following procedure using a cursor with a where clause that depends on a function. The function uses an owa_util.ident_arr type variable. For some reason the package fails to compile due to PLS-00382: Expression is of wrong type. If the function is stripped from the cursor and placed in the body of the package it will compile and execute as expected. Anyone have any ideas what I'm doing wrong?
Compilation errors for PACKAGE BODY WSANDBOX
Error: PLS-00382: expression is of wrong type
Line: 86
Text: WHERE f_ms_val(pv_select , my_table.column1) = 1;
Error: PLS-00306: wrong number or types of arguments in call to 'F_MS_VAL'
Line: 86
Text: WHERE f_ms_val(pv_select , my_table.column1) = 1;
Yada, yada, yada ...
CREATE OR REPLACE PACKAGE wsandbox IS
PROCEDURE p_print(pv_select IN owa_util.ident_arr);
FUNCTION f_ms_val (pv_choice IN owa_util.ident_arr , pv_compare VARCHAR2) RETURN NUMBER;
END wsandbox;
CREATE OR REPLACE PACKAGE BODY wsandbox IS
PROCEDURE p_print(pv_select IN owa_util.ident_arr) IS
CURSOR c_rpt IS
SELECT *
FROM my_table
WHERE f_ms_val(pv_select , my_table.column1) = 1; --<<<pv_select causes error
lv_rpt c_rpt%ROWTYPE;
BEGIN
OPEN c_rpt;
LOOP
FETCH c_rpt
INTO lv_rpt;
EXIT WHEN c_rpt%NOTFOUND;
htp.print(lv_rpt.column2);
htp.nl;
END LOOP;
END p_print;
FUNCTION f_ms_val (pv_choice IN owa_util.ident_arr , pv_compare VARCHAR2) RETURN NUMBER IS
lv_result NUMBER;
lv_select VARCHAR2(10000);
BEGIN
FOR i IN 1.. pv_choice.COUNT LOOP
lv_select := lv_select || ' : ' || pv_choice(i);
lv_result := instr( ' : ' || lv_select || ' : ',
' : ' || pv_compare || ' : ');
IF lv_result > 0 THEN
RETURN 1;
END IF;
END LOOP;
RETURN 0;
END f_ms_val;
END wsandbox;owa_util.ident_array is defined as
type ident_arr is table of varchar2(30) index by binary_integer;and as such a plsql array and as such not recognizable by the sql engine. You need to convert to a proper sql type (e.g. to sys.dbms_debug_vc2coll) to be utilizable by a select statement. -
Problem with OWA_UTIL.IDENT_ARR parameters through mod_plsql in 9iAS
Hi!
We discovered very strange bug in our Oracle environment. We're using the following configuration: Oracle8i (8.1.6), OWA-packages (from 9iAS), 9iAS (Release 1).
Suddenly some procedures stopped working. mod_plsql reports the following
---start-------------------------------------------------------------------------
Thu, 27 Jun 2002 04:42:32 GMT
ORA-06550: line 7, column 2:
PLS-00306: wrong number or types of arguments in call to 'INDICATORS_REPORT1'
ORA-06550: line 7, column 2:
PL/SQL: Statement ignored
DAD name: owh8i
PROCEDURE : htm_client_indicators_leshik.indicators_report1
USER : dwh
URL : http://ntw:80/pls/owh8i/htm_client_indicators_leshik.indicators_report1?monthes_=200206&monthes_=200205&monthes_=200204&client_id_=8175682&division_id_=0&type_balance_=morning&mail_=N&rs_without_rs_=on&rs_without_deposit_=on&rs_without_credit_=on&rs_without_veksel_=on
PARAMETERS :
============
monthes_:
200206
client_id_:
8175682
division_id_:
0
type_balance_:
morning
mail_:
N
rs_without_rs_:
on
rs_without_deposit_:
on
rs_without_credit_:
on
rs_without_veksel_:
on
ENVIRONMENT:
============
PLSQL_GATEWAY=WebDb
GATEWAY_IVERSION=2
SERVER_SOFTWARE=Oracle HTTP Server Powered by Apache/1.3.19 (Unix) mod_perl/1.25 mod_oprocmgr/1.0
GATEWAY_INTERFACE=CGI/1.1
SERVER_PORT=80
SERVER_NAME=ntw
REQUEST_METHOD=GET
QUERY_STRING=monthes_=200206&monthes_=200205&monthes_=200204&client_id_=8175682&division_id_=0&type_balance_=morning&mail_=N&rs_without_rs_=on&rs_without_deposit_=on&rs_without_credit_=on&rs_without_veksel_=on
PATH_INFO=/pls/owh8i/htm_client_indicators_leshik.indicators_report1
SCRIPT_NAME=/pls
REMOTE_HOST=
REMOTE_ADDR=172.16.1.36
SERVER_PROTOCOL=HTTP/1.1
REQUEST_PROTOCOL=HTTP
REMOTE_USER=
HTTP_CONTENT_LENGTH=
HTTP_CONTENT_TYPE=
HTTP_USER_AGENT=Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
HTTP_HOST=ntw
HTTP_ACCEPT=*/*
HTTP_ACCEPT_ENCODING=gzip, deflate
HTTP_ACCEPT_LANGUAGE=en-us
HTTP_ACCEPT_CHARSET=
HTTP_COOKIE=
Authorization=Basic ZHdoOnlmbGp2eWp1aiQ=
HTTP_IF_MODIFIED_SINCE=
HTTP_REFERER=
HTTP_SOAPACTION=
---end---------------------------------------------------------------------------------
here you can see that URL contains substring "monthes_=200206&monthes_=200205&monthes_=200204" but in "parameters" section there's only one "monthes_".
This procedure is part of a package. I tried to create empty package with this procedure alone. And it works. But the original package doesn't work.
Similar things has happened in some other packages. It seems that the problem is somehow connected with IDENT_ARRs.
I can send you configuration files for app server and the problem package.Check for procedure name overloading for the procedure you
are trying to run
If you still have problems, please provide a simple testcase
which shows the procedure signature and how you are attempting
to call it -
Checkboxes: How do you use them to select geometries for display, MapViewer
Dear all
I am working in Oracle 10.2 and using PL/SQL. I am trying to create a procedure that generates a list of spatial layers, based on those currently contained in the database, which uses checkboxes, so that users can select which layers to display.
Once the user has made his choices and the results are submitted, the chosen layers are displayed through MapViewer. Currently the procedure, which is still being developed, is as follows:
PROCEDURE MAPLIST AS
CURSOR curmaplist IS
SELECT spatial_map_name
spatial_map_id
geom
FROM spatial_map_table;
varmaplist curmaplist%ROWTYPE;
varchecked VARCHAR2(32767);
BEGIN
FOR varmaplist in curmaplist LOOP
htp.print('<FORM>
<UL>
<LI>
<LABEL FOR="SM_ID||
curmaplist.spatial_map_id||">
<INPUT type="checkbox"
id="SM_ID||
curmaplist.spatial_map_id||"
name="SM_ID||
curmaplist.spatial_map_id||"
value="MAP TITLE: ||
curmaplist.spatial_map_name" />
</LABEL>
</LI>
</UL>
</FORM>'
EXIT WHEN curmaplist%NOTFOUND;
END LOOP;
END;I am not sure how to incorporate the checked element and then make use of it. Regarding subsequent use, I wondered if an IF statement could be used.
IF VARCHECKED = 'CHECKED' THEN...after this MapViewer XML is added, with the select statement making use of the cursor. For example:
select curmaplist.geom
from geg50160.spatial_map_tableFor the checked part itself, I have found the following Oracle code in Chapter 11 of Oracle Database Application Developer’s Guide - Fundamentals 10.2.
CREATE OR REPLACE PROCEDURE handle_checkboxes ( checkboxes owa_util.ident_arr )
AS
BEGIN
FOR i IN 1..checkboxes.count
LOOP
htp.print('<p>Checkbox value: ' || checkboxes(i));
END LOOP;
END;
/However I am not certain how I would incorporate that into my code. I take it i refers to the checkbox value. I've read that .ident_arr is an array which can hold multiple values but if so I am also not sure why checkboxes are counted.
Kind regards
TimHi GKaiseril,
Thanks for your reply. That's what I'm attempting to do, but I'm largely trying to "borrow" on-line JavaScript (see below) & modify for my PDF Form, w/ rudimentary knowledge gained while surfing the web. The Form has 30 checkboxes that I want to limit users to a max. of 4.
So any add'l scripting tips would be most appreciated.
Thanks!
var NewCount = 0
getField("Check_Box1").value === "Yes"
{NewCount = NewCount + 1}
getField("Check_Box2").value === "Yes"
{NewCount = NewCount + 1}
getField("Check_Box3").value === "Yes"
{NewCount = NewCount + 1}
getField("Check_Box4").value === "Yes"
{NewCount = NewCount + 1}
getField("Check_Box5").value === "Yes"
{NewCount = NewCount + 1}
if (NewCount == 4)
app.alert(“Pick Just Four Please”); return false; -
PLS-00306: wrong number or types of arguments in call in a for loop
Dear all
I recently put up another post about the same error message but as the message now relates to another part of my programme and, in my mind at least, a different conceptual idea, I thought I should start a new top. If that is not right thing to have done then please let me know. I am working in 10.2.
I am trying to pass through multiple variables. When I run the code at the end of this question I get an error message:
PLS-00306: wrong number or types of arguments in call to 'CUR_MAP_LIST'This relates to the line:
FOR var_map_list IN cur_map_list (par_map_list (n))I think the reason the error message comes up is because par_map_list is a associate array / PL/SQL table and cur_map_list is based on %rowtype. Although I could be wrong. However I am not sure what I should be doing so that I don't get such an error message.
I was reading through page 623 on Web Development 9i (by Brown; pub. McGrew-Hill) and pages 357-358 of Oracle Web Application Programming for PL/SQL Developers (by Boardman, Caffrey, Morse, Rosenzweig; pub. Prentice Hall), in order to try and write my code. As well as Oracle's Application Developer’s Guide - Fundamentals (Release 2), page 11-6. In particular the Web Development book uses the following:
create or replace procedure query_department
(in_dept_no owa_util.ident_arr)
is
cursor dept_cursor (nbt_dept_no emp.deptno%TYPE) is
select empno, ename, mgr, sal, comm
from scott.emp
where deptno = nbt_dept_no;
begin
for x in 1 .. in_dept_no.count loop
for dept_rec in dept_cursor(in_dept_no (x)) loop
end loop;
end loop;
end;In that example the cursor selects empno, ename, mgr, sal and comm from emp. So if it is doing that the cursor must be of a VARCHAR2 and NUMBER data type. What I don't understand is the for dept_rec in part. For a start I am not sure where dept_rec comes from? If it is a NUMBER data type, how can the in_dept_no, which is a owa_util.ident_arr associate array / PL/SQL data type work with it. Unfortunately because the example is incomplete and doesn't include procedures relating to the in variables, I am unable to run it and try and learn from what it is doing, so that I can try and relate the concept to my own work.
My programme is as follows. There may be other errors in the code not relating to this error. If so I hope to find these and resolve them once I understand what I should be doing here:
--Global variables--
gvar_mapviewer_host VARCHAR2(56) := 'http://tiger.iso.port.ac.uk:7785/mapviewer/omserver';
gvar_proc_host VARCHAR2(56) := 'http://tiger.iso.port.ac.uk:7785/www/geg50160';
gvar_xml_request VARCHAR2(100) :='?xml_request=<?xml version="1.0" standalone="yes"?>';
--Main calling programming--
PROCEDURE MAPS AS
empty owa_util.ident_arr;
var_xml_theme VARCHAR2(32767);
BEGIN
PROCMAPLIST (empty, var_xml_theme);
END maps;
--create checkboxes--
PROCEDURE PROCCHECKLIST
(par_check_list IN OUT owa_util.ident_arr,
par_xml_theme OUT VARCHAR2
AS
CURSOR cur_map_list IS
SELECT MT.map_title
MI.map_id
OMSN.map_sheet_number_id
WRMF.web_raster_map_id
FROM MAP_TITLE MT
MAP_INFO MI
MAP_SHEET_NUMBER OMSN,
WEB_RASTER_MAP_FILE WRMF,
WHERE MI.map_title_id = MT.map_title_id
AND MI.map_id = OMSN.map_id
AND WRMF.map_id = MI.map_id
AND WRMF.map_sheet_number_id = OMSN.map_sheet_number_id;
var_map_list cur_map_list%ROWTYPE;
var_xml_theme VARCHAR2(32767);
BEGIN
htp.htmlOpen;
htp.headOpen;
htp.headClose;
htp.bodyOpen;
htp.print('<FORM METHOD = "post"
ACTION = "'||gvar_proc_host||'.mappackage.procdisplay">');
htp.print('<FIELDSET>
<LEGEND> Select the maps you wish to display </LEGEND>');
FOR n IN 1 .. par_map_list.COUNT
LOOP
FOR var_map_list IN cur_map_list (par_map_list (n))
LOOP
htp.print(' <UL>
<LI>
<LABEL FOR = "WRMF'||
var_map_list.web_raster_map_id||'">
<INPUT type = "checkbox"
id = "WRMFB'||
var_map_list.web_raster_map_id||'"
name = "WRMFB'||
var_map_list.web_raster_map_id||'"
value = "'||var_map_list.web_raster_map_id||'"
/>
Map title: '|| var_map_list.map_title||'<BR>
Sheet number: '||var_map_list.map_sheet_number||'');
htp.print('</LABEL>
</LI>
</UL>');
END LOOP;
END LOOP;
htp.print('</FIELDSET>');
htp.print('<p>
<INPUT TYPE = "submit"
NAME = "Display selected maps"
VALUE = "Display selected maps" />
</FORM>');
htp.bodyClose;
END PROCCHECKLIST;Thank you for reading. Kind regards
TimDear everyone
I have now resolved the problems I was having with multiple values and checkboxes, thanks to comments in this thread, read large chucks of Oracle PL/SQL Programming by Steve Feuerstein and suddenly realising where I am going wrong in terms of thinking.
For a start, I when I was dealing with the multiple values, I was trying to get PL/SQL to pass them out. Of course this is done by the action part of the input form. Although I have not done much web coding, I did know about this. However because I was so engrossed in trying to understand how multiple values work, I didn't relate the two ideas. I even mind mapping the problem and still didn't get it.
I also did not think to change my the action from post command to get, so that I could see what was coming out. However that would not have made too much of a difference because the other problem I had was related to where sub programmes were declared. The function which received the values was privately declared, and not in the package spec. This meant the web browser could not find the function as that can only make use of the programmes declared publicly.
Once I made these changes, as well as correcting other minor typing mistakes, the values passed through as expected. The only other mistake I made was to include the name option after the submit input type. In my case I did not need to submit the value of that button. The revised code is as follows. In this version I replaced the function with a procedure that simply prints the checkbox values to screen. I have also made the input form action get, instead of post, so that the values can be seen in the web browser address bar:
create or replace
PACKAGE MAPSITE AS
PROCEDURE MAPS;
PROCEDURE PROCCHECKLIST
(par_check_list IN OUT OWA_UTIL.IDENT_ARR
PROCEDURE PROCDISPLAY
(maplist IN OUT OWA_UTIL.IDENT_ARR);
END MAPSITE;
create or replace
PACKAGE BODY MAPSITE AS
--Global variables--
gvar_mapviewer_host VARCHAR2(56) := 'http://tiger.iso.port.ac.uk:7785/mapviewer/omserver';
gvar_proc_host VARCHAR2(56) := 'http://tiger.iso.port.ac.uk:7785/www/geg50160';
gvar_xml_request VARCHAR2(100) :='?xml_request=<?xml version="1.0" standalone="yes"?>';
--Main calling programming--
PROCEDURE MAPS AS
empty owa_util.ident_arr;
BEGIN
PROCCHECKLIST (empty);
END MAPS;
--create checkboxes--
PROCEDURE PROCCHECKLIST
(par_check_list IN OUT owa_util.ident_arr
AS
CURSOR cur_map_list IS
SELECT MT.map_title,
MI.map_id,
OMSN.map_sheet_number_id,
WRMF.web_raster_map_id
FROM MAP_TITLE MT,
MAP_INFO MI,
MAP_SHEET_NUMBER OMSN,
WEB_RASTER_MAP_FILE WRMF
WHERE MI.map_title_id = MT.map_title_id
AND MI.map_id = OMSN.map_id
AND WRMF.map_id = MI.map_id
AND WRMF.map_sheet_number_id = OMSN.map_sheet_number_id;
BEGIN
htp.htmlOpen;
htp.headOpen;
htp.headClose;
htp.bodyOpen;
htp.print('<FORM METHOD = "post"
ACTION = "'||gvar_proc_host||'.mappackage.procdisplay">');
htp.print('<FIELDSET>
<LEGEND> Select the maps you wish to display </LEGEND>');
FOR var_map_list IN cur_map_list
LOOP
htp.print(' <UL>
<LI>
<LABEL FOR = "WRMF'||
var_map_list.web_raster_map_id||'">
<INPUT type = "checkbox"
id = "WRMFB'||
var_map_list.web_raster_map_id||'"
name = "maplist"
CHECKED = "' ||
par_map_list ||'"
value = "'||var_map_list.web_raster_map_id||'"
/>
Map title: '|| var_map_list.map_title||'<BR>
Sheet number: '||var_map_list.map_sheet_number||'');
htp.print('</LABEL>
</LI>
</UL>');
END LOOP;
htp.print('</FIELDSET>');
htp.print('<p>
<INPUT TYPE = "submit"
VALUE = "Display selected maps" />
</FORM>');
htp.bodyClose;
END PROCCHECKLIST;
---PROCDISPLAY PROCEDURE---
PROCEDURE PROCDISPLAY (maplist IN OUT owa_util.ident_arr)
IS
BEGIN
FOR n IN 1..maplist.COUNT
LOOP
htp.print('Checkbox value i.e. var_map_list.web_raster_map_id is: ' ||maplist(n)||'
<P>');
END LOOP;
END PROCDISPLAY;
END MAPSITE;Kind regards
Tim -
How to invoke PL/SQL Table parameter in the query string?
Hello,
I've met a problem invoking PL/SQL Table parameter in the query string, in OWS 3.0.
What I'm going to do is, to invoke a stored procedure to generate a web page using PL/SQL Web Toolkit 2.0, like: "http://.../owa/test_proc".
But there is a IN parameter for this procedure, and it's a PL/SQL Table variable. So I can't invoke the procedure sucessfully just using "http://.../owa/test_proc?v_plsql=i_plsql".
Did someone have met this kind of problem or have the answer to it? Thanks so much for your help.When using procedures with pl/sql-tables as parameter they should be overloaded, e.g.:
procedure my_procedure (my_var in varchar2)...
and
procedure my_procedure (my_var in owa_util.ident_arr)
the procedure then can be called with:
http://..../my_procedure?my_var=Scott, which invokes the version with the varchar2 parameter, or
http://..../my_procedure?my_var=Scott&my_var=Miller......
which invokes the version with the pl/sql-Table
Another solution might be the use of flexible parameters, passing pairs of parameter_name, parameter_value to your procedure. Your procedure looks like:
procedure my_procedure (name_array IN owa.vc_arr, value_array IN owa.vc_arr)..
and is invoked (note the ! )
http://..../!my_procedure?ename=Scott&sal=200&job=clerk.....
looping through the pl/sql tables will retrieve values of ename, sal and job for name_array and Scott, 200 and clerk for value_array
Hth
null -
Pass Checkbox Parameters from HTML Form to a stored procedure
I'm still looking for a solution to my forms problem. FYI, I'm not using Applications Express to build my application--I'm using straight PL/SQL. I need to know how to pass checkbox parameters from my Web form. I'm allowing folks to select one or more checkboxes on a form that will call a delete function to delete the selected records. What I read in Oracle's "Database Application Developer's Guide - Fundamentals" isn't helpful to me. If someone would point me to some examples, maybe I could see what I'm doing wrong. Here's what was written in "Database Application Developer's Guide - Fundamentals":
All the checkboxes with the same NAME attribute make up a checkbox group. If none of the checkboxes in a group is checked, the stored procedure receives a null value for the corresponding parameter.
If one checkbox in a group is checked, the stored procedure receives a single VARCHAR2 parameter.
If more than one checkbox in a group is checked, the stored procedure receives a parameter with the PL/SQL type TABLE OF VARCHAR2. You must declare a type like this, or use a predefined one like OWA_UTIL.IDENT_ARR. To retrieve the values, use a loop:
CREATE OR REPLACE PROCEDURE handle_checkboxes ( checkboxes owa_util.ident_arr )
AS
BEGIN
FOR i IN 1..checkboxes.count
LOOP
htp.print('<p>Checkbox value: ' || checkboxes(i));
END LOOP;
END;
SHOW ERRORS;I'm not sure I understand what your issue is.
If your web form has the following checkboxes defined all with the same name:
<input type="checkbox" name="attrib" value="1">one</input>
<input type="checkbox" name="attrib" value="2">two</input>
<input type="checkbox" name="attrib" value="3">three</input>Then you would create and register a procedure to handle the form submission that has a parameter with the name attrib of type owa_util.ident_arr e.g.:
create or replace procedure handle_form(attrib owa_util.ident_arr) as
iter number;
begin
for iter in attrib.first .. attrib.last loop
-- do something with attrib(iter)
end loop;
end;
/Now the one problem with this handler (or any form handler for that matter) is that if the user selects none of the check boxes, or no value for any of the expected parameters, the handler would be called with some parameters missing or with out any parameters passed to it, and the call will error out.
To get around that you need to provide default values for all the parameters passed to your handler including the ident_arr parameters, however with ident_arr parameters that's difficult to do with standalone procedures. If you place your procedure in a package you can define package level variables of the appropriate types that can be used as default values:
create or replace package my_web as
empty_arr owa_util.ident_arr;
procedure handle_form(attrib owa_util.ident_arr := empty_arr);
end my_web;
create or replace package body my_web as
procedure handle_form(attrib owa_util.ident_arr := empty_arr) as
iter number;
begin
for iter in attrib.first .. attrib.last loop
-- do something with attrib(iter)
end loop;
end;
end my_web;
/now when you hit the situation where the user doesn't select any check boxes, the call to handle_form won't err out due to missing parameters, and the empty_arr won't have any elements to iterate over so the loop in the procedure body will be fine and you will be able to retrieve each selected check box value from the attrib array when you iterate over it. -
Moving only one component value into a register AGAL
Hi
Do any of you know if there is any way in AGAL of moving a component value from one register to the other without touching the other components in the register? I notice that the following line...
mov ft1.a, ft0.a
...will also overwrite the rgb components in ft1 with the rgb components from ft0. At least it does on my machine. In other words, specifying components may reorder (swizzle) the components, but doesn't mask them to preserve the value of other components in the destination register. Probably because each register is 128 bits wide, so it's easier for the GPU to just do the operation on all four components anyway. I'm trying to implement the technique described here:
http://http.developer.nvidia.com/GPUGems/gpugems_ch22.html
Under "22.2.2 Curves". It requires me to process each color component independently."You can't have an HTML form element map to an Oracle PL/SQL procedure parameter that is defined as a TYPE definition"
Sorry, but this is just plain wrong. Passing values to associative arrays (TYPE xxx IS TABLE OF xxx INDEXED BY BINARY_INTEGER) has been possible at least since OAS 4.0.8.
The following simple procedure prints the values passed to it from a form with multiple occurrences of in_val
CREATE OR REPLACE PROCEDURE test_prc (in_val IN owa_util.ident_arr ) IS
BEGIN
for i in in_val.first..in_val.last loop
htp.p(in_val(i));
end loop;
END test_prc;
(owa_util is a SYS package)
As to the original question, it is very hard to say what the problem is without more details about the error that occurs after the migration. -
Request fields in owa (PL/SQL)
Hi!
Probably this is a very trivial question, because I'm newbie in Web PL/SQL programming
How can I retrieve form fields in PL/SQL code? (like the JSP directive request.get_value() or the ASP directive Request.Form() ?)All form fields must be arguments in target procedure ie
<form action=package1.procedure1>
<input type=text name=bla1>
<select name=bla2>
<input type=submit name=bla3>
</form>
... PACKAGE package1 ....
PROCEDURE procedure1 (
bla1 IN VARCHAR2
,bla2 IN VARCHAR2
,bla3 IN VARCHAR2)
IS ....
For inputs with the same name You can use already built in owa_util.ident_arr which is some type of a collection or use Your own one -
I'm using the pl/sql web toolkit, and have a page with checkboxes galore. These pass to the handling procedure as an owa_util.ident_arr. The values that are passed in this array correspond to codes that I need to have in a WHERE clause of some SQl on the handling page...I think I can do something like:
PROCEDURE P_STU_ALL_LIST
p_status_filter owa_util.ident_arr
IS
lv_status_in owa_util.ident_arr DEFAULT p_status_filter;
FOR i IN lv_status_in.FIRST..lv_status_in.LAST
LOOP
where_clause := lv_status(i)||',"
END LOOP;
and then do:
SELECT columns FROM table WHERE MyCodes IN where_clause
but I wonder if there's a way to simply pass the array to the SQL WHERE, like:
SELECT columns FROM table WHERE MyCodes IN table(case(lv_status as ???))
which is described here http://dbaforums.org/oracle/lofiversion/index.php?t15523.html but I can't seem to get the syntax right...I'm not sure what to use as the ??? datatype (anything I try gives errors).
Any ideas...?oBean wrote:
I'm using the pl/sql web toolkit, and have a page with checkboxes galore. These pass to the handling procedure as an owa_util.ident_arr. The values that are passed in this array correspond to codes that I need to have in a WHERE clause of some SQl on the handling page...I think I can do something like:
PROCEDURE P_STU_ALL_LIST
p_status_filter owa_util.ident_arr
IS
lv_status_in owa_util.ident_arr DEFAULT p_status_filter;
FOR i IN lv_status_in.FIRST..lv_status_in.LAST
LOOP
where_clause := lv_status(i)||',"
END LOOP;Horrible. You are creating non-shareable SQL. This is the #1 reason for shoddy Oracle performance.
You cannot use PL/SQL associative arrays in SQL - as the SQL engine does not support PL/SQL data types. PL/SQL however integrates with SQL and support SQL data types.
So you will need to convert the PL/SQL associative array to a SQL collection/array - and then use that SQL type as a bind variable in the SQL statement.
E.g.
{code}
SQL> create or replace type TStrings as table of varchar2(4000);
Type created.
SQL> create or replace procedure FunkyProc( c out sys_refcursor, arr OWA_UTIL.ident_arr ) is
2 sqlArr TStrings;
3 begin
4 sqlArr := new TStrings();
5 sqlArr.Extend( arr.Count );
6 for i in 1..arr.Count loop
7 sqlArr(i) := arr(i);
8 end loop;
9 open c for
10 select
11 object_type, object_name
12 from all_objects
13 where object_type member of sqlArr
14 and owner != 'SYS'
15 and rownum < 11
16 order by 2;
17 end;
18 /
Procedure created.
SQL>
SQL> var c refcursor
SQL> declare
2 arr OWA_UTIL.ident_arr;
3 begin
4 arr(1) := 'TYPE';
5 arr(2) := 'PACKAGE';
6 arr(3) := 'FUNCTION';
7
8 FunkyProc( :c, arr );
9 end;
10 /
PL/SQL procedure successfully completed.
SQL> print c
OBJECT_TYPE OBJECT_NAME
PACKAGE LT
FUNCTION WM$CONVERTDBVERSION
TYPE WM$ED_UNDO_CODE_NODE_TYPE
TYPE WM$ED_UNDO_CODE_TABLE_TYPE
TYPE WM$EVENT_TYPE
FUNCTION WM$GETDBVERSIONSTR
TYPE WM$LOCK_TABLE_TYPE
TYPE WM$NV_PAIR_NT_TYPE
TYPE WM$NV_PAIR_TYPE
TYPE WM_PERIOD
10 rows selected.
SQL>
{code}
PS. A bit of a hack is used to read the associative array - but mostly this will work as developers using associative arrays are ignorant as to how it should be used. They use it as a normal vanilla array. Including the idiots that designed the OWA_UTIL.ident_arr data type as an associative array as oppose to a standard array. -
SIGNATURE (parameter names) MISMATCH
I wrote the procedure to pass a parameter to another procedure p_sel_crse_search
PROCEDURE p_enter_term
IS
BEGIN
---- HTP.p ('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
HTP.p (
'<FORM ACTION="/test/bzskfcls.p_sel_crse_search" METHOD="POST" onSubmit="return checkSubmit()">');
HTP.p (
'<INPUT TYPE="hidden" NAME="p_sel_crse_search" VALUE="p_sel_crse_search">');
HTP.p (
'<TABLE class="dataentrytable" summary="This layout table is used for term selection."width="50%"><CAPTION class="captiontext">Search by Term: </CAPTION>');
HTP.p ('<TR>');
HTP.p (
'<TD class="dedefault"><LABEL for=term_input_id><SPAN class="fieldlabeltextinvisible">Term</SPAN></LABEL>');
HTP.p ('<SELECT NAME="p_term" SIZE="1" ID="term_input_id">');
HTP.p ('<OPTION VALUE="">None');
HTP.p ('<OPTION VALUE="201410">Fall 2013');
HTP.p ('<OPTION VALUE="201320">Spring 2013');
HTP.p ('</SELECT>');
HTP.p ('</TD>');
HTP.p ('</TR>');
HTP.p ('</TABLE>');
HTP.p ('<BR>');
HTP.p ('<BR>');
HTP.p ('<INPUT TYPE="submit" VALUE="Submit">');
HTP.p ('<INPUT TYPE="reset" VALUE="Reset">');
HTP.p ('</FORM>');
END;
PROCEDURE p_sel_crse_search(p_term IN stvterm.stvterm_code%type)
IS
term_arr OWA_UTIL.ident_arr;
BEGIN
htp.p('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
---term_arr (1) := 201320;
term_arr (1) := p_term;
-- OBS term_arr(1) := '201320';
P_CrseSearch_Advanced(term_in => term_arr);
--P_CrseSearch (term_in => term_arr);
END p_sel_crse_search;
I am getting the following error
Failed to parse target procedure
bzskfcls.p_sel_crse_search: SIGNATURE (parameter names) MISMATCH
VARIABLES IN FORM NOT IN PROCEDURE: P_SEL_CRSE_SEARCH
NON-DEFAULT VARIABLES IN PROCEDURE NOT IN FORM:
DAD name: test
PROCEDURE : bzskfcls.p_sel_crse_search
URL : http://dev-ssb-vip.bowdoin.edu:80/test/bzskfcls.p_sel_crse_search
PARAMETERS :
===========
P_SEL_CRSE_SEARCH:
p_sel_crse_search
P_TERM:
201320
ENVIRONMENT:
============
PLSQL_GATEWAY=WebDb
GATEWAY_IVERSION=2
SERVER_SOFTWARE=Oracle-Application-Server-11g
GATEWAY_INTERFACE=CGI/1.1
SERVER_PORT=80
SERVER_NAME=dev-ssb-vip.bowdoin.edu
REQUEST_METHOD=POST
QUERY_STRING=
PATH_INFO=/bzskfcls.p_sel_crse_search
SCRIPT_NAME=/test
REMOTE_HOST=
REMOTE_ADDR=139.140.238.250
SERVER_PROTOCOL=HTTP/1.1
REQUEST_PROTOCOL=HTTP
REMOTE_USER=www2_user
ORACLE_SSO_USER=
OSSO_IDLE_TIMEOUT_EXCEEDED=
OSSO_USER_GUID=
HTTP_CONTENT_LENGTH=49
HTTP_CONTENT_TYPE=application/x-www-form-urlencoded
HTTP_USER_AGENT=Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Win64; x64; Trident/4.0; GTB7.4; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; InfoPath.3)
HTTP_HOST=dev-ssb-vip-test.bowdoin.edu
HTTP_ACCEPT=application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, */*
HTTP_ACCEPT_ENCODING=gzip, deflate
HTTP_ACCEPT_LANGUAGE=en-US
HTTP_ACCEPT_CHARSET=
HTTP_COOKIE=SESSID=MEJIRE44MTgyMDQy; __utma=253559834.1105023054.1363618289.1370889203.1370894368.70; __utmz=253559834.1370894368.70.30.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=bopwdoin%20college; IDMSESSID=6FCCE37AD1073BAE58A72D6471FB4ABE; sghe_magellan_username=Mzg1NzQ=; sghe_magellan_locale=en_US
HTTP_IF_MODIFIED_SINCE=
HTTP_REFERER=https://dev-ssb-vip-test.bowdoin.edu/test/bzskfcls.p_enter_term
HTTP_SOAPACTION=
HTTP_ORACLE_ECID=
HTTP_ORACLE_CACHE_VERSION=
HTTP_AUTHORIZATION=
WEB_AUTHENT_PREFIX=
DAD_NAME=test
DOC_ACCESS_PATH=docs
DOCUMENT_TABLE=wpg_document
PATH_ALIAS=
REQUEST_CHARSET=AL32UTF8
REQUEST_IANA_CHARSET=UTF-8
SCRIPT_PREFIX=
HTTP_IF_MATCH=
HTTP_CACHE_CONTROL=
SOAP_BODY=
HTTP_X_ORACLE_DEVICE_CLASS=
HTTP_X_ORACLE_DEVICE_ORIENTATION=
HTTP_X_ORACLE_DEVICE_MAXDOCSIZE=
HTTP_X_ORACLE_DEVICE=
HTTP_X_ORACLE_ORIG_ACCEPT=
HTTP_X_ORACLE_ORIG_USER_AGENT=
HTTP_X_ORACLE_USER_LOCALE=
HTTP_X_ORACLE_USER_NAME=
HTTP_X_ORACLE_USER_DISPLAYNAME=
HTTP_X_ORACLE_USER_USERKIND=
HTTP_X_ORACLE_USER_AUTHKIND=
HTTP_X_ORACLE_USER_DEVICEID=
HTTP_X_ORACLE_USER_LOCATION_ADDRESSLINE1=
HTTP_X_ORACLE_USER_LOCATION_ADDRESSLINE2=
HTTP_X_ORACLE_USER_LOCATION_ADDRESSLASTLINE=
HTTP_X_ORACLE_USER_LOCATION_BLOCK=
HTTP_X_ORACLE_USER_LOCATION_CITY=
HTTP_X_ORACLE_USER_LOCATION_COMPANYNAME=
HTTP_X_ORACLE_USER_LOCATION_COUNTY=
HTTP_X_ORACLE_USER_LOCATION_STATE=
HTTP_X_ORACLE_USER_LOCATION_POSTALCODE=
HTTP_X_ORACLE_USER_LOCATION_POSTALCODEEXT=
HTTP_X_ORACLE_USER_LOCATION_COUNTRY=
HTTP_X_ORACLE_USER_LOCATION_TYPE=
HTTP_X_ORACLE_USER_LOCATION_X=
HTTP_X_ORACLE_USER_LOCATION_Y=
HTTP_X_ORACLE_SERVICE_HOME_URL=
HTTP_X_ORACLE_SERVICE_PARENT_URL=
HTTP_X_ORACLE_HOME_URL=
HTTP_X_ORACLE_MODULE_CALLBACK_URL=
HTTP_X_ORACLE_MODULE_CALLBACK_LABEL=
HTTP_X_ORACLE_CACHE_USER=
HTTP_X_ORACLE_CACHE_SUBID=
HTTP_X_ORACLE_CACHE_AUTH=
HTTP_X_ORACLE_CACHE_DEVICE=
HTTP_X_ORACLE_CACHE_LANG=
HTTP_X_ORACLE_CACHE_ENCRYPT=
HTTP_X_ORACLE_ASSERT_USER=Check if the stvterm.stvterm_code%type is of type varchar2 or number? The parameter p_term value is 201320 which might be coming as varchar2 while the svtterm_code might be a number or vice versa and hence causing the mismatch.
Rgds
San -
Passing a html array to a procedure then to another procedure
Hi Sir,
Passing an array from html to procedure can be done by having html form elements with same name and a IN parameter in procedure that uses OWA_UTIL.IDENT_ARR as the datatype.
What if from the receiving procedure A, I want to pass the array further to another procedure B:
1)How should I write the statement to pass?
2)How should I declare the parameter in procedure B?
Please advise.
Thanks.Hi Sir,
Passing an array from html to procedure can be done by having html form elements with same name and a IN parameter in procedure that uses OWA_UTIL.IDENT_ARR as the datatype.
What if from the receiving procedure A, I want to pass the array further to another procedure B:
1)How should I write the statement to pass?
2)How should I declare the parameter in procedure B?
Please advise.
Thanks. -
Htp.formSelectOpen cattributes=multiple problem
I'd like to select more than one option from HTML "SELECT" drop-down list, so I use a "multiple" attrib in the html-code.
How (which data type?) can I got all selection in the PL/SQL procedure?
My html-form:
<form name="my_form" action="my_package.my_procedure" method=post>
<select name=my_selection multiple>
<option>one
<option>two
<option>three
</select>
<input type=submit name=my_button value="Send">
my_procedure ( my_button varchar2 default NULL,
my_selection ?????? ) is
etc...
So: What is the correct data type for my_selection? If I use varchar2, I got exactly ONE selected value. :(You can handle multiple values in PL/SQL tables. When creating the procedure that receives the form
values, you must define a parameter as a PL/SQL table to collect the corresponding values from the
form.
If a value is not provided (that is, if the user fails to select an option), an error occurs. You cannot
provide a default for a PL/SQL table, so if you cannot guarantee that at least one value is submitted,
you must use a hidden field to provide the first value.
PROCEDURE multi (p_depts IN owa_util.ident_arr)
IS
v_ct NUMBER(3);
BEGIN
v_ct := p_depts.COUNT;
htp.print(You selected ||v_ct - 1|| choices);
htp.print(Those choices are :);
htp.olistOpen;
FOR counter IN 2..v_ct LOOP
htp.listItem(p_depts(counter));
END LOOP;
htp.olistClose;
END;In the sample p_depts should be the name of the list.
The IDENT_ARR type is a VARCHAR2(30) table, indexed by binary_integer values.
You do not need to use this supplied data type, but you must use a VARCHAR2 table.
The count has one subtracted, and the loop begins at the second element. Remember that a hidden
field is used to guarantee that some data is passed. -
How can I define a procedure with a default (null) parameter, when the parameter type is as owa_util.ident_arr or vc_arr ?
This doesn't work..
proc_name(
p_1 owa_util.ident_array default (null),
p_2 owa_util.vc_arr default (null)
nullAll the data conversions are necessary because you're comparing a number (SRBRECR_TERM_CODE) with a character ('%').
SQL> select ename, sal from emp
2 where deptno = to_number(case when to_char('&&dno') = '%' then to_char(deptno)
else '&&dno' end)
3 /
Enter value for dno: 10
old 2: where deptno = to_number(case when to_char('&&dno') = '%' then to_char(
deptno) else '&&dno' end)
new 2: where deptno = to_number(case when to_char('10') = '%' then to_char(dep
tno) else '10' end)
ENAME SAL
BOEHMER 2450
SCHNEIDER 5000
KISHORE 1300
SQL> undef dno
SQL> r
1 select ename, sal from emp
2* where deptno = to_number(case when to_char('&&dno') = '%' then to_char(deptno)
else '&&dno' end)
Enter value for dno: %
old 2: where deptno = to_number(case when to_char('&&dno') = '%' then to_char(
deptno) else '&&dno' end)
new 2: where deptno = to_number(case when to_char('%') = '%' then to_char(dept
no) else '%' end)
ENAME SAL
CLARKE 800
VAN WIJK 1600
PADFIELD 1250
ROBERTSON 2975
BILLINGTON 1250
SPENCER 2850
BOEHMER 2450
RIGBY 3000
SCHNEIDER 5000
CAVE 1500
KULASH 1100
HALL 950
GASPAROTTO 3000
KISHORE 1300
14 rows selected.
SQL>Cheers, APC
blog: http://radiofreetooting.blogspot.com
Maybe you are looking for
-
ASP / PHP pages: How to get streaming info from a XML file?
Hi all I am using Adobe Flash Media Streaming Server 3.5 but I can't find any output file (fx a xml file) that I can pull out info from and use on my website via a PHP or ASP script. It could be nice - in the website - to retrieve info like "online u
-
Cannot Install Itunes 8 so can't update Iphone
Hi All, For some reason i can't install Itunes 8 onto my computer.... When I click on the link it says it "is not a valid WIN32 application". Does anyone know what this means, or how to fix it? Because I can't get itunes 8 I can't update my iphone...
-
IPhoto won't import .mov files from iPhone
I'm trying to import the photos and videos from my iPhone and the following screen shows up: I've only had this trouble since updating to Yosemite. Any help is appreciated. MacBook Pro (17-inch, Mid 2010) 8GB Memory 2.53 GHz Intel Core i5
-
Variable Personalization - "Save Value" Variant Setting missing in Bex 7.x
Hallo Experts, in Bex 3.x when creating a Variant (Button "Save All Variants" in the Variable Pop-Up) i was able to decide (via field "Save Values" in the "Save All Variants" Screen) wheter i want to save the values for a certain variable or not (NO
-
HI - I'm new to this, and can't get my iPod Shuffle to show as "device" to I can move music I've purchased on iTunes to my Shuffle. Any help is greatly appreciated.