Localisation in comma separated list issue
Hello All,
I am having an issue with Localisation objects on an irpt page not getting populated. For example I am passing a list of Localisation objects to a query param like so (note the behaviour is the same weather I am passing to a param or just outputing the localization on the irpt):
"{##LOBJ_1},{##LOBJ_2},{##LOBJ_3},{##LOBJ_4},{##LOBJ_5},{##LOBJ_6}...."
I expect to get a result like the folowing:
"Text 1,Text 2,Text 3,Text 4,Text 5,Text 6..."
But I get a result like this where some values have been popluated and some haven't.
"Text 1,{##LOBJ_2},Text 3,Text 4,Text 5,{##LOBJ_2}..."
I have no issue displaying any of the objects on thier own on the irpt.
This issue is occuring on Version 12.0.4 Build(120), This issue does not occur for me on Version 12.0.2 Build(88)
Regards,
Christian
Hi Christian,
We have the same problem with the SP04.
We made an OSS message on this problem.
SAP must deliver the SP05 version soon.
They have nevertheless said that the use of _ was discouraged.
Regards
Alexandre SEDANO
Similar Messages
-
How to get distinct values in a comma separated list of email addresses?
Hi Friends,
I have a cursor which fetches email address along with some other columns. More than one record can have same email address.
Ex
CURSOR C1 IS
SELECT 1 Buyer,'XX123' PO, '[email protected]' Buyer_email from dual
UNION ALL
SELECT 2 Buyer,'XX223' PO, '[email protected]' Buyer_email from dual
UNION ALL
SELECT 1 Buyer,'XX124' PO, '[email protected]' Buyer_email from dual
UNION ALL
SELECT 2 Buyer,'XX224' PO, '[email protected]' Buyer_email from dualNow, i open the cursor write the contents into a file and also form a comma separated list of buyer emails as follows
for cur_rec in c1
LOOP
--write contents into a file
l_buyer_email_list := l_buyer_email_list||cur_rec.buyer_email||',';
END LOOP
l_buyer_email_list := RTRIM(l_buyer_email_list,',');
The buyer email list will be like: '[email protected],[email protected],[email protected],[email protected]'
Inorder to avoid duplicate email address in the list, i can store each of this value is a table type variable and compare in each iteration whether the email already exist in the list or not.
Is there any other simpler way to achieve this?
Regards,
Sreekanth Munagala.If you are using oracle version 11, you can use listagg function
with c as
(SELECT 1 Buyer,'XX123' PO, '[email protected]' Buyer_email from dual
UNION ALL
SELECT 2 Buyer,'XX223' PO, '[email protected]' Buyer_email from dual
UNION ALL
SELECT 1 Buyer,'XX124' PO, '[email protected]' Buyer_email from dual
UNION ALL
SELECT 2 Buyer,'XX224' PO, '[email protected]' Buyer_email from dual
select buyer, listagg(buyer_email,',') within group (order by buyer)
from c
group by buyer
order by buyerFor prior versions
{cod}
with c as
(SELECT 1 Buyer,'XX123' PO, '[email protected]' Buyer_email from dual
UNION ALL
SELECT 2 Buyer,'XX223' PO, '[email protected]' Buyer_email from dual
UNION ALL
SELECT 1 Buyer,'XX124' PO, '[email protected]' Buyer_email from dual
UNION ALL
SELECT 2 Buyer,'XX224' PO, '[email protected]' Buyer_email from dual
select buyer, rtrim(xmlagg(xmlelement(e,buyer_email||',').extract('//text()')),',')
from c
group by buyer
order by buyer -
Obtaining comma-separated list of text values associated with bitwise flag column
In the table msdb.dbo.sysjobsteps, there is a [flags] column, which is a bit array with the following possible values:
0: Overwrite output file
2: Append to output file
4: Write Transact-SQL job step output to step history
8: Write log to table (overwrite existing history)
16: Write log to table (append to existing history)
32: Include step output in history
64: Create a Windows event to use as a signal for the Cmd jobstep to abort
I want to display a comma-separated list of the text values for a row. For example, if [flags] = 12, I want to display 'Write Transact-SQL job step output to step history, Write log to table (overwrite existing history)'.
What is the most efficient way to accomplish this?Here is a query that gives the pattern:
DECLARE @val int = 43
;WITH numbers AS (
SELECT power(2, n) AS exp2 FROM (VALUES(0), (1), (2), (3), (4), (5), (6)) AS n(n)
), list(list) AS (
SELECT
(SELECT CASE WHEN exp2 = 1 THEN 'First flag'
WHEN exp2 = 2 THEN 'Flag 2'
WHEN exp2 = 4 THEN 'Third flag'
WHEN exp2 = 8 THEN 'IV Flag'
WHEN exp2 = 16 THEN 'Flag #5'
WHEN exp2 = 32 THEN 'Another flag'
WHEN exp2 = 64 THEN 'My lucky flag'
END + ', '
FROM numbers
WHERE exp2 & @val = exp2
ORDER BY exp2
FOR XML PATH(''), TYPE).value('.', 'nvarchar(MAX)')
SELECT substring(list, 1, len(list) - 1)
FROM list
Here I'm creating the numbers on the fly, but it is better to have a table of numbers in your database. It can be used in many places, see here for a short discussion:
http://www.sommarskog.se/arrays-in-sql-2005.html#numbersasconcept
(Only read down to the next header.)
For FOR XML PATH thing is the somewhat obscure way we create concatenated lists. There is not really any using trying to explain how it works; it just works. The one thing to keep in mind is that it adds an extra comma at the end and the final query strips
it off.
This query does not handle that 0 has a special meaning - that is left as an exercise to the reader.
Erland Sommarskog, SQL Server MVP, [email protected] -
Problem using comma separated list with nested table element
Hi,
I have a comma separated list like that:
H23004,H24005,T7231,T8231,T9231And want to create a function which is creating a where clause for each element with an output like that:
UPPER('H23004') IN (UPPER(charge))
OR UPPER('H23005') IN (UPPER(charge))
OR UPPER('T7231') IN (UPPER(charge))
OR UPPER('T8231') IN (UPPER(charge))
OR UPPER('T9231') IN (UPPER(charge))Here is my test function which doesn't work correctly:
create or replace function FNC_LIST_TO_WHERE_CLAUSE(v_list in VARCHAR2) return varchar2 is
-- declaration of list type
TYPE batch_type IS TABLE OF pr_stamm.charge%TYPE;
-- variable for Batches
v_batch batch_type := batch_type('''' || replace(v_list,',',''',''') || '''');
return_script varchar2(1000);
BEGIN
-- loop as long as there are objects left
FOR i IN v_batch.FIRST .. v_batch.LAST
LOOP
--DBMS_OUTPUT.PUT_LINE(offices(i));
-- create where clause
IF i = 1 THEN
return_script := 'UPPER(' || v_batch(i) || ') IN (UPPER(charge))';
ELSE
return_script := return_script || ' OR UPPER(' || v_batch(i) || ') IN (UPPER(charge))';
END IF;
END LOOP;
return (return_script);
end;The out put looks like that:
UPPER('H23004','H24005','T7231','T8231','T9231') IN (UPPER(charge))I have no idea what I do wrong? It calculates the amount of array element wrong! (v_batch.LAST should be 5.)
v_batch.FIRST = 1
v_batch.LAST = 1
Regards,
Tobiastry this....
declare
text varchar2(1000) := 'H23004,H24005,T7231,T8231,T9231';
v_where varchar2(1000);
begin
text := text||',';
while instr(text,',') <> 0
loop
v_where := v_where || 'UPPER('''||substr(text,1,instr(text,',',1)-1)||''' IN (UPPER(charge)) OR ';
text := substr(text,instr(text,',',1)+1);
end loop;
v_where := substr(v_where,1,length(v_where)-3);
dbms_output.put_line(v_where);
end;
convert this one into function ... -
Comma separated list for in ()
I am trying get a comma separated list of numbers (123,345,332,645) from a text field and pass it to a select statement that has in condition. The code looks something like
select a,b,c from tab1
where a in (:P1_SEARCH)
This works when I put only one value in the field. if I put two values like 345,453 it doesn't.
Can someone please explain this behaviour?
Thank you,
Kirtan DesaiKirtan,
Lots of info here: Re: Search on a typed in list of values .
Scott -
Query to fetch Comma separated list
Hi all,
i have a table like users below.
I want to fetch the rows when to username is appeared in the in list.
SQL> select * from users;
PLATFORM USERS
1 raja,ram,sathish
2 raja,sathish
3 vena,meena,sathish
SQL> select * from users where lower(users)='raja,ram,sathish';
PLATFORM USERS
1 raja,ram,sathish
SQL> select * from users where lower(users) like '%raja%';
PLATFORM USERS
1 raja,ram,sathish
2 raja,sathishBut my requirement is even if the input list got changed,still it should retrieve that row..
here the order of raja,sathish and ram has got changed.. But i need to retrieve the record..
SQL> select * from users where lower(users) ='raja,sathish,ram';
no rows selectedIs the any function to do this?WITH users AS (SELECT 1 platform, 'raja,ram,sathish' users FROM DUAL
UNION ALL
SELECT 2, 'raja,sathish' FROM DUAL
UNION ALL
SELECT 3, 'vena,meena,sathish' FROM DUAL
UNION ALL
SELECT 4, 'raja,sathish,ram' FROM DUAL),
seach_string as (
select length(str) - length(replace(str,',')) +1 count_us,','||regexp_substr(str||',', '[[:alpha:]]+.,', 1, level) us
from
select 'raja,ram,sathish' str from dual
connect by level <= length(str) - length(replace(str,',')) +1
select *
from users
where users in
SELECT users
FROM users, seach_string
where instr(','||users||',', us) > 0
group by users
having count(*) = (select max(count_us) from seach_string)
PLATFORM USERS
1 raja,ram,sathish
4 raja,sathish,ram
2 rows selected. -
Combine data from a table and insert to another in comma separated format
In my SQL database table i have some data as shown below.
KNO Course Grade Institution
124 BTECH First IIT Calicut
128 BE First KKS Institute
124 CCNA Q NIIT Delhi
124 DDCN Q Appl Calicut
128 DIT A NIIT Delhi
128 VB Q IICM Delhi
i want this courses to be arranged as sample given under to a table named mainpers
KNO Course
124 BTECH[First], CCNA[Q],DDCN[Q]
128 BE[First], DIT[A], VB[Q]
I am a System Administrator at VadodaraYou can do this in SQL.
with cte as (
select distinct KNO
from Table1
select KNO
, Stuff(
(select ',' + Course + '[' + Grade + ']'
from Table1
where Table1.KNO = cte.KNO
for xml path ('')
), 1, 1, '') as Course
from cte
http://davidduffett.net/post/5334646215/get-a-comma-separated-list-of-values-in-sql-with-for
Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com -
Query on column with comma separated values
I have a proposed table with unnormalized data like the following:
ID COLA COLB REFLIST
21 xxx zzz 24,25,78,412
22 xxx xxx 21
24 yyy xxx 912,22
25 zzz fff 433,555,22
.. ... ... ...There are 200 million rows. There is maximum of about 10 IDs in the REFLIST, though typically two or three. How could I efficiently query this data on the REFLIST column? e.g. something like:
SELECT id FROM mytable WHERE :myval in reflistLogically there is a many to many relationship between rows in this table. The REFLIST column contains pointers to ID values elsewhere in the table. The data could be normalized so that the relationship keys are in a separate table (in fact this is the current solution that we want to change).
ID REF
21 24
21 25
21 78
21 412
22 21
24 912
... ...The comma separated list seems instinctively like a bad idea, however there are various reasons for proposing it. The main reason is because the source for this data has it structured like the REFLIST example. It is an OLTP-like system rather than a data warehouse. The source code (and edit performance) would benefit greatly from not having to maintain the relationship table as the data changes.
Going back to querying the REFLIST column, the problem seems to be building an approriate index for the data. The ideas proposed so far are:
<li>Make a materialized view that presents the relationships as normalized (e.g. as in the example with ID, REF columns above), then index the plain column - the various methods of writing the view SQL have been widely posted.
<li>Use a Oracle Text Index (not something I have ever had call to use before).
Any other ideas? Its Oracle 10.2, though 11g could be possible.
Thanks
JimSomething like this ?
This is test demo on my 11.2.0.1 Windows XP
SQL> create table test (id number,reflist varchar2(30));
Table created.
SQL> insert into test values (21,'24,25,78,412');
1 row created.
SQL> insert into test values (22,'21');
1 row created.
SQL> insert into test values (24,'912,22');
1 row created.
SQL> insert into test values (25,'433,555,22');
1 row created.
SQL> select * from test
2 where
3 ',' || reflist || ',' like '%,22,%';
ID REFLIST
24 912,22
25 433,555,22
SQL>Source:http://stackoverflow.com/questions/7212282/is-it-possible-to-query-a-comma-separated-column-for-a-specific-value
Regards
Girish Sharma
Edited by: Girish Sharma on Jul 12, 2012 2:31 PM -
Comma Separated Tags from BLT?
Was reading the help documentation and noticed that there is a way to pass in comma separated tags to a query template:
TagName
One or more tag names to be queried
String Or String List
None
The name of a tag in the underlying data source. This parameter can be repeated multiple times in a URL if multiple tags are to be queried, and multiple tags can be passed in a single parameter as a comma-separated list of tag names.
I tried this from a BLT and it didn't work. What is the trick to get this to work? I have about 50 tags to query and I dont want to hard code the mappings and I would rather not fire 50 individual queries.
Any thoughts?Brian,
You can't do it from an APPLET perspective or a standard TagQuery action block in BLS because of the explicit TagName.1 to TagName.128 query properties. The TagName property you found in the help only works for a direct query to the Illuminator servlet such as: http://<server:port>/Lighthammer/Illuminator?Server=Simulator&Mode=Current&TagName=L1Speed,L1Yield,AssetUtil1
If you need to wrap this functionality inside BLS or simply want to use it in an applet, then drop something like this into an XMLQuery template:
http://localhost/Lighthammer/Illuminator?QueryTemplate=Path/File&StartDate=[SD]&EndDate=[ED]&TagName=[Param.1]&Content-Type=text/xml
Assumptions would then be that you can bundle your data server and mode information in the query template (or you can keep them explicit with Server and Mode like in the first example and [Param.x] the right side of the equal sign to allow for simple Current/History/HistoryEvent changes). The [SD] and [ED] tokens will make the XMLQuery known to be time sensitive to an iChart so the default 60 minutes, etc. will go into the http request and give you the convenient VCR controls in the time control bar.
Regards,
Jeremy -
SQL Select with comma separated column value
Hi All
ASP VBScript
I have a DB column named allowed_contracts that stores a
comma separated
list of of values e.g. 3, 5, 19, 44, 52
I need to select records based on a variable called
varContractList that
contains another comma separated list i.e. 5, 44, 52
I only want to select records where the allowed_contracts
column contains
each of the varContractList,
For example only return records that have 5 or 44 or 52 in
thier
allowed_contracts column.
My brain is now in a persistant vegetive state trying to work
this out so
any ideas would be much appreciated.
Regards
BrenHi Jules
Cheers for this.
I was trying to be a bit cute (lazy even) by storing the
project ID's as a
comma delimted string but as we see it doesn't always pay to
be lazy. Serves
me right for destroying brain cells by drinking the Welshpool
beer the other
week whilst visiting mates down that neck of the woods. :-))
Time for another table me thinks.
Rgds
Bren
"Julian Roberts" <[email protected]> wrote in message
news:e7i13f$mup$[email protected]..
> Fatal flaw here Bren. In a relational database, one
shouldn't really store
> foreign keys as a comma delimted string. One should have
a 3 table
> structure. eg
>
> Products:
> ProductID
> Product
>
> Categories:
> CategoryID
> Category
>
> ProductCategories:
> ProductID
> CategoryID
>
> So, from the table ProductCategories, a product can
belong to many
> categories. When doing a front end search to find
products in multiple
> categories, products can be shown thus:
>
> select * from Products where ProductID in (select
ProductID from
> ProductCategories where CategoryID in (5,44))
>
> --
> Jules
>
http://www.charon.co.uk/charoncart
> Charon Cart 3
> Shopping Cart Extension for Dreamweaver MX/MX 2004
>
>
>
>
> -
Using Comma-Separated Selector
I am building a site with products that can have different colors.
Some products share colors.
I am using the Comma-Separated Selector to select the available colors for each product from a list.
My problem is showing each product and the colors available for each product.
How do I create a recordset that pulls only the colors I need from the colors table based on the comma separated feild from the products table?
Thanks for any help or point in the right direction.
RGNelsonDifficult to say without seeing how your database is planned
Nested region? - probably not
take a look at the MYSQL query with uses
HAVING IN (items in a comma separated list, item, item, etc)
this is the same approach as the article you mentioned
also a similar problem (possibly) mentioned here...
ryanpratt, "Multiple conditions in Querey builder Help" #2, 18 Nov 2008 7:30 am
atb
Paul -
String Array to Comma spearated list
Hey Guys,
I have a struts application that receives a string[] array of product numbers corresponding to those that a user has selected. I need to put these into a SQL query in the form of "PRODUCTS.PRODUCT_NAME IN ('product1','product2','product3')" -- in otherwords, a comma separated list, with each item wrapped in apostrophes.
I can successfully drop in individual items using notation like the following:
<c:set var="where" value="and PRODUCTS.PRODUCT_NAME IN ('${formChecker4.selectedProductListForm2[0]}')" />What I'm not sure about is the best way to create my comma separated list. In my formChecker4 class, I have getSelectedProductListForm2() and setSelectedProductListForm2() methods, but these expect and return a string[] array, not a plain string. Does anyone have any handy suggestions for converting my array into a string, either within my class or within my EL tags?
Here's some of my formChecker4 class:
private String[] selectedProductListForm2;
public String[] getSelectedProductListForm2() {
return this.selectedProductListForm2;
public void setSelectedProductListForm2(String[] selectedProductListForm2) {
if (selectedProductListForm2.length == 0) {
this.selectedProductListForm2 = null;
} else {
this.selectedProductListForm2 = selectedProductListForm2;
}1) don't do it in JSP
2) [Use a prepared statement. |http://java.sun.com/docs/books/tutorial/jdbc/basics/prepared.html] -
Hi,
I have one existing view(with around 15 fields), in which I have to add few more fields from table called PI.
Now these fields have values like (55C4444F-D83B-4F96-A011-367A3755BA6C , F52388E2-485B-49DF-8534-FDF46D23F59E , 722432E1-F063-4CBD-B83D-1B97836E82953) 3 values comma separated.(Sometimes only one value and sometimes 4 or 5 or 7-8 depend on user has entered
on web page)
Also I have another table called PHA and this tables has 2 fields Values and Name so I have to map this two tables based on VALUES fields and get Name from this PHA table and show in view and that also Comma separated.
So basically I have to Parse the PI table's Values field 1st, map it with PHA table to get Name and then Make it comma separated in that existing view.
To make fields comma separate I used below query,
(SELECT DISTINCT SUBSTRING
SELECT ','+ PI.[Name] AS [text()]
FROM [DB].[dbo].[Table] PHA1
Inner Join [DB].[dbo].[Table] PI
ON PHA.[Value] = PI.[VALUE]
WHERE PHA1.PId =PHA2.PId and PHA1.CId = PHA2.CId
ORDER BY PHA1.PId
For XML PATH ('')
), 2, 1000)
FROM [DB].[dbo].[Table] PHA2
Inner Join [cSharpSite_profiles].[dbo].[PetAllergies] PA
Inner Join [DB].[dbo].[Table] PI
ON PHA.[Value] = PI.[VALUE]
) [Name]
VickyWait, this sounds wrong. You have a view where you group values into a comma-separated list. While that surely will make some purists cringe, I can see that it makes sense from a presentation perspective.
But if you want to use these concatenated values as atomic values again, you should go back to the base tables and them from there. Building views on views may sometimes be a good idea, but if you are too keen on reuse you can cause a performance disaster.
So do it right from the beginning.
Erland Sommarskog, SQL Server MVP, [email protected] -
Comma Separated columns - Search
Hi fellow,
I need to query my db with a comma separated list but the results are not correct...What is the reason?
My typical db problem_code column has valuas as :
Problem_code
1
2,3
5,6,7,8
5
And the list values I am sending as ("1","3")...etc
SELECT * from table
whereproblem_code in ('2','1')problem_code in ('2','1')
Thank you in advance..If you're sking SQL questions, you'd better off asking on a SQL forum. But here you are, so let's have a look at it.
Firstly, the other thing to always mention when raising an SQL question is to articulate what DB system you're using. Because all of them handle SQL differently, and have their own extensions.
In fact reading this is probably a good idea: http://www.catb.org/~esr/faqs/smart-questions.html
Problem_code
1
2,3
5,6,7,8
5
And the list values I am sending as ("1","3")...etc
SELECT * from table
whereproblem_code in ('2','1')problem_code in ('2','1')
Thank you in advance..
What are you seeing here that's not expected (I presume the double-up of problem_code in ('2','1') is a typo)?
Are you wanting to get any rows from TABLE which have either 1 or 2 in them? That's not what you're asking for in your WHERE statement though, is it?
Really, you should be normalising your data, because whilst you can write contorted logic to do what you need here, it will not perform well and certainly will not scale. So it for be somewhat poor practice to perpetuate the current situation if it's at all possible not to. The best thing to do is to normalise your data and refactor your code. Which will probably mean going to your boss and say "this DB schema is f*cked, and needs reworking. Needs reworking".
Depending on your DB system, you're probably going to need to loop over the list you want to filter on and do a "WHERE problem_code LIKE" on each element of the list. I think Oracle can do the sort of query you want to do - match elements of one list from another list - but I'm not sure.
Adam -
Issue with parsing comma separated file
Hi,
We are having an issue while parsing a comma separated file with "eol" as delimiter for last field. For last line in file we get either "eof" or "eol" as delimiter for last field. Is there any way we can handle both these scenarios using singe file adater? Example as below
File1:
a,b,c,d,e,f,g eol
a,b,c,d,e,f,g eol
a,b,c,d,e,f,g eol
a,b,c,d,e,f,g eol
a,b,c,d,e,f,g eol
File2:
a,b,c,d,e,f,g eol
a,b,c,d,e,f,g eol
a,b,c,d,e,f,g eol
a,b,c,d,e,f,g eol
a,b,c,d,e,f,g eof
ThanksWrite your own tokenizer. I think StringTokenizer ignores those values if they're empty since there's nothing to tokenize it into. It's a pretty simple class, I say just write your own.
Maybe you are looking for
-
Problem with apex_item.date_popup in APEX 3.1
Hi, I encountered a problem with the date_popup item after installing APEX3.1, probably someone can tell me if I am doing something wrong or if it is a sequel bug of 3.0. I have a form with a manually generated region displaying a row with different
-
Function module to convert an internal table to an tab delimited XL file
hi everyone can anyone tell me the name of the function module which can convert the data in the internal table to an Excel file (Tab de-limited). vamsi
-
Problem printing with Reader 9.4.5 and 10
I recently upgraded to Windows 7. I have a Cannon Pixma iP4300 printer and have installed the Windows 7 driver that I downloaded manually from the Cannon website. The test page prints on this printer, as do Office files and images. When I print a
-
Properties Toolbar not displaying in Acrobat Standard 9.0
In editing an Adobe document the Properties Toolbar does not display even though the Toolbar is checked. The Toolbar will not display unless the document is exited and all Adobe documents are closed and Adobe is opened again. Is this a known b
-
Please help!