conversion of a delimited list of a collection
Hello Version 11g r2 create or replace type jobcheck_type as object ( jid VARCHAR2(250), jname VARCHAR2(250), jtot_mesgs NUMBER, jsuccess NUMBER, jfailure NUMBER, jstart_time TIMESTAMP, jcompleted_time TIMESTAMP, jstatus VARCHAR2(50), jversion NUMBER ) / create or replace type jobchecktab_type as table of jobcheck_type / Now select * from table(jobchecktab_type(jobcheck_type(null,'A,B',30,30,0,null,null,null,null))); The output is null A,B 30 30 0 null null ... But what I need is null A 30 30 0 null null null B 30 30 0 null null if select * from table(jobchecktab_type(jobcheck_type(null,'A,B,C,D',30,30,0,null,null,null,null))); Then output required is But what I need is null A 30 30 0 null null null B 30 30 0 null null null C 30 30 0 null null null D 30 30 0 null null I'm passing the comma separated values one of the value(jname) in collection and rest other values in collection are constant. From some reason, I would be needing that to be done in select statement only i.e select * from table(jobchecktab_type .....
No problem here:
Select the IADB
regexp_substr (jname, ' [^,] +', 1, level) jname,.
jtot_mesgs,
jsuccess,
jfailure,
jstart_time,
jcompleted_time,
jstatus,
jversion
from (select *)
table (jobchecktab_type (jobcheck_type (null, 'A XXXX_YYY, AAAA X, Sweep NEM', 30, 30, 0, null, null, null, null)))
connect by level<= length(regexp_replace(jname,="" '[^,]+',="" ''))="" +="">=>
Tags: Database
Similar Questions
-
I have thousands of email addresses I've sent and received since then but maybe 50 show place in my list of addresses collected. I want to export my contacts emails, but I can't find the majority of these names and addresses.
Thank you
OK figured it. All the contacts that I wanted were on my AOL and Gmail servers. I went into gmail and aol and all the contacts it has exported there in my contacts apple program.
There are now!
Thanks for all the help.
-
Ive done this research ~ kind: music that I wanted to find ALL my music & move to folder, however its all songs out each album & listed the entire collection alphabetical order! No matter the artist so now all my album folders are empty!
can anyone help? can it be reversed or cured please!
I have windows 7 Home Premium
Hi, no, I have not tried a system restore I did that thing of file of music several months ago & it has since changed my PC
Thanks for any help!
-
Mark from a table where the column value is a colon-delimited list
Version: Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production
Hello
This is a new query of a query Frank helped me with:
Demand is all users to restrict the report based on a multiple selection on the front-end server (application APEX) filter.
The filter returns that a colon-delimited list and the data in the table can be saved in a delimited by a colon list too. There may be 1 to n values (up to 4000 characters).
I need a WHERE clause that will allow a match, if it exists, between the data in the column of the Table and the Mult-selection list filter.
The abbreviated for this post query would be something like:
SELECT slt_id, slt_item, slt_owner
OF slt_dashboard
WHERE slt_owner IN (colon delimited page list);
The Create Table and Insert statements:
CREATE TABLE slt_dashboard ( dashboard_id NUMBER, slt_id VARCHAR2(10), slt_item VARCHAR2(2500), slt_owner VARCHAR2(4000), slt_type VARCHAR2(25), slt_year NUMBER, parent_id NUMBER ); --Insert slt_dashboard INSERT INTO slt_dashboard(dashboard_id,slt_id,slt_item,slt_owner,slt_type,slt_year,parent_id) VALUES (12,'1.1','Implement revenue enhancement initiatives','E15889:JPARISI:BDUR63','Business Commitment',2014,6); INSERT INTO slt_dashboard(dashboard_id,slt_id,slt_item,slt_owner,slt_type,slt_year,parent_id) VALUES (13,'1.2','Strengthen our Energy position','KVROMAN','Business Commitment',2014,6);
I have a function to separate the list delimited by two points in a table for the IN clause, but because these values can be saved in a delimited list of Colon in the column of the Table, I have a problem, being able to analyze the data in the column, AND the filter data.
The function is:
CREATE OR REPLACE FUNCTION get_list( p_string IN VARCHAR2 ,p_delimiter IN VARCHAR2 DEFAULT ':' ) RETURN vc_array_1 PIPELINED IS l_string VARCHAR2( 32000 ); l_array wwv_flow_global.vc_arr2; BEGIN l_array := APEX_UTIL.string_to_table( p_string ,p_delimiter ); FOR i IN l_array.FIRST .. l_array.LAST LOOP PIPE ROW ( TRIM( l_array( i ) ) ); END LOOP; RETURN; END;
The function called in the query in the form (it's just for reference in case someone wanted to know):
SELECT ... FROM ... WHERE slt_owner IN (SELECT * FROM TABLE( get_list( :P115_SLT_OWNER ) ));
But I can't use this approach because the data in the Table can be saved in a delimited list of Colon too.
Desired output:
If the Mult-Select list filter contains: E15889:JPARISI then
1.1 implementation of the E15889 revenue improvement initiatives; JPARISI (it's a semicolon between the names)
If the multiple-selection list filter contains: KVROMAN then
1.2 strengthen our position of energy KVROMAN
If the multiple-selection list filter contains: BDUR63:KVROMAN then
1.1 implementation of the BDUR63 revenue improvement initiatives
1.2 strengthen our position of energy KVROMAN
Please let me know if something is not clear.
Thank you
Joe
I went to approach the Table and the Page works perfectly.
Thank you to everyone!
Thank you
Joe
-
regular expressions for numbers demical in a comma-delimited list
I have a table that lists the details of the occupation of the sites of a comma-delimited list:create table tenure_test)
number of site_number
tenure_detail varchar2 (255));insert into tenure_test values (1, ' Crown (Other) (0.15 ha), private (555.25 ha)');
insert into tenure_test values (2, ' private (5.76 ha)');
insert into tenure_test values (3, ' private (0.18 ha, Crown (3.25 hectares), Indeterminate (Leased) (5.85 ha)');)What I want to do is to use a regular expression to calculate the sum only numbers in the tenure_detail column.
For example, for site_number 1, it would be 0.15 + 555.25 = 555,4
I also have another regular expression that has just the numbers in a comma-delimited list.
For site_number 1: 0.15, 555.25
I tried this:
Select site_number, tenure_detail, regexp_substr (tenure_detail, "[0-9] + \.") ([0-9] {2}') under the name test1
of tenure_test;
but it lists only the first number.
Hello
996454 wrote:
I have a table that lists the details of the occupation of the sites of a comma-delimited list:
create table tenure_test)
number of site_number
tenure_detail varchar2 (255));insert into tenure_test values (1, ' Crown (Other) (0.15 ha), private (555.25 ha)');
insert into tenure_test values (2, ' private (5.76 ha)');
insert into tenure_test values (3, ' private (0.18 ha, Crown (3.25 hectares), Indeterminate (Leased) (5.85 ha)');)What I want to do is to use a regular expression to calculate the sum only numbers in the tenure_detail column.
For example, for site_number 1, it would be 0.15 + 555.25 = 555,4
I also have another regular expression that has just the numbers in a comma-delimited list.
For site_number 1: 0.15, 555.25
I tried this:
Select site_number, tenure_detail, regexp_substr (tenure_detail, "[0-9] + \.") ([0-9] {2}') under the name test1
of tenure_test;
but it lists only the first number.
Here's one way:
SELECT site_number
SUM (TO_NUMBER (REGEXP_SUBSTR (tenure_detail
, "\d+\.\d*" - see Note 1
) T
LEVEL
)
)
), Total
OF tenure_test
CONNECT BY LEVEL<= regexp_count="" (="">=>
, '\d+\.\d*'
)
AND PRIOR site_number = site_number
AND PRIOR SYS_GUID () IS NOT NULL
GROUP BY site_number
;
Output:
TOTAL OF SITE_NUMBER
----------- ----------
1 555,4
2 5.76
3 9.28
Note 1: what exactly makes a 'number '? I'm assuming it's 1 or more digits, followed by a comma, followed by 0 or more numbers. You can have a slightly different definition; in this case, change the arguments 2nd REGEXP_SUBSTR and REGEXP_COUNT.
I guess also that site_number is unique. If not, you will have to change the CONNECT BY and GROUP BY clauses, to refer to something (or a combination of things) which is unique.
Relational databases are designed for each column of each row contain 1 single piece of information, not a list delimited with a variable number of elements. It is so basic to the design of database he called the first normal form. If your first followed table form normal, this query (and many other queries that involve that table) would be much simpler to write, more efficient to run and less likely to have bugs. See if you can normalize this table. Any effort that you have to spend now to normalize the table will pay very quickly.
Thanks for posting the CREATE TABLE and INSERT statements; It is very useful.
Don't forget to tell what version of Oracle you are using. I tried the query in Oracle 11.2 above. You may need to CONNECT BY a little differently in earlier versions, and REGEXP_COUNT will not work in Oracle 10.
-
How to display a set of results in a comma-delimited list?
I have a query that selects an attribute in a table:
Select the role of sport_roles
What is the best way to display the result set as a "comma-delimited list" and "display as text"?
for example, player, coach, referee
Thank you.I think you mean comma-DELIMITED.
The easiest way is dependent on the version. And yours is?
In 11.1.0.6 and especially I prefer to use WM_CONCAT.
http://www.morganslibrary.org/reference/wm_functions.htmlTom Kyte, to asktom, provided a named function, STRAGG.
A version number will be essential in all cases.
-
Is it possible to convert an array of values in a comma-delimited-list?
Hello
I want to transform the following dataset:
Parent | Child
----------------------
Charles | William
Charles | Harry
Anne | Peter
Anne | Zara
Andrew | Beatrice
Andrew | Eugénie
in this:
Parent | Children
-----------------------------
Charles | Diana, Camilla
Anne | Peter, Zara
Andrew | Beatrice, Eugenie
In other words, I would like to make a list of values from some of the major and produce them as a comma-delimited list.
I know that his is possible in T - SQL, even if the method is a bit of a nasty hack. Is this possible in PL - SQL?
Thaks in advance
JamieSQL> with t as( select 'Charles' parent, 'William' child from dual union select 'Charles', 'Harry' from dual union select 'Anne', 'Peter' from dual union select 'Anne', 'Zara' from dual union select 'Andrew', 'Beatrice' from dual union select 'Andrew', 'Eugenie' from dual ) -- -- select parent, rtrim(xmlagg(xmlelement(e,child || ',')).extract('//text()'),',') childs from t group by parent / PARENT CHILDS ---------- -------------------- Andrew Beatrice,Eugenie Anne Peter,Zara Charles Harry,William 3 rows selected.
Don't know how Diana & Camilla suddenly jumped in many... ;)
-
Hello
I came across this tag on the doc to "allow other liquid objects" as I was trying to find a way to customize the output HTML of products so I can use a provision of the masonry.
I added the code to the General layout:
{tag_productlist, collection = "product list" template =""}
< ul id = 'masonry-container' class = 'row small-block-grid-2 way-block-grid-4 big-block-grid-4' >
{% for item in product - list.items %}
< class li = "product-list-masonry" >
•• content *.
< /li >
{% endfor %}
< /ul >
It works very well as list view, but nothing does when clicking on to the detail view. This tag can be used? How to make the layout of retail product?
I also tried {module_data}, but entered into similar problems.
{module_data resource = 'products' version = 'v3' fields = "id, name, tags, smallImage, largeImage, description, attributes, custom1, custom2, custom3, custom4, isOnSale, canonicalUrl" skip = "0" limit = "100" order = 'id' collection = 'products'}
Pointers appreciated.
Thank you
Paul
Hi Paul,.
You must instead use something like this:
{% if globals.get.ProductID %}
This is the product detail layout
{% else %}-
{% for item in custom-tag.items %}
- {{item.name}} {%endfor%}
You must first tell whether you are in the 'broad' view of the product, or on a star catalogue listing its products. Once you know that you can either generate the view of product or products in a loop and build the list.
Hope this helps,
Mihai
-
How to prepare list for garbage collection after drag and drop operation
Hi all
I have a view in a mobile application that contains a list with the help of drag / move. The problem I encounter is that the NativeDragManagerImpl maintains a reference to this list in its _dragInitiator and _relatedObject properties. It is not a memory leak by - say, because the reference will be replaced the next time make drag and drop is used, however, my view that preclude any garbage collection, causing an unacceptable peak memory.
Here is an example which illustrates the problem (app default AIR using Flex 4.5.1):
Main.MXML
<?xml version="1.0" encoding="utf-8"?> <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:local="*" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark" width="800" height="600"> <fx:Script> <![CDATA[ protected function start_clickHandler(event:MouseEvent):void { var element:ListGroup = new ListGroup(); this.panel.addElement(element); } protected function stop_clickHandler(event:MouseEvent):void { this.panel.removeAllElements(); } ]]> </fx:Script> <s:Panel id="panel" top="100" left="100" bottom="100" right="100" title="Drag Drop Test"> <s:controlBarContent> <s:Button label="Start" click="start_clickHandler(event)" /> <s:Button label="Clear" click="stop_clickHandler(event)" /> </s:controlBarContent> </s:Panel> </s:WindowedApplication>
ListGroup.mxml
<?xml version="1.0" encoding="utf-8"?> <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark" width="100%" height="100%"> <s:layout> <s:HorizontalLayout /> </s:layout> <s:List id="sourceList" width="100%" height="100%" dragEnabled="true" dragMoveEnabled="true" dropEnabled="true"> <s:dataProvider> <s:ArrayCollection> <fx:String>Item 1</fx:String> <fx:String>Item 2</fx:String> <fx:String>Item 3</fx:String> <fx:String>Item 4</fx:String> </s:ArrayCollection> </s:dataProvider> </s:List> <s:List id="targetList" width="100%" height="100%" dragEnabled="true" dragMoveEnabled="true" dropEnabled="true"> </s:List> </s:Group>
If you drag items to the list on the right, there is always at least one instance of ListGroup stuck in memory for the duration of execution (as seen in the profiler).
Is there a way to perform cleanup on the DragManager (or in fact the underlying DragManagerImpl) upward to a time of my choosing? Thoughts or ideas will be greatly appreciated!
Thanks a lot for your time!
I think I'd be monkey-patch NativeDragManagerImpl. And create a bug report.
-
Hello
In the following list, how can I keep the word Social, behavior and Economics in one word instead of
Social
Behavioral
and Economics
< cfloop list = 'Biological and Social Sciences, behavior and economics' index 'i' = delimiter = ',' >
< cfoutput > #i # < br / > < / cfoutput >
< / cfloop >
The list should look like:
Biological Sciences
Social, behavioral and economic sciences
Thank you!
Use anything other then a comma to delimit the list.
#i# -
Form field with comma delimited list of values to cfc
I have a form that moves from a field to a page of the action with a value of delimited by commas.
For example, the domain name is: Program_ID
value of program_ID is: 31, 32
I am able to deal with this variable in a list and check its length and loop over the list before passing to a cfc using the attached code:
When I try and pass the variable as a string of a cfc and call a query, see no longer recognizes my var in list form.
This is why the related code does not work...
Is there a type specific var that cross as a list and allows me to execute the block of code attached?
Thank you
CraigOK, answered my own question... Here is the answer for those who are interested...
initialize the var for CFCs in the cfinvoke statement
Pass the argument to cfc string
Use listqualify to parse the list of CFCs and to define new var
Use the new var in the following statement in the sql code:
((Program_ID) TO (#PreserveSingleQuotes (selectedProgramID) #))The following code runs a form field with a single value or a value of delimited by commas.
-
conversion of a clob entry in a collection
Hi I have a function that has a CLOB to entry. The input value is concatenated to multiple values. I need to separate and process the data. Here is an example of sample function. Can someone help me on this please. I'm not able to get any solution.
l_orders CLOB Chennai | $| Mumbai | $| Delhi | $| Amsterdam | $| Brazil | $| ......... | $| Hyderabad
Now I need to enter the values as below in a collection
l_orders (1) chennai
l_orders (2) Mumbai
l_orders (3) Delhi
Amsterdam l_orders (4)
l_orders (5) Brazil
.
.
.
.
l_orders (6000) Hyderabad
These values, I need to spend in the table and make a DML operation under certain conditions. I'm helpless on how to extract the CLOB entry in a collection.
I use version oracle 11g.
It looks to...
Another look: the CLOB is transformed in a way that allows for handlng as an xmltype.
Your particular case, it's that you are having just a single column (your | $| is Chr (10) in the solution) and you should get a result set single column to be processed according to your needs (you might be more comfortable to add a line number using keyword ordinalite to maintain order CLOB)
Concerning
Etbin
If you are having trouble:
with
data in the form of
(select to_clob ('Chennai | $|)) Mumbai | $| Delhi | $| Amsterdam | $| Brazil | $| Hyderabad') the_clob
of the double
)
Select rn, col1
data,.
XMLTable ('/ a/b ')
from xmltype ('': replace (the_clob, ' | ')) $| ','')||'')
columns
RN to ordinalite,
col1 varchar2 (100) path '.'
) x
RN COL1 1 Chennai 2 Mumbai 3 Delhi 4 Amsterdam 5 Brazil 6 Hyderabad -
Conversion of decimal numbers listed as commas
Hi all
We try load data in an excerpt from the SAP in Hyperion using ODI.
The numbers coming from SAP have a comma in place of the decimal point. Is there a way to ODI to convert this into a decimal point, while keeping it as a number?
Thank you.I'm assuming that your SAP extract is a kind of flat file? When you set up your data store that represents your file to extract SAP in ODI you specify on the files tab character you use as a decimal separator in the file. This will allow the ODI properly load the numeric values in your file for any intermediate platform that you are using, and then of staging the load in Hyperion is as simple as choosing the correct knowledge module.
-
make a chain in a comma-delimited list
I imagine that someone out there has done this before, I am struggling with the correct code to do. Please see the code, any suggestions welcomed and much appreciate in advance - thank you
Try the code below. At the end of the loop, remove the comma at the end of the string.
-
Help to retrieve the values of list delimited by the
Hi all
I have a procedure similar to that below and I'll send IN parameters from a screen of Apex.
It works fine until the user chooses several values on the page of the Apex (that's a multiple selection list box). The values are passed to the procedure in a colon delimited list, it looks likeprocedure getData (p_param1 in varchar2, p_param2 in varchar2) is begin for x in (select col1, from table where colx = param1 and coly in (param2) ) .... end;
My question is, how can I analyze the values while the where clause looks like.VALUE1:VALUE2:VALUE3
or something like that?... where colx = param1 and coly in ('VALUE1','VALUE2') ...
Thanks for any help.
-ChrisHi, Chris,.
If param2 is "John: Scott: Tom ', then
WHERE INSTR ( ':' || param2 || ':' , ':' || coly || ':' ) > 0
produces the same results as
WHERE coly IN ('John','Scott','Tom')
If that's all you need to do with param2, I can't make a list of each element.
Maybe you are looking for
-
Mozilla has been telling me on the opening page that I don't have the latest version.Today, version 9.0.1 has been properly transferred.However, the same message that I do not always use the most recent version is displayed. Thank you.
-
I want to show the tabs on multiple lines in firefox. While Firefox allows you to have as many tabs that you want to open at any time, if you exceed the width of the screen, you will then need to scroll left and right to see. I want to have multiple
-
can schedule us replication between DC of CDA
Hey guys can someone help me in planning replication between CDA DC and ADC to WINDOWS SERVER 2003domain controllerR2. because we face less file transfer speed when you attach us the ADC to DC. If the DC kept only the transfer rate is higher, then t
-
Anyone know how to "password protect" a folder and content?
I share a computer at home with my teenage son. I also do work at home and my customer information must be secure (confidential data). How do I password protect folders for work and other private files?
-
How to get rid of a redirect virus in internet explorer 9
I seem to have a virus that is google redirect to other sites and crashing internet explorer9 when I try to stop it. I carry a Microft Security scans, but he comes clean. Anyone know of a way to get rid of him. Thank you.