Multiple values in a table
Dear,1. I have a table
select
"ROWID",
"ORDER_ID",
"LOCATION_ID",
PLACE_FROM,
PLACE_TO,
DELIVERY_PRICE
from "#OWNER#"."ORDER_LOCATION"
WHERE ORDER_ID = :P3_ORDER_ID
2-build process named (ORDER_PROCESS)declare
px01 varchar2(100) := dbms_assert.enquote_literal(apex_application.g_x01);
V_PLACE_FROM varchar2(30);
V_PLACE_TO varchar2(30);
V_DELIVERY_PRICE NUMBER;
v_sql varchar2(1000) := 'select get_state_name(place_to) place_to_state,get_state_name(place_from) place_from_state,
place_to,DELIVERY_PRICE
from LOCATION_SHEET WHERE LOCATION_ID = ';
begin
v_sql := v_sql || px01;
execute immediate v_sql into V_PLACE_FROM,V_PLACE_TO,V_DELIVERY_PRICE;
htp.prn(V_PLACE_FROM);
htp.prn(V_PLACE_TO);
htp.prn(V_DELIVERY_PRICE);
exception
when others then
NULL;
end;
3. in the header html page, I put this javascript code to get (place_to, place_from, delivery_price) when I choose selection list location_if<script type="text/javascript">
function getlocation(pThis) {
var tid = pThis.id.replace("f04","f05","f06","f07");
ajaxRequest = new htmldb_Get(
null,$v('APP_ID'),'APPLICATION_PROCESS=ORDER_PROCESS',0);
ajaxRequest.addParam('x01',$v(pThis));
ajaxResponse = ajaxRequest.get();
$s(tid,ajaxResponse );
}
</script>
4. in the column location_id, I put in the attributes of the element: onchange = "getlocation (this); »but when I choose to location_id (selection list) not take the values column (place_to, place_from, delivery_price), what is the problem please
Ahmed
Now check out your page.
Are there errors in your process of OnDemand. Don't know what it should be, I just got rid of the errors.
declare
px01 varchar2(100) := dbms_assert.enquote_literal(apex_application.g_x01);
V_PLACE_FROM varchar2(30);
V_PLACE_TO varchar2(30);
V_DELIVERY_PRICE NUMBER;
/*
v_sql varchar2(1000) := 'select get_state_name(place_to) place_to_state,get_state_name(place_from) place_from_state,
place_to_id,DELIVERY_PRICE
*/
v_sql varchar2(1000) := 'select get_state_name(place_to_id) place_to_state,get_state_name(place_from) place_from_state,
DELIVERY_PRICE
from LOCATION_SHEET WHERE LOCATION_ID = ';
begin
v_sql := v_sql || px01;
execute immediate v_sql into V_PLACE_FROM,V_PLACE_TO,V_DELIVERY_PRICE;
htp.prn(V_PLACE_FROM||':'||V_PLACE_TO||':'||V_DELIVERY_PRICE);
exception
when others then
htp.prn(sqlerrm);
--NULL;
end;
WHEN OTHER THEN NULL; is to be avoided at any time.
There is no place_to of the column in the LOCATION_SHEET table. Wouldn't be place_to_id? I made this assumption.
See you soon,.
Tags: Database
Similar Questions
-
Return multiple values from a table
Hi there I'm working on a bit of sql that returns values when they exist in a table.
The code I have returns the correct value when there is an entry in the tbl_studentmodules table, as soon as there is more than one entry in this table it does display no line at all: (.)
Can someone tell how to return multiple values?
Thanks in advance!select modulename from tbl_modulefeedback where 1 = (select count(*) from tbl_studentmodules where upper(:APP_USER) = upper(student_id)) and 1 = (select count(*) from tbl_modulefeedback, tbl_studentmodules where tbl_modulefeedback.modulecode = tbl_studentmodules.modulecode)
AshleighTry this:
select modulename from tbl_modulefeedback where 1 <= (select count(*) from tbl_studentmodules where upper(:APP_USER) = upper(student_id)) and 1 <= (select count(*) from tbl_modulefeedback, tbl_studentmodules where tbl_modulefeedback.modulecode = tbl_studentmodules.modulecode)
When you ask questions, please enter CREATE TABLE and INSERT some commands to make it easier to help you.
-
Peovisioning attribute to multiple values in a table SQL using the GTC in detail
I have a recon trust implemented Sun LDAP for IOM followed to auto put into service at table 'MyUser' to SQL using GTC. It works great so far.
Now the difficult part of the requirements. I have a multivalued attribute called "AppRoles" associated with Sun's LDAP user. I would like access to this attribute to the 'MyUserToRole' of SQL table (this is a picture of detail table Master "MyUser"). What should be the best approach to this task?
Thank you!
KabiFor the look-up:
Once you run Trusted Recon, all your AppRoles are inserted in this research and the different lines for different users. Use the IOM API for this. A basic structure could be as follows:Code - Decode
User01 - Role01, Role02
User02 - Role02, Role03, Roel04
User03 - Role08, Role12In this way all the roles are stored in this research. Bu the only problem with it could be the change in the look upwards manually which could be tolerated as there are glitches with almost all of the solutions implemented.
--------------------For the field of the UDF
Yes, their would be a limitation in the text box and it is * 200 * characters. So if that's the case then you should go for the look-up which has no such restrictions at least for your condition. -
Multiple values in a single Table cell
Hello
I have a requirement of the customer. I need to show multiple values within a table cell
Example of
Location City Shop North City A HS-200, SH-210, SH310 South City B SH - 100, SH341 East City C SH-20 But my table shows repeating cell as follows.
Location City Shop North City A SH-200 North City A SH-210 North City A SH310 South City B SH-100 South City B SH341 East City C SH-20 So I need your help to show repeated STORE name in a single column of the Table.
Thank you
Try this
EVALUATE_AGGR ('LISTAGG (%1, %2) within THE GROUP (ORDER BY DESC %3)', TableName.ColumnName, ',', TableName.ColumnName)
-
How to use Ajax get multiple values in an array?
Hi All-
I am using AJAX to get multiple values in a table using example of Denes Kubicek in the following link-
http://apex.oracle.com/pls/otn/f?p=31517:239:9172467565606:NO:
Basically, I want to use the drop-down list to fill the rest of the values in the form.
I created the example (Ajax get several values, 54522 application) on the Oracle site.
http://apex.oracle.com/pls/apex/f?p=4550:1:0:
Workspace: iConnect
Login: demo
password: demo
I was able to reproduce his example on page 1 (homepage).
However, I want to use system generate a table to complete this example and was not able to complete the data correctly.
Page 2 (method 2) is that I'm struggling to fill the column values. When I checked the item application values in the Session, and values seems to be filled properly.
That's what I did on this page:
1 create an Application process on-demand - Set_Multi_Items_Tabular2:
DECLARE v_subject my_book_store.subject%TYPE; v_price my_book_store.price%TYPE; v_author my_book_store.author%TYPE; v_qty NUMBER; CURSOR cur_c IS SELECT subject, price, author, 1 qty FROM my_book_store WHERE book_id = :temporary_application_item2; BEGIN FOR c IN cur_c LOOP v_subject := c.subject; v_price := c.price; v_author := c.author; v_qty := c.qty; END LOOP; OWA_UTIL.mime_header ('text/xml', FALSE); HTP.p ('Cache-Control: no-cache'); HTP.p ('Pragma: no-cache'); OWA_UTIL.http_header_close; HTP.prn ('<body>'); HTP.prn ('<desc>this xml genericly sets multiple items</desc>'); HTP.prn ('<item id="f04_' || :t_rownum || '">' || v_subject || '</item>'); HTP.prn ('<item id="f05_' || :t_rownum || '">' || v_price || '</item>'); HTP.prn ('<item id="f06_' || :t_rownum || '">' || v_author || '</item>'); HTP.prn ('<item id="f07_' || :t_rownum || '">' || v_qty || '</item>'); HTP.prn ('</body>'); END;
2. create two objects application - TEMPORARY_APPLICATION_ITEM2, T_ROWNUM2
3. put the following text in the Page header:
<script language="JavaScript" type="text/javascript"> function f_set_multi_items_tabular2(pValue, pRow){ var get = new htmldb_Get(null,html_GetElement('pFlowId').value, 'APPLICATION_PROCESS=Set_Multi_Items_Tabular2',0); if(pValue){ get.add('TEMPORARY_APPLICATION_ITEM2',pValue) get.add('T_ROWNUM2',pRow) }else{ get.add('TEMPORARY_APPLICATION_ITEM2','null') } gReturn = get.get('XML'); if(gReturn){ var l_Count = gReturn.getElementsByTagName("item").length; for(var i = 0;i<l_Count;i++){ var l_Opt_Xml = gReturn.getElementsByTagName("item")[i]; var l_ID = l_Opt_Xml.getAttribute('id'); var l_El = html_GetElement(l_ID); if(l_Opt_Xml.firstChild){ var l_Value = l_Opt_Xml.firstChild.nodeValue; }else{ var l_Value = ''; } if(l_El){ if(l_El.tagName == 'INPUT'){ l_El.value = l_Value; }else if(l_El.tagName == 'SPAN' && l_El.className == 'grabber'){ l_El.parentNode.innerHTML = l_Value; l_El.parentNode.id = l_ID; }else{ l_El.innerHTML = l_Value; } } } } get = null; } </script> Add the follwing to the end of the above JavaScript: <script language="JavaScript" type="text/javascript"> function setLOV(filter, list2) { var s = filter.id; var item = s.substring(3,8); var field2 = list2 + item; f_set_multi_items_tabular2(filter, field2); }
4 query in the form:
select "BOOK_ID", "BOOK", "SUBJECT", "PRICE", "AUTHOR", "QTY", "BOOK_ID" BOOK_ID_DISPLAY from "#OWNER#"."MY_BOOK_STORE"
5. in the column of Book_ID_DISPLAY attribute:
Add the following code to the attributes of the element: onchange = "javascript:f_set_multi_items_tabular2(this.value,'#ROWNUM#'); »
Changed-> onchange = "javascript:setLOV(this,'f03'); »
Now, T_ROWNUM2 returns the value as f03_0001. But TEMPORARY_APPLICATION_ITEM2 returns in the form [object HTMLSelectElement]...
Please help me to see how I can fill the data in the tabular presentation format. Thank you in advance!
Ling
Updating code in red...
Ling
LC says:
Application Item Value Item Name 54522 3 TEMPORARY_APPLICATION_ITEM2 54522 f03_0003 T_ROWNUM2 No T_ROWNUM2 should be 0003.
I made a copy of your page to make corrections.
There are several problems.
First you where submiting T_ROWNUM2 whereas you would use: t_rownum in the pl/sql code.
I changed the name of the element in the f_set_multi_items_tabular2.
Secondly you where now affecting the rownumber f03_0001 for the first line.
Resulting XML returned as follows.
this xml genericly sets multiple items - CSS Mastery
- 22
- Andy Budd
- 1
I changed the following text in the show_lov.
var point = s.substring (4.8);
var Field2 = item;
I also had a compilation of pl/sql code error, there was a); missing the end of the last item. Fixed that too.
But why do you think lpad won't work for lines 10 and more.
LPAD ('10', 4, '0') will give "0010"
LPAD ('100 ', 4,'0 ') will give "0100"
LPAD ('1000 ', 4,'0 ') will give '1000'
So unless you have more than 9999 lines you would have no problem.
Nicolette
-
Possible to contain variable multiple values?
Is it possible the variable contains multiple values?
In fact, I need to hold a multiple value multiple value.
Procedure:
Remove employee where empno in (#variable)
Table Employees: Informix
variable code #:
Select relieved_employee_id in the relieved_employees (return multiple values)
Employees table raised is in SQL SERVER
any other approach simple approach...
How can I approach my requriement?Hello
Is it possible the variable contains multiple values?
Usually variable ODI hold one value returned by a select query
Procedure:
Remove employee where empno in (#variable)
Table Employees: Informix
variable code #:
Select relieved_employee_id in the relieved_employees (return multiple values)
Employees table raised is in SQL SERVER
any other approach simple approach...
How can I approach my requriement?
You can try something simiral to the following
create an ODI procedure
Command on the source tab:
SQL SERVER technology
Logic diagram should point to your schema that contains the table of relieved_employeesquery: Select relieved_employee_id you relieved_employees EMP_ID
Target control on the tab:
Technology: Informix
Logic diagram should point to your schema that contains the employees tablequery: delete from employee where empno = #EMP_ID
This will make a loop through all the values returned by your query source and delete target.
Thank you
Fati -
Gears - error when you try to insert values into a table with multiple columns
Hello
I started playing with the gears and SQlLite today and I get an error when I try to insert values into a table with multiple columns.
I have:
var db = google.gears.factory.create('beta.database'); db.open('developerSet'); db.execute('create table if not exists Developers (DeveloperName text, DeveloperAge int)'); var devName = "Davy" var devAge = 32; try { db.execute('insert into Developers values (?, ?)', [devName, devAge]); alert('success'); } catch (e) { alert(e); }
I get the error:
net.rim.device.api.database.DatabaseException; insert into developers values (?,?): SQL logic error or missing database.
I use this reference: http://code.google.com/apis/gears/api_database.html
Everything works if I have only one field as:
var db = google.gears.factory.create('beta.database'); db.open('developerSet'); db.execute('create table if not exists Developers (DeveloperName text)'); var devName = "Davy" var devAge = 32; try { db.execute('insert into Developers values (?)', [devName]); alert('success'); } catch (e) { alert(e); }
I use the plug-in Visual Studio 2.0 for 2008 that are running Windows XP SP and Simulator 2.13.0.56
Thank you
Davy
Yes, a SQLite database will persist between battery pulls. The database is registered either to internal MEM or removable media (not the device memory), depending on which is available on your device.
In general, its not considered a best practice to remove your table as soon as it is empty and re - create it again when you want to add data. This adds extra overhead fresh for the final, delete and insert first for a given table. Instead, define and finalize your drawing before you create your table. Once created, review the static schema.
That being said, for development purposes, it may be easier to provide an easy way to drop your tables while you develop your schema.
See you soon,.
Adam
-
query multiple instances of the table min value using the Group of
Hi all
I use Oracle 10.2 on Windows 2003
I'm trying to select the value min for a table, and if there are several occurrences of a value min, the list of all and not just a line. For example, the following query
gives the following resultswith test1 as( select to_date('2009-11-01','YYYY-MM-DD') t_date, 't_1' t_name, '1' t_value from dual union all select to_date('2009-12-01','YYYY-MM-DD') t_date, 't_1' t_name, '2' t_value from dual union all select to_date('2010-01-01','YYYY-MM-DD') t_date, 't_1' t_name, '1' t_value from dual union all select to_date('2010-02-01','YYYY-MM-DD') t_date, 't_1' t_name, '3' t_value from dual union all select to_date('2010-03-01','YYYY-MM-DD') t_date, 't_1' t_name, '4' t_value from dual union all select to_date('2010-04-01','YYYY-MM-DD') t_date, 't_1' t_name, '5' t_value from dual union all select to_date('2010-05-01','YYYY-MM-DD') t_date, 't_1' t_name, '6' t_value from dual union all select to_date('2010-06-01','YYYY-MM-DD') t_date, 't_1' t_name, '1' t_value from dual union all select to_date('2010-07-01','YYYY-MM-DD') t_date, 't_1' t_name, '1' t_value from dual ) select trunc(t_date,'YYYY') t_date, min(t_value) min_value from test1 group by trunc(t_date,'YYYY')
then I looked at the forums and tried the following queryt_date min_value --------- -------------- 01-JAN-09 1 01-JAN-10 1
I get the results you want with this query, which arewith test1 as( select to_date('2009-11-01','YYYY-MM-DD') t_date, 't_1' t_name, '1' t_value from dual union all select to_date('2009-12-01','YYYY-MM-DD') t_date, 't_1' t_name, '2' t_value from dual union all select to_date('2010-01-01','YYYY-MM-DD') t_date, 't_1' t_name, '1' t_value from dual union all select to_date('2010-02-01','YYYY-MM-DD') t_date, 't_1' t_name, '3' t_value from dual union all select to_date('2010-03-01','YYYY-MM-DD') t_date, 't_1' t_name, '4' t_value from dual union all select to_date('2010-04-01','YYYY-MM-DD') t_date, 't_1' t_name, '5' t_value from dual union all select to_date('2010-05-01','YYYY-MM-DD') t_date, 't_1' t_name, '6' t_value from dual union all select to_date('2010-06-01','YYYY-MM-DD') t_date, 't_1' t_name, '1' t_value from dual union all select to_date('2010-07-01','YYYY-MM-DD') t_date, 't_1' t_name, '1' t_value from dual ) select t_date,min_value from (select t_date,min(t_value) min_value, rank() over (order by min(t_value) ASC) RN from test1 group by t_date) where rn=1
the problem is, when I change the values in the table test1 as followst_date min_value --------- -------------------- 01-NOV-09 1 01-JAN-10 1 01-JUN-10 1 01-JUL-10 1
I get the following resultswith test1 as( select to_date('2009-11-01','YYYY-MM-DD') t_date, 't_1' t_name, '123' t_value from dual union all select to_date('2009-12-01','YYYY-MM-DD') t_date, 't_1' t_name, '2' t_value from dual union all select to_date('2010-01-01','YYYY-MM-DD') t_date, 't_1' t_name, '21' t_value from dual union all select to_date('2010-02-01','YYYY-MM-DD') t_date, 't_1' t_name, '13' t_value from dual union all select to_date('2010-03-01','YYYY-MM-DD') t_date, 't_1' t_name, '24' t_value from dual union all select to_date('2010-04-01','YYYY-MM-DD') t_date, 't_1' t_name, '15' t_value from dual union all select to_date('2010-05-01','YYYY-MM-DD') t_date, 't_1' t_name, '26' t_value from dual union all select to_date('2010-06-01','YYYY-MM-DD') t_date, 't_1' t_name, '100' t_value from dual union all select to_date('2010-07-01','YYYY-MM-DD') t_date, 't_1' t_name, '2' t_value from dual ) select t_date,min_value from (select t_date,min(t_value) min_value, rank() over (order by min(t_value) ASC) RN from test1 group by t_date) where rn=1
I expected to get the resultst_date min_value ---------- ------------- 01-JUN-10 100
any help would be appreciatedt_date min_value -------- -------------- 01-DEC-09 2 01-JUL-10 2
See you soonHello
The string "100" comes before "2" in the sort order for the same reason that 'ALL' comes before 'B '.
If you want to t_value a number, make a NUMBER, not a VARCHAR2 column.
I f you can do that, then you can try to use TO_NUMBER to convert it to a NUMBER.
but you will get an error if Island column already contains everything that cannot be interpreted as a NUMBER. -
Get multiple values in a select statement in a variable to a procedure
Hello
I'm trying to craete a procedure where the entry of the procedure will be a similar string "a, b, c, d" and output the values of a table that matches the value separated by commas of in sting.
For this.
create table test (varchar2 (10)) nm;
Insert test values ('a');
Insert test values ('b');
Insert test values ('c');
Insert test values (');
Select * from test;
NM
------
one
b
c
d
Now I'm doing a procedure where the parameter will be the column values NM of TEST table in a string separated by commas like "a, b, c, d, x, l" there could be false values also.
The procedure will return only the values that are adapted with column NM from the TEST table for this I created this procedure.
create or replace procedure p_test (p_nm IN varchar2 / *, THE sys_refcursor p_out * /)
is
number of l_len;
l_val varchar2 (10);
l_val1 varchar2 (10);
Start
l_len: = length (p_nm);
-dbms_output.put_line (l_len);
Start
because me in 1.l_len
loop
Select REGEXP_SUBSTR (p_nm, ' ([^,] *)(,|$)', 1, I, NULL, 1) in double l_val;
-dbms_output.put_line (l_val);
-Open p_out for
Select * into l_val1 of test where nm = l_val;
dbms_output.put_line (l_val1);
output when l_len is null;
end loop;
exception
When no_data_found then
null;
end;
exception
while others then
dbms_output.put_line (' error reason :'||) SQLERRM |' :'|| error code SQLCODE);
end;
EXECUTE p_test ('a, b, c, d, q, w');
OUTPUT-
one
b
c
d
This procedure gives me out as I need, but I need to get this in a variable which should be OUT the parameter of this procedure will be called by the JAVA for our application.
As I already tried to use the refcursor (see the commented part), but it gives me no output during a call there.
Its a call to this procedure when I use the refcursor (removing comments).
declare
l_out sys_refcursor;
l_val varchar2 (20);
l_str varchar2 (20): = 'a, b, c, d;
Start
p_test (l_str, l_out);
loop
extract the l_out in l_val;
dbms_output.put_line (l_val);
dbms_output.put_line ('a');
When the output l_out % notfound;
end loop;
end;
So here I am stuck with that, how to get the result of multiple or I'm missing something here and if there is a better approach to this requirement as I come with that so I'm sharing it here.
OR if someone can tell me what is the problem with this package-
create or replace package p_test_api
is
type t_rec is rendered (name varchar2 (200));
type t_tab is table of index by pls_integer t_rec;
procedure p_pest_proc (p_nm in varchar2, p_out to t_tab);
end p_test_api;
/
create or replace package body p_test_api
is
procedure p_pest_proc (p_nm in varchar2, p_out to t_tab)
is
number of l_len;
l_val varchar2 (10);
l_val1 varchar2 (10);
Start
l_len: = length (p_nm);
Start
because me in 1.l_len
loop
Select REGEXP_SUBSTR (p_nm, ' ([^,] *)(,|$)', 1, I, NULL, 1) in double l_val;
dbms_output.put_line (l_val);
Select * bulk collect into p_out test where nm = l_val;
output when l_len is null;
end loop;
exception
When no_data_found then
null;
end;
exception
while others then
dbms_output.put_line (' error reason :'||) SQLERRM |' :'|| error code SQLCODE);
end p_pest_proc;
end p_test_api;
CALL THIS PACKAGE-
declare
l_out p_test_api.t_tab;
l_str varchar2 (20): = 'a, b, c, d;
Start
P_TEST_API. P_PEST_PROC (l_str, l_out);
dbms_output.put_line ('b');
because me in 1.l_out.count
loop
dbms_output.put_line ('a');
dbms_output.put_line (l_out (i). (Name)
dbms_output.put_line ('a');
When the output l_out.count = 0;
end loop;
dbms_output.put_line ('a');
end;
It won't loop
I am using-
Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
Thank you
First of all, get rid of it WHEN OTHERS like William already noted. If you do not want to use the collections:
SQL > create or replace
function f_test () 2
3 p_nm varchar2
4 )
5 return varchar2
6 is
v_result 7 varchar2 (4000);
Start 8
9. Select listagg (nm, ',') within the Group (nm control)
10 in v_result
11 test
where the 12 «,» | p_nm | ',' like '%', | NM | ',%';
13 return v_result;
14 end;
15.The function is created.
SQL > start
2 dbms_output.put_line (f_test ('a, b, c, d, x, w'));
3 end;
4.
a, b, c and dPL/SQL procedure successfully completed.
SQL >
SY.
-
Plugin to point that returns multiple values
When you create an APEX element that can return multiple values, such as a checkbox, APEX uses the settings of varchar2 p_v01 - p_v200 instead of the p_t01 table settings - p_t200.
I would like to create a plugin item type that can return multiple values in the same way, so that the session recorded for the item state contains a delimited string of values. I realize, I could achieve with Javascript and a hidden item, but I really want to a non-Javascript solution. Is this possible? If this isn't the case, it would be a nice improvement!
Hi Tony,.
Take a look at the level of the parameter p_is_multi_value of the APEX_PLUGIN. GET_INPUT_NAME_FOR_PAGE_ITEM api (http://docs.oracle.com/cd/E37097_01/doc.42/e35127/apex_plugin.htm#AEAPI1254). If you set it to TRUE, you will get one of the p_v01 - p_v200 table settings. It's the same what our box element type calls.
Concerning
Patrick
Member of the APEX development team
My Blog: http://www.inside-oracle-apex.com
APEX Plug-Ins: http://apex.oracle.com/plugins
Twitter: http://www.twitter.com/patrickwolf
-
Multiple values in the dashboard application application database Direct
Hello
I created a direct request from the database that accepts input from a prompt by a variable of presentation, either placed in request of db query. I realized in the process that I had to give a default input to the variable of the presentation of the petition. The input variables passed from the dashboard quick came in the right format, only if they are placed in quotation marks, Eg: "Input_Var".
After all this, I came across a problem when multiple values are entered, the query is generated with an incorrect format. Here is the example:
Select col1, col2
of TabXX
where username IN "Acct_Nm1", "Acct_Nm2"; ')}
Is there anyway to solve this problem. Thanks in advance.
Hi all
I used the sequence next to convert the string separated by commas, received XML from the dash prompt.
"Select XXX".
movies XXX
where the value
in (SELECT )
EXCERPT (VALUE (d), ' / / row/text () ") .getstringval)
Of
(SELECT XMLTYPE ('
') AS xmlval' |)) REPLACE ('VALUEOF (NQ_SESSION.req_var)', ';', '
').
The DOUBLE) x,.
( TABLE (XMLSEQUENCE (EXTRAIT (x.xmlval, '/ lignes/ligne'))) d)"
Create a query variable 'req_var' in the prompt to serve in "VALUEOF (NQ_SESSION.req_var)" and pass it to the report. It will be useful.
Thank you.
-
VSM 9.1.4 multiple values updated select via API
Hi all
We use a lot the VSM (9.1.4) Web service API in our Interfaces. The standard fields and 'normal' extension of work.
Now have the obligation to insert/update a list to multiple values of selection via the api.
As he is only mentioned anything that in the Guide of the API we tried and add several entries with the same ext_fldv to the [of CustomParamData].
No error is thrown, but it only takes the last entry for this ext_fldv the table int.
Has anyone of you updated a multivalued field to select via the api?
Any suspicion on this would be be appreciated.
... and Yes, several values must be provided in a comma-separated string. In the example:
Dim _ws_cust_data_list As New List (Of CustomParamData)
_ws_cust_data_list. Add (New CustomParamData ("EXTFLDV_500102", "105,107,108"))
Var _ws_cust_data_array() As CustomParamData = _ws_cust_data_list. ToArray()
_ws_rq.aCustomParameters = _ws_cust_data_array
-
Search for multiple values in a single field
Hello
I have this request to get results when the user doing a search query:
select * from ( select "ID", "ID" ID_DISPLAY, "SHIFT_DATE", "SHIFT", "OFFENSE_ID", "DESCRIPTION", "ANALYST", "STATUS", "SUBSTATUS" from "#OWNER#"."IDSIEM_OFFENSES") where OFFENSE_ID IN(:P223_OFFENSES) AND ( instr(upper("DESCRIPTION"),upper(nvl(:P223_DESCRIPTION,"DESCRIPTION"))) > 0 ) AND ( instr(upper("SHIFT"),upper(nvl(:P223_SHIFT,"SHIFT"))) > 0 ) AND ( instr(upper("SUBSTATUS"),upper(nvl(:P223_SUBSTATUS,"SUBSTATUS"))) > 0 ) AND ( instr(upper("ANALYST"),upper(nvl(:P223_ANALYST,"ANALYST"))) > 0 ) AND ( instr(upper("SHIFT_DATE"),upper(nvl(:P223_SHIFTDATE,"SHIFT_DATE"))) > 0 ) AND ( instr(upper("STATUS"),upper(nvl(:P223_STATUS,"STATUS"))) > 0 ) ORDER BY OFFENSE_ID DESC
The thing I want to do is to set multiple values in the P223_OFFENSES field when I search. For example, an offence is a number, so I want to put in the search box 1111, 3333, 4444, 5555 and the report shows me these 4 offences in the report. The search operation only works when I put only 1 offences, but when I put more than 1, separated by commas, it gives me this error: error report: ORA-01722: invalid number. That is why, because is a number and the character point is not allowed, how can I achieve this? Thank you in advance.
Best regards, Bernardo
I solved a problem like this a few times with a utility function of pipeline for extracting the values from the list:
CREATE or REPLACE TYPE split_tbl AS TABLE OF VARCHAR2 (32767).
/
FUNCTION to CREATE or REPLACE split_list
(
p_list VARCHAR2
p_delimiter VARCHAR2: = ', '.
) Split_tbl RETURN
PIPELINED IS
l_idx PLS_INTEGER;
l_list VARCHAR2 (32767): = p_list;
BEGIN
LOOP
l_idx: = instr (l_list, p_delimiter);
IF l_idx > 0
THEN
LINE of CONDUCT (substr (l_list, 1, l_idx - 1));
l_list: = substr (l_list, l_idx + length (p_delimiter));
ELSIF TRIM (l_list) IS NOT NULL
THEN
PIPE ROW (l_list);
EXIT;
ON THE OTHER
EXIT;
END IF;
END LOOP;
RETURN;
END split_list;
/
In this way, you can define SQL like:
SELECT to_number (column_value) FROM TABLE (split_list (' 1, 3, 99', ','))
Or for this specific case: replace the condition
OFFENSE_ID IN(:P223_OFFENSES)
with
OFFENSE_ID IN (SELECT to_number (column_value) FROM TABLE (split_list (: P223_OFFENSES, ',')))
The advantage over using instr or regex is that you can usually always benefit index on OFFENSE_ID
Better also to restrict entry to only numbers and ', ' or you will always get invalid numbers errors if a user enters "1234, 567, ABC"in the field of P233_OFFENSES.
Kind regards
Thierry
-
Spend multiple values with parameter of stored procedure
CREATE TABLE VTEST_INSERT)
NUMBER OF MY_ID,
COLUMN1 VARCHAR2 (50)
);
-SELECT * FROM VTEST_INSERT;
INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (1, 'TEST1');
INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (2, "TEST2");
INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (3, "TEST3");
INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (4, "TEST4");
INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (5, 'TEST5');
INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (1, "TEST6");
INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (2, 'TEST7');
INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (3, "TEST8");
INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (4, 'TEST9');
INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (5, "TEST10");
CREATE OR REPLACE
PROCEDURE VTEST_INSERT_SP (vid in VARCHAR2, vname IN VARCHAR2)
AS
BEGIN
DELETE FROM VTEST_INSERT WHERE MY_ID IN (vid);
INSERT INTO VTEST_INSERT (MY_ID, COLUMN1) VALUES (vid, vname);
END;
/
EXEC VTEST_INSERT_SP(1,'TEST999');
This set works well above. But I want to be able to pass multiple values VNAME. so, something like:
EXEC VTEST_INSERT_SP(1,'TEST999','TEST888','TEST777');
any help is appreciated. Thank you.
This would make many inserts each with the same vid and values of different VNAME.
Try something like this
- SET SQLBLANKLINES
- ALTER SESSION SET PLSQL_WARNINGS = ' ENABLE: ALL ';
- DROP TABLE vtest_insert;
- CREATE TABLE vtest_insert (vid NUMBER, vname VARCHAR2 (20));
- INSERT ALL
- IN vtest_insert (vid, vname) VALUES (1, "yyyy")
- IN vtest_insert (vid, vname) VALUES (1, "bb")
- IN vtest_insert (vid, vname) VALUES (1, "cccccc")
- IN vtest_insert (vid, vname) VALUES (2, "ddd")
- IN vtest_insert (vid, vname) VALUES (2, 'ee')
- SELECT * FROM .dual 'PUBLIC '.
- SELECT * FROM vtest_insert;
- CREATE or REPLACE TYPE vnames_tab_ty IS TABLE OF VARCHAR2 (20)
- /
- DISPLAY ERRORS;
- CREATE OR REPLACE PROCEDURE vtest_insert_sp
- (
- p_vid IN vtest_insert.vid%TYPE,
- p_vnames IN vnames_tab_ty
- )
- DEFINE AUTHID
- IS
- BEGIN
- DELETE FROM vtest_insert WHERE the vid = p_vid;
- FORALL idx IN p_vnames. FIRST... p_vnames. LAST
- INSERT INTO vtest_insert (vid, vname) VALUES (p_vid, p_vnames (idx));
- END vtest_insert_sp;
- /
- DISPLAY ERRORS;
> - DECLARE
- Vnam vnames_tab_ty;
- vid vtest_insert.vid%TYPE.
- BEGIN
- BK.vid: = 1;
- BK.vnames: is vnames_tab_ty ('vn-01', 'vn-02', 'vn-03');.
- vtest_insert_sp (p_vid-online bk.vid, p_vnames-online bk.vnames).
- COMMIT;
- BK.vid: = 2;
- BK.vnames: is vnames_tab_ty ('vn-04', 'vn-05', 'vn-06', 'vn-07');.
- vtest_insert_sp (p_vid-online bk.vid, p_vnames-online bk.vnames).
- COMMIT;
- END;
- /
- SELECT * FROM vtest_insert;
Which produces the following output
Table created.
5 rows created.
VNAME VID
---------- --------------------
1-aaaa
1 bb
1 cccccc
2 ddd
2 EA
Type of creation.
No errors.
Created procedure.
No errors.
PL/SQL procedure successfully completed.
VNAME VID
---------- --------------------
1 VL-01
1 VL-02
1 VL-03
2 vn-04
2 vn-05
2 vn-06
2 vn-07
7 selected lines.
SQL >
Kind regards
Dariyoosh
-
Correlation of Pearson of multiple values
Hey,.
I have a problem. I want to calculate the pearson correlation of two sets that have multiple values. The CORR(x,y) function accepts two numbers. How can I handle this?
Is there an effective way to do it because I have a lot of games where I want to calculate the correlation.
I hope you can help me.
bladepitWith T1 as ( Select Value,ref,bez From table Where Bez ='A' ), T2 as ( Select Value, ref,bez From table Where bez ='B' ) Select Corr(T1.value,t2.value) Over(Order by T1.ref) cor From T1,T2 Wehre T1.ref=T2.ref
Sorry, it's sort of RAW, behause I Worte this in an iPad, what I'm not use to do.
Published by: chris227 on 23.03.2013 11:47
Maybe you are looking for
-
Scuba diving between 0 and 50 m with Watch series 2
Public documents for diving with Apple Watch series 2 is a bit contradictory. All the data I can find claims that it is resistant to 50 m, but you shouldn't use it for scuba diving. Note 1 to the foot of the http://www.apple.com/apple-watch-series-2/
-
When I send or receive an e-mail message date, to, from and subject line are fine, but after that, all this encrypted information that is listed there. I don't know what they call this information, how this information began to appear, I don't want t
-
How can I get people to respond to my question the way that I ask him rather than how they think they should?
-
Hello and greetings, I remember my last HP computer that was running win7 there was an option of tuneup when I opened assistant support. where can I find that on win10? or, if there is such a thing. I have another question which I'll post on another
-
How to check the Bluetooth?
How could I know if my laptop Toshiba Bluetooth or not?