Query with ctype facet results
Hi,
Before I ask my question, let me give you a summary of my development environment. I am using Solaris 10 U4 on an x86 virtual machine and applied any locale related patches. I have also installed Sun Studio 12 and applied any C++ related patches. I currently have my locale set to en_AU.ISO8859-1.
I have a test program which displays the character classifications of all 256 characters in the 8859-1 codeset. This test program is as follows:
#include <locale>
#include <iostream>
#include <iomanip>
using namespace std;
int main()
const locale &rLocale = locale("");
const ctype<char> &rCtype = use_facet<ctype<char> >(rLocale, 0);
for (unsigned vI = 0; vI < 256; ++vI)
unsigned char vChar = static_cast<unsigned char>(vI);
cout
<< "0x"
<< hex << setiosflags(ios_base::internal | ios_base::uppercase) << setfill('0')
<< setw(2) << static_cast<unsigned>(vChar)
<< dec << resetiosflags(ios_base::internal | ios_base::uppercase) << setfill(' ')
<< " : "
<< (rCtype.is(ctype_base::space, vChar) ? "space" : ".....")
<< " "
<< (rCtype.is(ctype_base::print, vChar) ? "print" : ".....")
<< " "
<< (rCtype.is(ctype_base::cntrl, vChar) ? "cntrl" : ".....")
<< " "
<< (rCtype.is(ctype_base::upper, vChar) ? "upper" : ".....")
<< " "
<< (rCtype.is(ctype_base::lower, vChar) ? "lower" : ".....")
<< " "
<< (rCtype.is(ctype_base::alpha, vChar) ? "alpha" : ".....")
<< " "
<< (rCtype.is(ctype_base::digit, vChar) ? "digit" : ".....")
<< " "
<< (rCtype.is(ctype_base::punct, vChar) ? "punct" : ".....")
<< " "
<< (rCtype.is(ctype_base::xdigit, vChar) ? "xdigit" : "......")
<< endl;
return 0;
}When I run this test program, I am expecting all 256 characters to be classified according to ISO/IEC 6429:1992 and ISO/IEC 8859-1:1998. However, what I am getting is as follows:
{result}
0x00 : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x01 : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x02 : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x03 : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x04 : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x05 : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x06 : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x07 : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x08 : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x09 : space ..... cntrl ..... ..... ..... ..... ..... ......
0x0A : space ..... cntrl ..... ..... ..... ..... ..... ......
0x0B : space ..... cntrl ..... ..... ..... ..... ..... ......
0x0C : space ..... cntrl ..... ..... ..... ..... ..... ......
0x0D : space ..... cntrl ..... ..... ..... ..... ..... ......
0x0E : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x0F : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x10 : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x11 : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x12 : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x13 : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x14 : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x15 : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x16 : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x17 : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x18 : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x19 : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x1A : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x1B : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x1C : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x1D : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x1E : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x1F : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x20 : space print ..... ..... ..... ..... ..... ..... ......
0x21 : ..... print ..... ..... ..... ..... ..... punct ......
0x22 : ..... print ..... ..... ..... ..... ..... punct ......
0x23 : ..... print ..... ..... ..... ..... ..... punct ......
0x24 : ..... print ..... ..... ..... ..... ..... punct ......
0x25 : ..... print ..... ..... ..... ..... ..... punct ......
0x26 : ..... print ..... ..... ..... ..... ..... punct ......
0x27 : ..... print ..... ..... ..... ..... ..... punct ......
0x28 : ..... print ..... ..... ..... ..... ..... punct ......
0x29 : ..... print ..... ..... ..... ..... ..... punct ......
0x2A : ..... print ..... ..... ..... ..... ..... punct ......
0x2B : ..... print ..... ..... ..... ..... ..... punct ......
0x2C : ..... print ..... ..... ..... ..... ..... punct ......
0x2D : ..... print ..... ..... ..... ..... ..... punct ......
0x2E : ..... print ..... ..... ..... ..... ..... punct ......
0x2F : ..... print ..... ..... ..... ..... ..... punct ......
0x30 : ..... print ..... ..... ..... ..... digit ..... xdigit
0x31 : ..... print ..... ..... ..... ..... digit ..... xdigit
0x32 : ..... print ..... ..... ..... ..... digit ..... xdigit
0x33 : ..... print ..... ..... ..... ..... digit ..... xdigit
0x34 : ..... print ..... ..... ..... ..... digit ..... xdigit
0x35 : ..... print ..... ..... ..... ..... digit ..... xdigit
0x36 : ..... print ..... ..... ..... ..... digit ..... xdigit
0x37 : ..... print ..... ..... ..... ..... digit ..... xdigit
0x38 : ..... print ..... ..... ..... ..... digit ..... xdigit
0x39 : ..... print ..... ..... ..... ..... digit ..... xdigit
0x3A : ..... print ..... ..... ..... ..... ..... punct ......
0x3B : ..... print ..... ..... ..... ..... ..... punct ......
0x3C : ..... print ..... ..... ..... ..... ..... punct ......
0x3D : ..... print ..... ..... ..... ..... ..... punct ......
0x3E : ..... print ..... ..... ..... ..... ..... punct ......
0x3F : ..... print ..... ..... ..... ..... ..... punct ......
0x40 : ..... print ..... ..... ..... ..... ..... punct ......
0x41 : ..... print ..... upper ..... alpha ..... ..... xdigit
0x42 : ..... print ..... upper ..... alpha ..... ..... xdigit
0x43 : ..... print ..... upper ..... alpha ..... ..... xdigit
0x44 : ..... print ..... upper ..... alpha ..... ..... xdigit
0x45 : ..... print ..... upper ..... alpha ..... ..... xdigit
0x46 : ..... print ..... upper ..... alpha ..... ..... xdigit
0x47 : ..... print ..... upper ..... alpha ..... ..... ......
0x48 : ..... print ..... upper ..... alpha ..... ..... ......
0x49 : ..... print ..... upper ..... alpha ..... ..... ......
0x4A : ..... print ..... upper ..... alpha ..... ..... ......
0x4B : ..... print ..... upper ..... alpha ..... ..... ......
0x4C : ..... print ..... upper ..... alpha ..... ..... ......
0x4D : ..... print ..... upper ..... alpha ..... ..... ......
0x4E : ..... print ..... upper ..... alpha ..... ..... ......
0x4F : ..... print ..... upper ..... alpha ..... ..... ......
0x50 : ..... print ..... upper ..... alpha ..... ..... ......
0x51 : ..... print ..... upper ..... alpha ..... ..... ......
0x52 : ..... print ..... upper ..... alpha ..... ..... ......
0x53 : ..... print ..... upper ..... alpha ..... ..... ......
0x54 : ..... print ..... upper ..... alpha ..... ..... ......
0x55 : ..... print ..... upper ..... alpha ..... ..... ......
0x56 : ..... print ..... upper ..... alpha ..... ..... ......
0x57 : ..... print ..... upper ..... alpha ..... ..... ......
0x58 : ..... print ..... upper ..... alpha ..... ..... ......
0x59 : ..... print ..... upper ..... alpha ..... ..... ......
0x5A : ..... print ..... upper ..... alpha ..... ..... ......
0x5B : ..... print ..... ..... ..... ..... ..... punct ......
0x5C : ..... print ..... ..... ..... ..... ..... punct ......
0x5D : ..... print ..... ..... ..... ..... ..... punct ......
0x5E : ..... print ..... ..... ..... ..... ..... punct ......
0x5F : ..... print ..... ..... ..... ..... ..... punct ......
0x60 : ..... print ..... ..... ..... ..... ..... punct ......
0x61 : ..... print ..... ..... lower alpha ..... ..... xdigit
0x62 : ..... print ..... ..... lower alpha ..... ..... xdigit
0x63 : ..... print ..... ..... lower alpha ..... ..... xdigit
0x64 : ..... print ..... ..... lower alpha ..... ..... xdigit
0x65 : ..... print ..... ..... lower alpha ..... ..... xdigit
0x66 : ..... print ..... ..... lower alpha ..... ..... xdigit
0x67 : ..... print ..... ..... lower alpha ..... ..... ......
0x68 : ..... print ..... ..... lower alpha ..... ..... ......
0x69 : ..... print ..... ..... lower alpha ..... ..... ......
0x6A : ..... print ..... ..... lower alpha ..... ..... ......
0x6B : ..... print ..... ..... lower alpha ..... ..... ......
0x6C : ..... print ..... ..... lower alpha ..... ..... ......
0x6D : ..... print ..... ..... lower alpha ..... ..... ......
0x6E : ..... print ..... ..... lower alpha ..... ..... ......
0x6F : ..... print ..... ..... lower alpha ..... ..... ......
0x70 : ..... print ..... ..... lower alpha ..... ..... ......
0x71 : ..... print ..... ..... lower alpha ..... ..... ......
0x72 : ..... print ..... ..... lower alpha ..... ..... ......
0x73 : ..... print ..... ..... lower alpha ..... ..... ......
0x74 : ..... print ..... ..... lower alpha ..... ..... ......
0x75 : ..... print ..... ..... lower alpha ..... ..... ......
0x76 : ..... print ..... ..... lower alpha ..... ..... ......
0x77 : ..... print ..... ..... lower alpha ..... ..... ......
0x78 : ..... print ..... ..... lower alpha ..... ..... ......
0x79 : ..... print ..... ..... lower alpha ..... ..... ......
0x7A : ..... print ..... ..... lower alpha ..... ..... ......
0x7B : ..... print ..... ..... ..... ..... ..... punct ......
0x7C : ..... print ..... ..... ..... ..... ..... punct ......
0x7D : ..... print ..... ..... ..... ..... ..... punct ......
0x7E : ..... print ..... ..... ..... ..... ..... punct ......
0x7F : ..... ..... cntrl ..... ..... ..... ..... ..... ......
0x80 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x81 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x82 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x83 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x84 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x85 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x86 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x87 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x88 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x89 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x8A : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x8B : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x8C : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x8D : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x8E : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x8F : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x90 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x91 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x92 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x93 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x94 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x95 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x96 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x97 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x98 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x99 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x9A : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x9B : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x9C : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x9D : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x9E : ..... ..... ..... ..... ..... ..... ..... ..... ......
0x9F : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xA0 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xA1 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xA2 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xA3 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xA4 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xA5 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xA6 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xA7 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xA8 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xA9 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xAA : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xAB : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xAC : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xAD : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xAE : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xAF : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xB0 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xB1 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xB2 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xB3 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xB4 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xB5 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xB6 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xB7 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xB8 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xB9 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xBA : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xBB : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xBC : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xBD : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xBE : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xBF : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xC0 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xC1 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xC2 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xC3 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xC4 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xC5 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xC6 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xC7 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xC8 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xC9 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xCA : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xCB : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xCC : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xCD : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xCE : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xCF : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xD0 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xD1 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xD2 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xD3 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xD4 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xD5 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xD6 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xD7 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xD8 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xD9 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xDA : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xDB : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xDC : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xDD : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xDE : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xDF : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xE0 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xE1 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xE2 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xE3 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xE4 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xE5 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xE6 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xE7 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xE8 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xE9 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xEA : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xEB : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xEC : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xED : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xEE : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xEF : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xF0 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xF1 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xF2 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xF3 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xF4 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xF5 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xF6 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xF7 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xF8 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xF9 : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xFA : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xFB : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xFC : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xFD : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xFE : ..... ..... ..... ..... ..... ..... ..... ..... ......
0xFF : ..... ..... ..... ..... ..... ..... ..... ..... ......
{result}
Notice that the lower 128 characters have the correct classification but the upper 128 characters do not have any classification information. Am I missing something here or is the system not behaving correctly? Is there a fix for this problem?
Regards,
Leo
It looks like we have a problem with locale("") not setting the environment for the program.
If you use
const locale &rLocale = locale("en_AU.ISO8859-1"); the code works as you expect.
Please file a bug report at http://bugs.sun.com
Similar Messages
-
Joining query with single row result
dear all,
i have two tables
create table item(item_id number primary key,
item_desc varchar2(200));
create table item_properties(item_id number references item(item_id),
property_name varchar2(20),
property_value varchar2(100));i insert the following records
insert into items values(1,'CPU');
insert into item_properties values(1,'RAM','2gb');
insert into item_properties values(1,'PROCESSOR','2ghz');
insert into item_properties values(1,'HARDDISK','2ghz');
commit;now i want a query which produce the following results
item_id RAM PROCESSOR HARDDISK
1 2gb 2ghz 2TBHow to generate this result?
i have create a query but it generate multiple rows, instead i need in a single row like above.
select i.item_id,p.property_value from items i , item_properties p
where i.item_id=p.item_id and i.item_id=1;Kind thanks.
Edited by: Maahjoor on May 7, 2013 12:22 AMselect i.item_id,
max(decode(p.property_name,'RAM',p.property_value)) ram,
max(decode(p.property_name,'PROCESSOR',p.property_value)) processor,
max(decode(p.property_name,'HARDDISK',p.property_value)) hd
from items i , item_properties p
where i.item_id=p.item_id
and i.item_id=1
group by i.item_id;Or pivot in 11g
with details as
select i.item_id,p.property_name,p.property_value
from item i , item_properties p
where i.item_id=p.item_id
and i.item_id=1
select *
from details
pivot
max(property_value) for property_name in ('RAM','PROCESSOR','HARDISK')
);Edited by: jeneesh on May 7, 2013 1:04 PM -
Hello.
I have a query with LEFT OUTER JOIN that I think returns invalid results. Here are the problem details:
CREATE TABLE DOGERR(
IdDog INTEGER,
SfPdg CHAR(1),
IdVpl INTEGER,
SfVpGot INTEGER,
SfZrr CHAR(1)
INSERT INTO DOGERR(IdDog, SfPdg, IdVpl, SfVpGot, SfZrr) VALUES (1, 'S', 1, 1, '7');
INSERT INTO DOGERR(IdDog, SfPdg, IdVpl, SfVpGot, SfZrr) VALUES (2, 'S', 1, 1, '7');
INSERT INTO DOGERR(IdDog, SfPdg, IdVpl, SfVpGot, SfZrr) VALUES (3, '$', 1, 2, 'C');
COMMIT;
CREATE UNIQUE INDEX DOGERR_PK ON DOGERR(IdDog);
And now the query:
SELECT D.IdDog, D.SfPdg, D.IdVpl, D.SfVpGot, D.SfZrr, T.IdVpl AS IdVplJoin, T.SfVpGot AS SfVpGotJoin, T.SfZrr AS SfZrrJoin
FROM DOGERR D
LEFT OUTER JOIN (SELECT * FROM DOGERR WHERE SfPdg = 'S' OR SfPdg = 'S') T ON
T.IdVpl = D.IdVpl AND T.SfVpGot = D.SfVpGot AND T.SfZrr = D.SfZrr
WHERE
D.IdDog = 3
AND D.SfVpGot = 2
AND D.SfZrr = 'C';
This query should (by my understanding) return only one row in wich the joined subquery columns should be NULL. And indeed query returns only one row on Oracle Database 10g Release 10.2.0.1.0 - Production and on Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production:
IDDOG = 3, SFPDG = "$", IDVPL = 1, SFVPGOT = 2, SFZRR = "C", IDVPLJOIN = NULL, SFVPGOTJOIN = NULL, SFZRRJOIN = NULL
But on Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production it returns TWO rows:
IDDOG = 3, SFPDG = "$", IDVPL = 1, SFVPGOT = 2, SFZRR = "C", IDVPLJOIN = 1, SFVPGOTJOIN = 1, SFZRRJOIN = "7"
IDDOG = 3, SFPDG = "$", IDVPL = 1, SFVPGOT = 2, SFZRR = "C", IDVPLJOIN = 1, SFVPGOTJOIN = 1, SFZRRJOIN = "7"
And now the interesting part: any of the following modified versions of query works even on Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production, although modifications should not modify the result set:
-- Removed unnecessary WHERE conditions
SELECT D.IdDog, D.SfPdg, D.IdVpl, D.SfVpGot, D.SfZrr, T.IdVpl AS IdVplJoin, T.SfVpGot AS SfVpGotJoin, T.SfZrr AS SfZrrJoin
FROM DOGERR D
LEFT OUTER JOIN (SELECT * FROM DOGERR WHERE SfPdg = 'S' OR SfPdg = 'S') T ON
T.IdVpl = D.IdVpl AND T.SfVpGot = D.SfVpGot AND T.SfZrr = D.SfZrr
WHERE
D.IdDog = 3;
-- Removed unnecessary OR condition in subquery
SELECT D.IdDog, D.SfPdg, D.IdVpl, D.SfVpGot, D.SfZrr, T.IdVpl AS IdVplJoin, T.SfVpGot AS SfVpGotJoin, T.SfZrr AS SfZrrJoin
FROM DOGERR D
LEFT OUTER JOIN (SELECT * FROM DOGERR WHERE SfPdg = 'S') T ON
T.IdVpl = D.IdVpl AND T.SfVpGot = D.SfVpGot AND T.SfZrr = D.SfZrr
WHERE
D.IdDog = 3
AND D.SfVpGot = 2
AND D.SfZrr = 'C';
-- Removed columns from joined subquery from SELECT part
SELECT D.IdDog, D.SfPdg, D.IdVpl, D.SfVpGot, D.SfZrr, T.IdVpl AS IdVplJoin, T.SfVpGot AS SfVpGotJoin
FROM DOGERR D
LEFT OUTER JOIN (SELECT * FROM DOGERR WHERE SfPdg = 'S' OR SfPdg = 'S') T ON
T.IdVpl = D.IdVpl AND T.SfVpGot = D.SfVpGot AND T.SfZrr = D.SfZrr
WHERE
D.IdDog = 3
AND D.SfVpGot = 2
AND D.SfZrr = 'C';
NOTE: the query itself is a little stupid but this is just to demonstrate the problem. We have faced this problem at a customer with our real-world query.
So, my question is: why different results ?
Thanks.
Davidhi,
welcome to the forum,
don't have a solution, but I thought I'd let you know that the first SQL statement only returns 1 row on 10gR2
SQL> SELECT D.IdDog, D.SfPdg, D.IdVpl, D.SfVpGot, D.SfZrr, T.IdVpl AS IdVplJoin, T.SfVpGot AS SfVpGo
tJoin, T.SfZrr AS SfZrrJoin
2 FROM DOGERR D
3 LEFT OUTER JOIN (SELECT * FROM DOGERR WHERE SfPdg = 'S' OR SfPdg = 'S') T ON
4 T.IdVpl = D.IdVpl AND T.SfVpGot = D.SfVpGot AND T.SfZrr = D.SfZrr
5 WHERE
6 D.IdDog = 3
7 AND D.SfVpGot = 2
8 AND D.SfZrr = 'C';
IDDOG S IDVPL SFVPGOT S IDVPLJOIN SFVPGOTJOIN S
3 $ 1 2 C
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Solaris: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production -
How to compare result from sql query with data writen in html input tag?
how to compare result
from sql query with data
writen in html input tag?
I need to compare
user and password in html form
with all user and password in database
how to do this?
or put the resulr from sql query
in array
please help me?Hi dejani
first get the user name and password enter by the user
using
String sUsername=request.getParameter("name of the textfield");
String sPassword=request.getParameter("name of the textfield");
after executeQuery() statement
int exist=0;
while(rs.next())
String sUserId= rs.getString("username");
String sPass_wd= rs.getString("password");
if(sUserId.equals(sUsername) && sPass_wd.equals(sPassword))
exist=1;
if(exist==1)
out.println("user exist");
else
out.println("not exist"); -
Creating Query with dynamic columns to show results
Hi experts,
I need to know how to create a query with dynamic columns. Meaning, I don't want to create a query with fixed columns representing the 12 periods of the fiscal year to show me actuals as the fiscal year proceeds.
For example, if I am currently in the middle of period 3 (March) of a fiscal year, when I execute the query, I need it to automatically only show me the 'Actuals' for periods 1 and 2, without seeing the columns from periods 3 to 12 showing blank.
Then when I am in the middle period 5 (May) the query should ONLY show me the columns for periods 1 to 4 'Actuals', no results should be shown for periods 5 to 12 yet, and I don't want to even see blank columns for period 6 to 12.
How do I define my columns, to achieve this.
Maximum points will be awarded.
Thanks Everyone.Hi Josh,
I'm having a little difficuluty understanding what should be included in my restricted key figures.
The time characteristics that I have available to use are:
0FISCPER3 (posting period)
0FISCYEAR (fiscal year), currently using SAP EXIT to default current fiscal year.
0FISCVARNT (fiscal year variant).
In addition, I have the following characteristics available to be used in the columns:
Value type (10)
version (currently I'm using variable for it)
Currency type (020)
Currency (USD).
Can you explain what my restricted key figure should be based on and how it should look.
I tried to create a restircted key figure using 0AMOUNT, and 0FISCPER3. For 0FISCPER3 I created a range from 1 to previous period (using SAP EXIT that supplied previous period).I also had value type, version, currency type, and currency included in that restricted key figure.Then when I tried to drag 0FISCPER3 under the restricted key figure once again, it wouldn't let me, probably because I've already used 0FISCPER3 in the restricted key figure.
Please let me know if my explanation is not clear.
Your step by step help would be great.
Thanks
Edited by: Ehab Mansour on Sep 23, 2008 2:40 PM -
Query with a condition - Overall results row displays incorrect value
Hi All,
I have a bw query with top 40 conditions. However, The Overall Result Row Figures Do Not Equal The Sum of the Column Rows.
Although the top condition is activated, the overall result still displays the overall result of the whole report.
I have 3 columns in the report
Selected Period
Prior Period and
Variance
The formula for variance is (Selected Period/Prior Period)-1.
Does anyone have an idea to fix this?
Thank you so much in advance.
Have a great day!Hi Gaurav,
Thank you so much for your reply, however this does not solve fully the issue.
Changing the properties to "Summation" will indeed provide me with the correct sum for the "selected period" and "Prior Period." However what I need in the Overall Result Row for the "Variance" column is not the total but instead the value when the total of Selected Period is divided by Prior Period then minus 1.
Overall Variance = (Overall Selected Period/Overall Prior Period)-1
Do you know a way to make this possible.
Thank you so much. -
Query with Cost Center Hierarchy giving incorrect results
Hi All,
I have a universe built based on BEx query on Cost Center cubes. When enabling hierarchy in BEx Query and building Web intelligence Report based on the universe, I get incorrect results. The levels of the hierarchy is incorrect, many of the cost centers are missing etc. I checked the universe and confirmed that all levels of hierarchy are generated correctly. The Lov generated for these levels are correct and I see the complete hierarchy when using the BEx Variable in Universe for filtering.
I tried the same query with Hierarchy disabled with a different universe and it is providing correct results. Not sure what I'm missing here. Any inputs regarding this is appreciated.
Thanks & Regards,
SreeIngo, Thanks for your suggestion. Of course, I did update the Universe after any changes in the query. Tried different query setting related to hierarchy to make it work, but didn't many any difference and I get consistently incorrect results.
One thing what I wanted to confirm is, if there is any known bug in SP 2 Fix Pack 2.7 related to hierarchies. If not, it might be me doing some thing wrong and I will look into in more detail.
Thanks & Regards,
Sree -
How to Transpose the Query with following result
Dear All,
Can anyone tell me a method of transposing my result of the following query
Details can be found at
http://obiee11ge.blogspot.com/2010/07/how-to-transpose-query-with-following.html
Regards
MustafaHi,
Try this
Create a combined request with,
criteria 1 : Dummy, Revenue (Actual),Cogs(Actual), Opex(Actual), PL(Actual)
in the dummy column fx enter the value as 'Actual'
criteria 2 : Dummy, Revenue (Yago),Cogs(YAgo), Opex(Yago), PL(Yago)
in the dummy column fx enter the value as 'Yago'
criteria 3 : Dummy,Revenue (Budget),Cogs(Budget), Opex(Budget), PL(Budget)
in the dummy column fx enter the value as 'Budget'
Now go to the result columns and set the coumn names (Revenue, Cogs, Opex, PL) for the result set.
For the Dumny remove the column heading.
In table view you will get the result.
Thanks,
Vino -
Query with Top N Condition (Result Row)
Hi,
I made a query with an active top n condition. The query has 2 Keyfigures and 1 formula
Gross-sales acutal | Gross-sales previous year | Previous Year %
So that to result line is correct, I had to say "Calculate result as summation" for the keyfigures
gross sales actual and gross sales previous year. That works.
I have the problem with my formula. the formular for previous year % is defined as follows:
gross sales actual %A gross sales previous year
Example Top 3 Customer
gross sales actual gross sales prev. year prev. year %
Cust 1 100 80 125 %
Cust 2 90 45 200 %
Cust 3 80 60 133 %
Result 270 185 142.8 % ( 350 * 100 / 245 )
The result of 142 % is the correct result without the condition top 3. with the top 3 condition
the result should be 270 * 100 / 185 = 145.9 %
Additional customer without top 3 condition
Cust 4 50 40 125 %
Cust 5 30 20 150 %
It shows the correct result for each single line. The result in the result row is wrong. it is calculated
without taking the active condition. the formular calculates
with the total gross sales actual and the total of gross sales prev. year.
is there any solution the achieve the correct % in the result row?
thanks for your help.
PascalPascal,this is a known behavior with conditions.When you apply condition it just hide the extra rows and it does not impact the result row.So your result row actually shows the value irrespective of the condition you apply.
Now with the help of local functions like calculate result as summation you can show the correct sum after applying the condition but when you try to use that result in some calculation then it takes the original value thereby discarding the calculated value.
Same is happening in your case as well.Its taking the original value i.e 350 and not the calculated sum after condition i.e 270.
Hope this helps.
Regards,
AL -
Simple query with like return wrong result
Hi,
I run simple query with like.
If I use parameter I get wrong results.
If I use query without parameter results are ok.
My script:
ALTER SESSION SET NLS_SORT=BINARY_CI;
ALTER SESSION SET NLS_COMP=LINGUISTIC;
-- drop table abcd;
create table abcd (col1 varchar2(10));
INSERT INTO ABCD VALUES ('122222');
insert into abcd values ('111222');
SELECT * FROM ABCD WHERE COL1 LIKE :1; -- wrong result with value 12%
COL1
122222
*111222*
select * from abcd where col1 like '12%'; -- result ok
COL1
122222
I use Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
and query run in Oracle SQL Developer 3.1.07.Hi,
welcome to the forum.
When you put some code please enclose it between two lines starting with {noformat}{noformat}
i.e.:
{noformat}{noformat}
SELECT ...
{noformat}{noformat}
You should specify exactly how you run your code.
If I run this statement in SQL Plus:SQL> ALTER SESSION SET NLS_SORT=BINARY_CI;
Session altered.
SQL> ALTER SESSION SET NLS_COMP=LINGUISTIC;
Session altered.
SQL>
SQL> -- drop table abcd;
SQL> create table abcd (col1 varchar2(10));
Table created.
SQL>
SQL> INSERT INTO ABCD VALUES ('122222');
1 row created.
SQL> insert into abcd values ('111222');
1 row created.
SQL>
SQL> SELECT * FROM ABCD WHERE COL1 LIKE :1;
SP2-0552: Bind variable "1" not declared.
SQL>
I got this error. So I wonder how you set value 12%
Please specify exactly how you run your test as we cannot reproduce your problem.
Regards.
Al -
Repeated rows resulting from executeWithParams on query with bind variable
hi
Please consider this example application created using JDeveloper 11.1.1.3.0
at http://www.consideringred.com/files/oracle/2010/RepeatedRowsIssueApp-v0.01.zip
It has a View Object "EmployeesVO" based on a SQL query with a bind variable "EmailBVar".
The page "findEmployees.jspx" has executeWithParams dropped as an "ADF Parameter Form..." and the "EmployeesVOVI" collection as a table.
On "EmployeesVOVIIterator" the RangeSize has been modified from the default 25 to 10.
So, all straightforward stuff.
A scenario (sc1), running the page "findEmployees.jspx", specifying a value and clicking the "ExecuteWithParams" button results in repeated rows shown in the table, that is the first row (and subsequent rows) are repeated at row 11 (and subsequent rows),
as can be seen in the screencast at http://screencast.com/t/bn9QvV0qt
question:
- (q1) How can the repeated rows in scenario (sc1) be explained/avoided?
many thanks
Jan VerveckenThanks for your reply Nick Haralabidis.
it can be avoided by setting the EmployeesVO Access Mode to Range Paging and setting the Range Size to 10. Indeed, that does seem to avoid the repeating rows.
Now why you get this behavior when you don't specify Range Paging on the VO I don't know. It could be because: 1) it is a bug - the obvious answer ;) , 2) because setting the RangeSize on the EmployeesVOVIIterator without setting the Access Mode on the EmployeesVO to Range Paging is conflicting - but then again there is no warning or error produced by JDeveloper, 3) ...It does look like unintended behaviour, for a "default approach" like this.
In documentation section "39.1.5 Efficiently Scrolling Through Large Result Sets Using Range Paging " ...
at http://download.oracle.com/docs/cd/E14571_01/web.1111/b31974/bcadvvo.htm#ADFFD1179
... this Range Paging for a View Object seems to be described as an optimization, not as a requirement for functionally correct behaviour.
- about (q1)
Another approach that seems to avoid the repeated rows in scenario (sc1) is removing the value for the RangeSize attribute on the iterator, so the RangeSize is not specified.
Using the modified example application
at http://www.consideringred.com/files/oracle/2010/RepeatedRowsIssueApp-v0.02.zip
... this can be seen in scenario (sc2) in the screencast at http://screencast.com/t/0bpCo33i8J
Although, the documentation in section "22.4.2.2 Iterator RangeSize Attribute " ...
at http://download.oracle.com/docs/cd/E14571_01/web.1111/b31974/web_form.htm#ADFFD706
... does not seem to mention anything about not specifying the RangeSize attribute, it does say "... You can set it to -1 to have the full record set returned. ...".
As can be seen in scenario (sc2) the EL expression #{bindings.EmployeesVOVIIterator.rangeSize} resolves to -1 which suggests that not specifying the RangeSize attribute is the same as configuring the RangeSize attribute to -1.
questions:
- (q2) What is the preferred way to avoid having "the full record set returned", without having repeated rows as in scenario (sc1)?
- (q3) Is the default configuration of RangeSize="25" on the iterator intended behaviour (for an interator supporting an executeWithParams action)?
regards
Jan -
Wrong result for query with like and %
I have a strange problem with query with like and %.
When I run this script:
ALTER SESSION SET NLS_SORT = 'BINARY_CI';
ALTER SESSION SET NLS_COMP = 'LINGUISTIC';
-- SELECT * FROM NLS_SESSION_PARAMETERS;
-- drop table test1;
CREATE TABLE TEST1(K1 NVARCHAR2(80));
INSERT INTO TEST1 VALUES ('gsdk');
INSERT INTO TEST1 VALUES ('ąxyz');
INSERT INTO TEST1 VALUES ('ŁFa');
INSERT INTO TEST1 VALUES ('ła');
INSERT INTO TEST1 VALUES ('Śab');
INSERT INTO TEST1 VALUES ('Śrrrb');
commit;
select * from TEST1 where k1 like N'Ł%';
I get this:
K1
ŁFa
ła
Śab <- WRONG
Śrrrb <- WRONG
4 rows selected
When i change datatype to varchar2 this code work correct.
Is this a bug or what ?
The execution plan:
PLAN_TABLE_OUTPUT
SQL_ID d3d64aupz4bb5, child number 2
select * from TEST1 where k1 like N'Ł%'
Plan hash value: 4122059633
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 2 (100)| |
|* 1 | TABLE ACCESS FULL| TEST1 | 1 | 82 | 2 (0)| 00:00:01 |
Predicate Information (identified by operation id):
1 - filter((NLSSORT("K1",'nls_sort=''BINARY_CI''')>=HEXTORAW('014200'
) AND NLSSORT("K1",'nls_sort=''BINARY_CI''')<HEXTORAW('01610100') ))
Note
- dynamic sampling used for this statement (level=2)DATABASE NLS CONFIGURATION:
NLS_CHARACTERSET AL32UTF8
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_COMP BINARY
NLS_SORT BINARY
Oracle version 11.2.0.2.0 -
Need help with loading MySQL results into a query
Hello, I need some help figuring out why my tree component
isn't being populated with my MySQL results.
I have a table of categories:
ParentID - CategoryID - Name
Every top-level category has a ParentID of 0 (zero). I'm
using php and a recursive function to build an array of nested
results, then passing those results back to Flex, making those
results a new ArrayCollection, then assigning that to the
dataProvider of the tree.
Result: my tree component is blank
Suspicion: it has to be a way with how my array is being
formed in PHP. If I play around with how it is formed I can get
some odd results in the tree, so I know it's not a problem with the
data being passed back to Flex.
I am attaching the PHP code used to form the array, and the
output of the array being createdWhy not just build xml and send it back? Xml is hierarchical
by nature.
However, if you want to stick with the nested ACs then are
you using a labelFunction() with your tree? The node values are in
different properties, so you can't just set labelField.
Tracy -
Error executing a query with large result set
Dear all,
after executing a query which uses key figures with exception aggregation the BIA-server log (TrexIndexServerAlert_....trc) displays the following messages:
2009-09-29 10:59:00.433 e QMediator QueryMediator.cpp(00324) : 6952; Error executing physical plan: AttributeEngine: not enough memory.;in executor::Executor in cube: bwp_v_tl_c02
2009-09-29 10:59:00.434 e SERVER_TRACE TRexApiSearch.cpp(05162) : IndexID: bwp_v_tl_c02, QueryMediator failed executing query, reason: Error executing physical plan: AttributeEngine: not enough memory.;in executor::Executor in cube: bwp_v_tl_c02
--> Does anyone know what this message exactly means? - I fear that the BIA-Installation is running out of physical memory, but I appreciate any other opinion.
- Package Wise Read (SAP Note 1157582) does not solve the problem as the error message is not: "AggregateCalculator returning out of memory with hash table size..."
- To get an impression of the data amount I had a look at table RSDDSTAT_OLAP of a query with less amount of data:
Selected rows : 50.000.000 (Event 9011)
Transferred rows : 4.800.000 (Event 9010)
It is possible to calculate the number of cells retreived from one index by multiplying the number of records from table RSDDSTAT_OLAP by the number of key figures from the query. In my example it is only one key figure so 4.800.000 are passed to the analytical engine.
--> Is there a possibility to find this figure in some kind of statistic table? This would be helpful for complex queries.
I am looking forward to your replies,
Best regards
BjoernHi Björn,
I recommend you to upgrade to rev 52 or 53. Rev. 49 is really stable but there are some bugs in it and if you use BW SP >= 17 you can use some features.
Please refer to this thread , you shouldn't´t use more than 50% (the other 50% are for reporting) of your memory, therefor I have stolen this quote from Vitaliy:
The idea is that data all together for all of your BIA Indexes does not consume more then 50% of total RAM of active blades (page memory cannot be counted!).
The simpliest test is during a period when no one is using the accelerator, remove all indexes (including temporary) from main memory of the BWA, and then load all indexes for all InfoCubes into ain memory. Then check your RAM utilization.
Regards,
-Vitaliy
Regards,
Jens -
Doubt in Firing Query with multiple opportunities UUID/IDs
HI Folks!
I might have simple doubt but please help me on this!
1. I have a custom BO with association to opportunities.
[DeploymentUnit(CustomerRelationshipManagement)] businessobject Sy_Trade {
[AlternativeKey] [Label("Trade Id")] element tradeid : BusinessTransactionDocumentID;
node RelatedOpportunities [0,n]{
element BusinessTransactionDocumentReference : BusinessTransactionDocumentReference;
element BusinessTransactionDocumentRelationshipRoleCode : BusinessTransactionDocumentRelationshipRoleCode;
association RelatedOpportunity[0,1] to Opportunity;
2. I have success fully used association and i am able to view create all the opportunities related to my custom Bo.
ISSUE : I want a facet where i just want DISPLAY the activities and sales document assigned in the RELATED OPPORTUNITIES ( N opportunities )
How do i query with Multiple opportunities ID and fetch the activities against it?
Btw I want to use query in UI Designer... I have created an advanced list pane and there i want the result list
I hope i am clear!
Thanks in adavance...
Regards
DhruvinHi Ludger,
I have successfully displayed Related Opportunities associated with trade.( i am able to create , delete also )
Issue : I am not able to "Display" ( i don't need to edit or create ) all the activities created against all the opportunities in a different tab.
I tried to approaches :
1: Query : Created a Query on Activity BO and tried to pass multiple related opportunities ( but seems not possible , please tell me any possibility to pass range of opportunity via transformation or anything? )
2 : binding : I have a Node Related Opportunity so just tried to bind it with BO model but problem is it is displaying all the activities of first opportunity of the list...
i think why because :
In Data model I have created a table bind with Related Opportunities...
now that node is 1 to N , association to opportunity 0 to 1 , hence i think it fetches only 1 opportunities activity
should i create like below ( Or is it possible)
Node Reltdoppts[0,1]
association [0,N] to opportunity BO ?
Although i strongly feel SAP should provied us two things :
1. We need to pass range of opportunities in a query.
2. We need to just write some absl code where i can fill the table and display it
and also is there any possibility to create a report or something to display activities as we just want to display the activities!
P.S : I have been getting a lot of bashing from client because some of the product restriction in cloud! i hope and wish SAP give developers free hand to develop right now its like our hands are tied to many things
Maybe you are looking for
-
Feature Request: iTunes to merge the "Song Name" & "Artist" fields
This is a feature request that i would like to see in a future release of iTunes. The option to merge the "Song Name" & "Artist" fields together. This would be a very valuable option when surfing your iTunes Library thru your iPod, Front Row, or Appl
-
i configured xorg to using nv driver and i restart x (ctrl+alt+backspace) and i got eror /var/log/Xorg.0.log: X Window System Version 7.1.1 Release Date: 12 May 2006 X Protocol Version 11, Revision 0, Release 7.1.1 Build Operating System: UNKNOWN Cur
-
My iMac 2010 27" makes low noises EXCEPT when scrolling with my magic mouse.
It's like a low static electric noise but it stops when I scroll webpages and such with my magic mouse.
-
How can i access attribes in post-exit?
We can enhance a class by pre-exit and post-exit. But How can I access attributes of class in post-exit code???
-
How to install hp laserjet p2015 in windows vista 32
I need help. I already tried downloading :HP Universal Print Driver for Windows PCL6 is not working. I tried:HP Printer Administrator Resource Kit and this comes out..