Query not giving the correct result
select Project_id, contractno
from elf_transactions
where(rtrim(contractno),rtrim(project_id)) not in
(select rtrim(contractno),rtrim(projectid)
from contract_proj
where report_month='1-May-2007' )
when I m firing this query, it is not giving correct result to me, it also select the recorts which are matches in both the table
i want to fine out those contract, with projectid which are not in contract_proj table
Please help me in this regard
CREATE TABLE ELF_TRANSACTIONS
VENDOR_ORDER_REF VARCHAR2(60 BYTE),
BT_SUB_CON_REF VARCHAR2(10 BYTE),
PR_NO VARCHAR2(15 BYTE),
PO_NO VARCHAR2(15 BYTE),
PR_PO_DESCR VARCHAR2(200 BYTE),
ONE_IT_PROG VARCHAR2(50 BYTE),
BT_DEL_MANAGER_NAME VARCHAR2(40 BYTE),
DELIVERY_TYPE VARCHAR2(5 BYTE),
ACTUAL_DEP_DATE DATE,
ASSOC_ASG_BR_QUE VARCHAR2(50 BYTE),
PRE_AVG_P1_P2_INC_CNT NUMBER(3),
POST_P1_P2_INC NUMBER(3),
PERC_GROWTH_POST_REL NUMBER(3),
VENDOR_DEL_MANAGER VARCHAR2(50 BYTE),
REPORT_MONTH DATE,
COMMENTS VARCHAR2(200 BYTE),
PROJECT_ID VARCHAR2(20 BYTE),
CONTRACTNO VARCHAR2(15 BYTE),
CONTRACT_TYPE NVARCHAR2(15),
IDUNO VARCHAR2(10 BYTE),
STATUS VARCHAR2(10 BYTE),
DESCRIPTIONCODEDELIVERABLE VARCHAR2(255 BYTE),
UNIQUEID VARCHAR2(255 BYTE),
LOCK_RECORD CHAR(1 BYTE),
VERIFIED CHAR(1 BYTE),
VERIFIED_BY VARCHAR2(40 BYTE),
BT_VERIFIED CHAR(1 BYTE),
BT_VERIFIED_BY VARCHAR2(40 BYTE)
CREATE TABLE CONTRACT_PROJ
CONTRACTNO VARCHAR2(10 BYTE),
PROJECTID VARCHAR2(20 BYTE),
IDUNO VARCHAR2(10 BYTE),
CH_EMPID VARCHAR2(8 BYTE),
CHNAME VARCHAR2(40 BYTE),
GH_EMPID VARCHAR2(8 BYTE),
GHNAME VARCHAR2(40 BYTE),
PM_EMPID VARCHAR2(8 BYTE),
PMNAME VARCHAR2(40 BYTE),
SPM_EMPID VARCHAR2(8 BYTE),
SPMNAME VARCHAR2(40 BYTE),
PRJ_MONTH DATE,
BT_CONTRACT CHAR(1 BYTE)
REPORT_MONTH COMMENTS PROJECT_ID CONTRACTNO CONTRACT_TYPE IDUNO STATUS DESCRIPTIONCODEDELIVERABLE UNIQUEID
06/01/2007 00:00:00 1287 TML007452 OPEN Delivery of CRs DM CD and NSI N/A
06/01/2007 00:00:00 1280 TML007452 OPEN Delivery of CRs H&W OOR and WLTO N/A
06/01/2007 00:00:00 1231 TML007452 OPEN Delivery of CRs H&W OOR WLTO
06/01/2007 00:00:00 1097 TML007679 OPEN High Level Roadmap for Global Services and Wholesale with Feasibility study into BTR access to Switc N/A
06/01/2007 00:00:00 405 TML007942 OPEN RTRCC DEVELOPMENT -Q107
06/01/2007 00:00:00 405 TML007919 OPEN WLR3 DEVELOPMENT-Q107
06/01/2007 00:00:00 1170 TML008439 OPEN R-510
CONTRACTNO PROJECTID IDUNO CH_EMPID CHNAME GH_EMPID GHNAME PM_EMPID PMNAME SPM_EMPID SPMNAME PRJ_MONTH BT_CONTRACT
MBT003060 176 BT06 8694 Soman Sameer Surendra 1054 Bhadti Shripad Shivram 1054 Bhadti Shripad Shivram 1420 Rao Darbhamulla Kameswara 05/01/2007 00:00:00 N
MBT003842 1156 BT12 19992 Kalle Ajit Ashutosh 1539 Padgaonkar Shailesh Vishwanath 13948 Khunte Milind Vasant 16426 Kulkarni Vinay 05/01/2007 00:00:00 Y
MBT004677 458 BT09 20275 Mundassery George 5044 Kamalapurkar Leena Shrinivas 12849 Dave Ajay Yogeshchandra 2017 KIRKIRE SONAL MADHUKAR 05/01/2007 00:00:00 N
MBT004695 362 BT13 20276 Ghosh Sankar 2624 Avachat Jagdish Vasantrao 13592 Pal Sudipta 2624 Avachat Jagdish Vasantrao 05/01/2007 00:00:00 N
MBT004826 VITRIA BT09 20275 Mundassery George 26099 Saha Debendra Kumar 28134 Hinge Anand Sharad 12777 Karandikar Sumedh Vidyadhar 05/01/2007 00:00:00 Y
MBT004924 1027 BT03 1451 Tillu Ashirwad 15693 Devaraj Daniel G 6867 Jadhav Satyajit Ramesh 15693 Devaraj Daniel G 05/01/2007 00:00:00 N
MBT004927 1025 BT05 4436 Kelkar Subhash Manohar 20379 Gore Sujeet Narayan 13704 Vignesh Chandrasekaran 4347 BIJNORI REHANA GULAMWARIS 05/01/2007 00:00:00 N
MBT004927 1092 BT05 4436 Kelkar Subhash Manohar 15094 Jain Jitendra 13350 Bokil Shripad Raghunath 9511 Markande Balchandra Narayan 05/01/2007 00:00:00 N
MBT004927 1213 BT09 20275 Mundassery George 19996 Vege Sridhar 16401 Sibgathulla Mohammed 19996 Vege Sridhar 05/01/2007 00:00:00 N
Similar Messages
-
Case condition is not giving the correct result in Union query
Hello PL/SQL Gurus,
I am using Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production version
I have a table in following format -
drop table TT2;
create table TT2(FeeDate,Clerk,ClrComm,ExComm,TagComm) as select
20120102,'Mathews',25,56,245 from dual union all select
20120102,'Lika',0,56,245 from dual union all select
20120102,'Ram',0,0,245 from dual union all select
20120102,'Angilo',NULL,NULL,245 from dual union all select
20120102,'Nikki',225,NULL,245 from dual union all select
20120103,'Ram',NULL,556,2345 from dual union all select
20120103,'Lika',NULL,NULL,245 from dual union all select
20120103,'Mathews',25,56,245 from dual;DML Used -
SELECT FEEDATE,CLERK,SUM(ClrComm) ClrComm,null ExComm,null TagComm,sum(case when ClrComm>0 then ClrComm end) Comm
from tt2
group by FEEDATE,CLERK
UNION
SELECT FEEDATE,CLERK,null ClrComm,sum(ExComm) ExComm,null TagComm,sum(case when ExComm>0 then ExComm end) Comm
from tt2
group by FEEDATE,CLERK
UNION
SELECT FEEDATE,CLERK,null ClrComm,null ExComm,sum(TagComm) TagComm,sum(case when ClrComm=0 or ClrComm is NULL and ExComm=0 or ExComm is NULL then TagComm end) Comm
from tt2
group by FEEDATE,CLERKResult Output -
FEEDATE CLERK CLRCOMM EXCOMM TAGCOMM COMM
20120102 Angilo 245 245
20120102 Angilo
20120102 Lika 0
20120102 Lika 56 56
20120102 Lika 245 245
20120102 Mathews 25 25
20120102 Mathews 56 56
20120102 Mathews 245
20120102 Ram 225 225
20120102 Ram 0
20120102 Ram 490 490
FEEDATE CLERK CLRCOMM EXCOMM TAGCOMM COMM
20120103 Lika 245 245
20120103 Lika
20120103 Mathews 25 25
20120103 Mathews 56 56
20120103 Mathews 245
20120103 Ram 556 556
20120103 Ram 2345
20120103 Ram
Output expected -
FEEDATE CLERK CLRCOMM EXCOMM TAGCOMM Comm
20120102 Mathews 25 56 245 81
20120102 Lika 0 56 245 56
20120102 Ram 0 0 245 245
20120102 Angilo 245 245
20120102 Nikki 225 245 225
20120103 Ram 556 2345 556
20120103 Lika 245 245
20120103 Mathews 25 56 245 81I sincerely thanks to all of you for your effort in advance.This way:
select feedate, clerk, clrcomm, excomm, tagcomm,
sum(decode(nvl(clrcomm, 0) + nvl(excomm, 0), 0, tagcomm, nvl(clrcomm, 0) + nvl(excomm, 0))) over (partition by feedate, clerk) comm
from tt2
order by feedate, clerk;
FEEDATE CLERK CLRCOMM EXCOMM TAGCOMM COMM
20120102 Angilo 245 245
20120102 Lika 0 56 245 56
20120102 Mathews 25 56 245 81
20120102 Nikki 225 245 225
20120102 Ram 0 0 245 245
20120103 Lika 245 245
20120103 Mathews 25 56 245 81
20120103 Ram 556 2345 556
8 rows selected -
I am using TABLE(CAST()) operation in PL/SQL and it is returning me no data.
Here is what I have done:
1. Created Record type
CREATE OR REPLACE TYPE target_rec AS OBJECT
target__id NUMBER(10),
target_entity_id NUMBER(10),
dd CHAR(3),
fd CHAR(3),
code NUMBER(10),
target_pct NUMBER,
template_nm VARCHAR2(50),
p_symbol VARCHAR2(10),
pm_init VARCHAR2(3),
target_name VARCHAR2(20),
targe_type VARCHAR2(30),
target_caption VARCHAR2(30),
sort_order NUMBER (4)
2. Created Table type
CREATE OR REPLACE TYPE target_arr AS TABLE OF target_rec
3. Created Stored procedure which accepts parameter of type target_arr and runs the Table(Cast()) function on it.
Following is the simplified form of my procedure.
PROCEDURE get_target_weights
p_in_template_target IN target_arr,
p_out_count OUT NUMBER,
IS
BEGIN
SELECT count(*) into p_out_count
FROM TABLE(CAST(p_in_template_target AS target_arr)) arr;
END;
I am calling get_target_weights from my java code and passing p_in_template_target with 10140 records.
Scenario 1: If target_pct in the last record is 0, p_out_count returned from the procedure is 0.
Scenario 2: If target_pct in the last record is any other value(say 0.01), p_out_count returned from the procedure is 10140.
Please help me understand why the Table(Cast()) is not returning the correct results in Scenario 1. Also adding or deleting any record from the test data returns the correct results (i.e. if keep target_pct in the last record as 0 but add or delete any record).
Let me know how can I attach the test data I am using to help you debugging as I don’t see any Attach file button on Post Message screen on the forum.I am not able to reproduce this problem with a small data set. I can only reproduce with the data having 10140 records.
I am not sure if this is the memory issue as adding a new record also solves the problem.
This should not be the error because of wrong way of filling the records in java as for testing purpose I just saved the records which I am sending from java in a table. I updated the stored procedure as well to read the data from the table and then perform TABLE(CAST()) operation. I am still getting 0 as the output for scenario 1 mentioned in my last mail.
Here is what I have updated:
1. Created the table target_table
CREATE Table target_table
target_id NUMBER(10),
target_entity_id NUMBER(10),
dd CHAR(3),
fd CHAR(3),
code NUMBER(10),
target_pct NUMBER,
template_nm VARCHAR2(50),
p_symbol VARCHAR2(10),
pm_init VARCHAR2(3),
target_name VARCHAR2(20),
target_type VARCHAR2(30),
target_caption VARCHAR2(30),
sort_order NUMBER (4)
2. Inserted data into the table : The script has around 10140 rows. Pls let me know how can I send it to you
3. Updated procedure to read data from table and stored into variable of type target_arr. Run Table(cast()) operation on target_arr and get the count
PROCEDURE test_target_weights
IS
v_target_rec target_table%ROWTYPE;
CURSOR wt_cursor IS
Select * from target_table;
v_count NUMBER := 1;
v_target_arr cws_target_arr:= target_arr ();
v_target_arr_rec target_rec;
v_rec_count NUMBER;
BEGIN
OPEN wt_cursor;
loop
fetch wt_cursor into v_target_rec; -- fetch data from table into local record.
exit when wt_cursor%notfound;
--move data into target_arr
v_target_arr_rec := cws_curr_pair_entity_wt_rec(v_target_rec target_id,v_target_rec. target_entity_id,
v_target_rec.dd,v_target_rec.fd,v_target_rec.code,v_target_rec.target_pct,
v_target_rec.template_nm,v_target_rec.p_symbol,v_target_rec.pm_init,v_target_rec.template_name,
v_target_rec.template_type,v_target_rec.template_caption,v_target_rec.sort_order);
v_target_arr.extend();
v_target_arr(v_count) := v_target_arr_rec;
v_count := v_count + 1;
end loop;
close wt_cursor;
-- run table cast on target_arr
SELECT count(*) into v_rec_count
FROM TABLE(CAST(v_target_arr AS target_arr)) arr;
DBMS_OUTPUT.enable;
DBMS_OUTPUT.PUT_LINE('p_out_count ' || v_rec_count);
DBMS_OUTPUT.PUT_LINE('v_count ' || v_count);
END;
Output is
p_out_count 0
v_count 10140
Expected output
p_out_count 10140
v_count 10140 -
Date difference is not showing the correct result for date interval
Hi Expert,
I've created two formula variable one for PO date and another for GR date
while i am taking the date difference of GR and PO date for single PO date selection
it showing me correct result , but while i am taking the date interval for PO date it not
showing the correct result.
eg: PO date: 01.01.2010 for a particular PO and Gr date is suppose 03.01.2010, 06.01.2010
it showing the result 2 and 5.
But if i am taking date interval for PO date:
eg: 01.01.2010 - 31.01.2010
PO date: 10.01.2010 and GR date are suppose 15.01.2010, 22.01.2010 and 30.01.2010
it showing me 14, 21 and 29
Thanks and Regards
Lalit KumarHi Expert,
Through replacement path.
Thanks and Regards
Lalit Kumar -
Function used in SQL query not showing the desired results
I have created a function that gives me the client id but when i am using the function in the query its not giving me any result i.e. 0 rows but if I execute the function sepreatly and put the result of that function in the qurey it is giving me the desired result please have a look on the following and please reply with you expert opinion:
FUNCTION CODE:
create or replace function j2
(usid in varchar2)
return varchar2
is
cidn_in varchar2(4000) := '';
ls_sep varchar2(1) := ',';
cursor predicate_cidn
is
select
logical_schema_id
from
CLIENT_REGISTRY cr,
MEMBER_ROLE_CLIENT_ASSIGNMENT mrca,
MEMBER m
where
mrca.base_client_id = cr.base_client_id and
mrca.member_id = m.member_id and
cr.schema_in_use_in = '1' and
m.active_status_id = 'A' and
upper(mrca.member_id) = upper(usid);
BEGIN
for GET_CIDN in predicate_cidn
loop
cidn_in := cidn_in || ls_sep || '''' || GET_CIDN.logical_schema_id || '''';
end loop;
cidn_in := substr(cidn_in, 2);
cidn_in := '('||cidn_in||')';
--dbms_output.put_line(cidn_in);
return cidn_in;
END ;
SQL> select j2('qaa@adp') from dual;
J2('QAA@ADP')
('BASE18','SDK1TEST','SEETHA1CONFIG','BASE09','KAREN2','SIVACONFIG','BASE19','SD
K1CTEST','VASU1','KAREN5','EVENTS1CTEST','SDK1','ADA1CONFIG','BASE10','VRB1CONFI
G','CRU2CONFIG','BASE20','SIVATEST','PCOMCONFIG','KP1CONFIG','KAREN4CONFIG','EVE
NTS1TEST','SUZ3CONFIG','DONG2CONFIG','ED2CONFIG','SIVACTEST','APDCONFIG','EVENTS
1CONFIG','ESSCONFIG','SIVA','SDK2CONFIG','ED3CONFIG','RAJ4CONFIG','CBRCONFIG','N
AMRATA2CONFIG','EMIL1','NAMRATA1CONFIG','SDK2CTEST','BVT2CONFIG','MURUGAN1CONFIG
','COB1CONFIG','GABY1TEST','CHR1CONFIG','ED4CONFIG','USE1CONFIG','SDK2TEST','DEM
O1CONFIG','BERNIE1CONFIG','XA1','CAR2TEST','SDK2','ED5CONFIG','PAY1TEST','PAYXCO
NFIG','KP1TEST','SEAN1CONFIG','CAR2CTEST','VASU1CONFIG','SEAN2CONFIG','KP1CTEST'
,'MAU1CONFIG','CONWCONFIG','PAN1CONFIG','MERAJ2','PRA3CONFIG','SEAN5CONFIG','KP1
','PRA4CONFIG','CAR2CONFIG','PRA2CONFIG','SEAN6CONFIG','PRA3TEST','RPT','GABY1CT
EST','SDK3CONFIG','PRA2TEST','SEAN9CONFIG','CAR2','LV1CONFIG','PRA3CTEST','DONG1
CONFIG','TE1CONFIG','MERAJ2CONFIG','VIV1CONFIG','GABY1','SEAN2','PRA2CTEST','PRA
3','RPTCONFIG','PRA4CTEST','SEAN3','MITA1CONFIG','PRA2','RPTCTEST','PCOM1CONFIG'
,'SS2CONFIG','PAY1CONFIG','SEAN7','ANNCONFIG','BASE11','BASE02','LV2CONFIG','RPT
TEST','IMPECONFIG','SUR1CONFIG','SREEK2CONFIG','BASE03','SRINU3CONFIG','BDCONFIG
','JAY1CONFIG','AMMAN1','PRA1TEST','WPGCONFIG','BASE12','MP5CONFIG','MERAJ1','SR
INU2CONFIG','XA1CONFIG','RAJ1CONFIG','WPGCTEST','BASE04','CHRIS','RAJSCONFIG','P
ANKAJ','BASE13','WPGTEST','RAJ3CONFIG','WPG','BASE14','VASU2CONFIG','SRINU1CONFI
G','BASE05','PRA4TEST','VASU1TEST','PRA5CONFIG','NISH1CONFIG','CHRISCONFIG','SDK
3TEST','RAJ3TEST','KP2CONFIG','BASE06','DEFPCONFIG','NISH2CONFIG','CHRISCTEST','
WPSCONFIG','VASU2TEST','BASE15','GABY1CONFIG','PRA5TEST','MITA2CONFIG','BASE07',
'VASU1CTEST','KP2TEST','VASU2CTEST','LAURA3CONFIG','BASE16','CHRISTEST','WPSTEST
','VASU2','KP2CTEST','EVENTS1','BASE17','RAJ2CONFIG','WPSCTEST','BASE08','SREEK1
CONFIG','ADVE','PRA4','SDK1CONFIG','KP2','KAREN1','CRU1CONFIG','WPS')
Now if i put the results (cut and paste )in the query it gives me the results
SQL> select count(*) from baseclient.address_detail where cidn in ('BASE18','SDK1TEST','SEETHA1CONFIG','BASE09','KAREN2','SIVACONFIG','BASE19','SD
2 K1CTEST','VASU1','KAREN5','EVENTS1CTEST','SDK1','ADA1CONFIG','BASE10','VRB1CONFI
3 G','CRU2CONFIG','BASE20','SIVATEST','PCOMCONFIG','KP1CONFIG','KAREN4CONFIG','EVE
4 NTS1TEST','SUZ3CONFIG','DONG2CONFIG','ED2CONFIG','SIVACTEST','APDCONFIG','EVENTS
5 1CONFIG','ESSCONFIG','SIVA','SDK2CONFIG','ED3CONFIG','RAJ4CONFIG','CBRCONFIG','N
6 AMRATA2CONFIG','EMIL1','NAMRATA1CONFIG','SDK2CTEST','BVT2CONFIG','MURUGAN1CONFIG
7 ','COB1CONFIG','GABY1TEST','CHR1CONFIG','ED4CONFIG','USE1CONFIG','SDK2TEST','DEM
O1CONFIG','BERNIE1CONFIG','XA1','CAR2TEST','SDK2','ED5CONFIG','PAY1TEST','PAYXCO
8 9 NFIG','KP1TEST','SEAN1CONFIG','CAR2CTEST','VASU1CONFIG','SEAN2CONFIG','KP1CTEST'
10 ,'MAU1CONFIG','CONWCONFIG','PAN1CONFIG','MERAJ2','PRA3CONFIG','SEAN5CONFIG','KP1
11 ','PRA4CONFIG','CAR2CONFIG','PRA2CONFIG','SEAN6CONFIG','PRA3TEST','RPT','GABY1CT
12 EST','SDK3CONFIG','PRA2TEST','SEAN9CONFIG','CAR2','LV1CONFIG','PRA3CTEST','DONG1
13 CONFIG','TE1CONFIG','MERAJ2CONFIG','VIV1CONFIG','GABY1','SEAN2','PRA2CTEST','PRA
14 3','RPTCONFIG','PRA4CTEST','SEAN3','MITA1CONFIG','PRA2','RPTCTEST','PCOM1CONFIG'
15 ,'SS2CONFIG','PAY1CONFIG','SEAN7','ANNCONFIG','BASE11','BASE02','LV2CONFIG','RPT
16 TEST','IMPECONFIG','SUR1CONFIG','SREEK2CONFIG','BASE03','SRINU3CONFIG','BDCONFIG
17 ','JAY1CONFIG','AMMAN1','PRA1TEST','WPGCONFIG','BASE12','MP5CONFIG','MERAJ1','SR
18 INU2CONFIG','XA1CONFIG','RAJ1CONFIG','WPGCTEST','BASE04','CHRIS','RAJSCONFIG','P
19 ANKAJ','BASE13','WPGTEST','RAJ3CONFIG','WPG','BASE14','VASU2CONFIG','SRINU1CONFI
20 G','BASE05','PRA4TEST','VASU1TEST','PRA5CONFIG','NISH1CONFIG','CHRISCONFIG','SDK
21 3TEST','RAJ3TEST','KP2CONFIG','BASE06','DEFPCONFIG','NISH2CONFIG','CHRISCTEST','
22 WPSCONFIG','VASU2TEST','BASE15','GABY1CONFIG','PRA5TEST','MITA2CONFIG','BASE07',
23 'VASU1CTEST','KP2TEST','VASU2CTEST','LAURA3CONFIG','BASE16','CHRISTEST','WPSTEST
24 ','VASU2','KP2CTEST','EVENTS1','BASE17','RAJ2CONFIG','WPSCTEST','BASE08','SREEK1
25 CONFIG','ADVE','PRA4','SDK1CONFIG','KP2','KAREN1','CRU1CONFIG','WPS');
COUNT(*)
228
BUT if I user the function it gives me no results
0 rows selected and its taking a loon time to reurnThis appears to be a duplicate of the question in this thread
Re: VPD issue Need Assistance ASAP
where I wrote
"Your function returns a single string that happens to have a bunch of commas and quotes in it. An IN list generally requires a list of strings, which your function doesn't return.
You could rewrite the function to be a pipelined table function and then do
select count(*)
from baseclient.address_detail
where cidn in (SELECT cidn
FROM TABLE(<<your pipelined table function>>))
However, I would expect it to be easier not to wrap all this into a function and just have your IN clause be the logic in your predicate_cidn cursor.
Justin
" -
Ldapsearch does not return the correct result
We are using the Netscape Directory server 4.12. We try to use the Radiator Radius server to query the Directory server for authentication.
When we use the filter:
uid=itkychan
to query if the user is in the Directory, it returns the correct result.
However, we would like to query if the username is in a specified group, e.g. tss_ns_grp, in the Directory, we try to use the following command:
#./ldapsearch -b "o=The xxx University,c=HK" -h hkpu19
"(&(cn=tss_ns_grp)(|(&(objectclass=groupofuniquenames)(uniquemember=uid=itkychan))(&(objectclass=groupofnames)(member=uid=itkychan))))"
but no result is returned.
itkychan is a member of the group tss_ns_grp. The following is a portion of the LDIF file:
dn: cn=tss_ns_grp, o=The xxx University, c=HK
objectclass: top
objectclass: groupOfUniqueNames
objectclass: mailGroup
cn: tss_ns_grp
mail: [email protected]
mailhost: abcd.xxxu.edu.hk
uniquemember: cn=xxxxxxxxxxxxxx, uid=itkychan, ou=xxxu_ITS, o=The xxx University, c=HK
uniquemember: cn=xxxxxxxxxxxxxx, uid=itjcheng, ou=polyu_ITS, o=The xxx University, c=HK
uniquemember: .....You will have to use the full DN for the member and uniquemember e.g.
(...(uniquemember=cn=xxxxxxxxxxxxxx, uid=itkychan, ou=xxxu_ITS, o=The xxx University, c=HK)...) -
Query with outer join not dispalying the correct results
Hi All,
I am having a table which has a column called status it can either be null or has the code which comes from the lookup b.When I use this query
select b.menaing from a
where a.status=b'lookup_code(+)
AND b.lookup_type='MTH_BUSINESS_FUNCTION'
AND b.LANGUAGE = USERENV('LANG')
then I don't get the rows from table a, where status is null
and if I use the condition:
select b.menaing from a
where ((a.status IS NULL) OR
(a.status=b.lookup_code
AND b.lookup_type='MTH_BUSINESS_FUNCTION'
AND b.LANGUAGE = USERENV('LANG') ))
then I get many extra rows.Can soemone please tell me hwo to achieve this(My query should display the menaing if status column is blank then it should dispaly blank otherwise after joining iwth the lookup table it should display meaning)Hi Prazy,
using nvl also didn't solve my problem.Actually my problem is I am having a table a in which I have a column called satus, status has the values like A or I .I have one lookup called MTH_BUYSINESS_FUNCTION in which for lookup_code A I have menaing as Active and for lookup_code I meaning is Inactive.Now in table a for sttaus I have two values one A and one null Now I want to write sql which displayes the meaning for column staus.Result should be Active and null .If I am uisng 1 query which I gave u I am not able to get the 2nd row in my output.If I use 2nd query then I get duplicate rows.
Thanks ,
Amrit -
The Same Excel Functions Not Giving the Same Result in Numbers
I'm been using Excel for years and now that I've made the switch to Mac, I thought I should probably utilise the iWork suite of software and get rid of Microsoft once and for all.
Whilst I love the user-friendliness, there are so many small things that Apple to appear to have overlooked which keeps me hanging on to Microsoft Office just a little, but I digress.
OK, So I have one sheet in Numbers with the following data.
I am trying I need to search Column A for the TLDs in Column C, if they exist output the correct renewal price from Column D in Column B
e.g. A2 contains .net so B2 should have 12.50 in it.
A
B
C
D
1
Domain Name
Renewal Price 1
TLDs
Renewal Price 2
2
test.net
.com
5.00
3
test.co.uk
.co.uk
10.00
4
test.com
.net
12.50
So... can someone please explain to me why the same functions which exist in Numbers and Excel (VLOOKUP / LOOKUP / SEARCH) do not work in Numbers as they do in Excel? If there is a valid reason, fine, I'll accept that, but how do I acheive the above?
The formula which WORKS in B2 in Excel but NOT in Numbers is:
=VLOOKUP(LOOKUP(32768,SEARCH(C$2:C$4,A2),C$2:C$4),$C$2:$E$4,2,FALSE)
Thanks in advance.So... can someone please explain to me why the same functions which exist in Numbers and Excel (VLOOKUP / LOOKUP / SEARCH) do not work in Numbers as they do in Excel? If there is a valid reason, fine, I'll accept that, but how do I acheive the above?
That's a form of "array function" (searching a "table array"). Numbers can't do array functions the way Excel can.
Here's one way to achieve the same goal in Numbers:
The formula in B2, copied down:
=VLOOKUP(RIGHT(A2,LEN(A2)−SEARCH(".",A2)+1),Prices::$A:$B,2,FALSE)
SG -
Name attribute not giving the desired result in form tag
Hi,
I am using struts and the name attribute in form tag is not giving me the desired reuslt. The code is
<html:form name="loginActionForm" type="source.form.LoginActionForm" action="/login.do" method="post">
</html:form>
when I am trying to use the name in javascript then I am getting an error
"document.loginActionForm " is null or not an object.Where am I going wrong?I did so but the name I have used in the form tag is the same as what i have used in javascript.I dont think that it is a javascript error and it must be some mistake I made in the form tag.Also one more thing is it necessary to use the type attribute if you use the name attribute.
-
HttpServletRequest.getHeaders("accept") does not return the correct results
I noticed that when I use the invoke the HttpServletRequest.getHeaders("accept") method I do not get the result that I am expecting.
For instance, if the browser passes over the following accept header:
"text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8"
When i invoke the getHeaders() method, instead of it returning me a single value with the string that was passed over, it returns me 4 separate entries. It looks like Iplanet is parsing the header value and breaking it up by commas.
When I run the same code in TomCat, it returns the single comma separated string as I would expect.
Is there anything to keep Iplanet from breaking apart the header value?
I am running Oracle iPlanet Web Server 7.0.15 B04/19/2012 21:52
Thanks In Advance,
Marty
Edited by: MartyJones2 on Aug 30, 2012 2:44 PMYou will have to use the full DN for the member and uniquemember e.g.
(...(uniquemember=cn=xxxxxxxxxxxxxx, uid=itkychan, ou=xxxu_ITS, o=The xxx University, c=HK)...) -
Why is my zero order hold not giving the expected result?
I am trying to replicate the functionality of the Discrete Order Hold Function so that I can use it without having to have a ''Control and Simulation Loop''. The attachment desiredresult.vi shows an example of the Discrete Order Hold Function inside the ''Control and Simulation Loop''. The other attachment (zeroorderholdquestion.vi) shows my attempt at achieving the same result. I multiplied the while loop index by the sampling period to get the array index for the resampled y-output. I based this on my understanding of the formula for Discrete Order Hold given under http://zone.ni.com/reference/en-XX/help/371894G-01/lvsim/sim_dzoh/#details.
However, I am having difficulty getting the frequency of the waveforms before and after resampling to match up. (See attachment for clarity on what I mean by this). Any suggestions on what I am doing wrong?
Solved!
Go to Solution.
Attachments:
zeroorderholdquestion.vi 207 KB
desiredresult.vi 244 KBhere i wrote something maybe similar to simulate a multi channel, mux, sample and hold with cross talk
http://forums.ni.com/t5/LabVIEW/How-can-I-create-and-sample-and-hold-circuit-in-Labview/m-p/2407256#...
If samplerate and hold time have a clean ratio you just need the decimate vi
another simple version:
Greetings from Germany
Henrik
LV since v3.1
“ground” is a convenient fantasy
'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ' -
Query: Not getting the desired result. Please help
QL> select * from ecev;
entity_Tag
7
8
9
10
1
2
3
4
5
6
SQL> select * from dg;
DIGP_TAG CEPT_TAG
600 1
700 1
800 1
900 1
100 1
200 1
500 1
75 2
SQL> select * from enow;
ENTITY_CODE ENTITY_TAG DIGP_TAG TARGET_DA CEPT_TAG
EXT 7 600 26-MAY-07 1
EXT 8 700 26-MAY-07 1
EXT 9 800 26-MAY-07 1
EXT 10 800 22-APR-76 1
EXT 1 100 20-OCT-06 1
EXT 2 200 20-OCT-06 1
EXT 3 500 20-OCT-06 1
EXT 4 100 20-OCT-06 1
EXT 5 100 20-OCT-06 1
EXT 6 80 20-OCT-06 1
EXT 1 75 2
SQL> select * from tk;
TK_TAG DIGP_TAG NARRATIVE DUE_DATE CEPT_TAG
35 90 raj 27-MAY-07 1
36 900 kkd 27-MAY-07 1
37 100 kim 28-MAY-07 1
30 100 ram 23-MAY-07 1
31 100 kish 23-MAY-07 1
32 200 mar 23-MAY-07 1
33 100 gy 23-MAY-07 1
34 100 mm 27-MAY-07 1
8 rows selected.
For the following query
1 select
2 d.ecev_tag ecev_tag,
3 a.digp_tag entity_owner ,
4 c.digp_tag task_owner,
5 c.tk_tag task_tag,
6 c.narrative
7 from enow a,
8 entl b,
9 tk c,
10 ecev d
11 where ( a.DIGP_TAG=100 or c.digp_tag=100)
12 and a.entity_tag=b.entity_tag(+)
13 and b.tk_tag=c.tk_tag(+)
14* and a.entity_tag=d.entity_tag
SQL> select * from entl;
TK_TAG ENTITY_TAG
35 5
36 10
30 1
31 1
32 2
33 3
34 3
Result:
I get
entity_tag ENTITY_OWNER TASK_OWNER TASK_TAG NARRATIVE
5 100 90 35 raj row1
1 100 100 30 ram row2
1 75 100 30 ram row3 1 100 100 31 kish row4
1 75 100 31 kish row5 3 500 100 33 gy row6
3 500 100 34 mm row7
4 100 row8
Row1: yes, since entity_tag 5 is owned by digp_tag 100 (enow)
Row2: yes, since entity_tag 1 is owned by digp_tag 100 (enow)
Row3: NO, since entity_tag 1 is owned by digp_tag 75, which in turn is in cept_tag 2, since the passed digp_tag is 100 and it just belongs to cept_tag 1 we should not be getting this row.
Row4: Yes, since tk_tag 31 is owned by digp_tag 100 (tk)
Row5 NO, since entity_tag 1 is owned by digp_tag 75, which in turn is in cept_tag 2 since the passed digp_tag is 100 and it just belongs to cept_tag 1 we should not be getting this row.
Row6: Yes, since tk_tag 33 is owned by digp_tag 100 (enow)
Row7: Yes, since tk_tag 34 is owned by digp_tag 100(enow)
Row8: Yes, since entity_tag 4 is owned by 100(enow
I guess i have to join dg.cept_tag and a.cept_tag, but it is not working.....
Can somebody understand this and help...
Thanks
RamQL> select * from ecev;
entity_Tag
7
8
9
0
1
2
3
4
5
6
SQL> select * from dg;
DIGP_TAG CEPT_TAG
600 1
700 1
800 1
900 1
100 1
200 1
500 1
75 2
SQL> select * from enow;
ENTITY_CODE ENTITY_TAG DIGP_TAG
TARGET_DA CEPT_TAG
EXT 7
600 26-MAY-07 1
8 700
26-MAY-07 1
EXT 9
800 26-MAY-07 1
10 800
22-APR-76 1
EXT 1
100 20-OCT-06 1
2 200
20-OCT-06 1
EXT 3
500 20-OCT-06 1
4 100
20-OCT-06 1
EXT 5
100 20-OCT-06 1
6 80
20-OCT-06 1
EXT 1
75 2
L> select * from tk;
TK_TAG DIGP_TAG NARRATIVE DUE_DATE
CEPT_TAG
35 90 raj 27-MAY-07 1
36 900 kkd 27-MAY-07 1
37 100 kim 28-MAY-07 1
30 100 ram 23-MAY-07 1
31 100 kish 23-MAY-07 1
32 200 mar 23-MAY-07 1
33 100 gy 23-MAY-07 1
34 100 mm 27-MAY-07 1
8 rows selected.
For the following query
1 select
2 d.ecev_tag ecev_tag,
3 a.digp_tag entity_owner ,
4 c.digp_tag task_owner,
5 c.tk_tag task_tag,
6 c.narrative
7 from enow a,
8 entl b,
9 tk c,
10 ecev d
11 where ( a.DIGP_TAG=100 or c.digp_tag=100)
12 and a.entity_tag=b.entity_tag(+)
13 and b.tk_tag=c.tk_tag(+)
14* and a.entity_tag=d.entity_tag
SQL> select * from entl;
TK_TAG ENTITY_TAG
35 5
36 10
30 1
31 1
32 2
33 3
34 3
sult:
I get
entity_tag ENTITY_OWNER TASK_OWNER TASK_TAG
NARRATIVE
5 100 90
35 raj row1
100 100 30
ram row2
75 100
30 ram row31 100 100
31 kish row4
75 100
31 kish row5
3 500 100
33 gy row6
500 100 34
mm row7
100 row8
1: yes, since entity_tag 5 is owned by digp_tag 100
(enow)
Row2: yes, since entity_tag 1 is owned by digp_tag
100 (enow)
Row3: NO, since entity_tag 1 is owned by digp_tag 75,
which in turn is in cept_tag 2, since the passed
digp_tag is 100 and it just belongs to cept_tag 1 we
should not be getting this row.
Row4: Yes, since tk_tag 31 is owned by digp_tag 100
(tk)
Row5 NO, since entity_tag 1 is owned by digp_tag 75,
which in turn is in cept_tag 2 since the passed
digp_tag is 100 and it just belongs to cept_tag 1 we
should not be getting this row.
Row6: Yes, since tk_tag 33 is owned by digp_tag 100
(enow)
Row7: Yes, since tk_tag 34 is owned by digp_tag
100(enow)
Row8: Yes, since entity_tag 4 is owned by 100(enow
I guess i have to join dg.cept_tag and a.cept_tag,
but it is not working.....
Can somebody understand this and help...
Thanks
Ram
Result:
I get
entity_tag ENTITY_OWNER TASK_OWNER TASK_TAG NARRATIVE
5 100 90 35 raj row1
1 100 100 30 ram row2
1 75 100 30 ram row3
1 100 100 31 kish row4
1 75 100 31 kish row5
3 500 100 33 gy row6
3 500 100 34 mm row7
4 100 row8 -
Logical column not diplaying the correct results
Hi,
I am trying to display the %iBOTS failed and in my situation all have failed so i should get a value of 100%, but i am getting a value of 1 always even if i change the *100 to *600 menas it is not multiplying, below i is the formula used:
CASE WHEN "iBOTs Reporting".""."XXX_SCH_OWNER"."FACT_NQ_INSTANCE"."STATUS" = 2 THEN "iBOTs Reporting".""."XXX_SCH_OWNER"."FACT_NQ_INSTANCE"."INSTANCE_ID" END / "iBOTs Reporting".""."XXX_SCH_OWNER"."FACT_NQ_INSTANCE"."INSTANCE_ID" * 100
Any idea where i am going wrong.
Rgds
RajaHi,
It did not help, i believe as the aggregation method is count is not able to do the multiplication, i i remove the count it is doing the multiplication with the actual instance number, why is it not able to do a divide and multiply if count is applied, what is thw workaround.
Rgds,
Raja -
NOT IN operator giving the wrong results
DB version:10gR2
Why is NOT IN giving the wrong results. Isn't NOT EXISTS operator a flawless alternative to NOT IN?
create table my_table1 (col1 number);
insert into my_table1 values (1);
insert into my_table1 values (2);
commit;
create table my_table2 ( col1 number);
insert into my_table2 values (1);
commit;
select * from my_Table1;
COL1
1
2
select * from my_table2;
COL2
1
--correct result
SELECT * FROM my_table1 t1 WHERE NOT EXISTS
(SELECT * FROM my_table2 t2 WHERE t1.col1 = t2.col1)
COL1
2
---correct result using IN
SELECT * FROM my_table1 t1 where col1 not in (select col1 FROM my_table2 t2);
COL1
2
Inserting a NULL to my_Table2
Now the query using NOT IN is returning wrong results.
insert into my_table2 values (null);
commit;
SELECT * FROM my_table1 t1 where col1 not in (select col1 FROM my_table2 t2);
no rows selected
Query using NOT EXISTS is still giving the right results.
SELECT * FROM my_table1 t1 WHERE NOT EXISTS
(SELECT * FROM my_table2 t2 WHERE t1.col1 = t2.col1);
COL1
2ScottsTiger wrote:
can i use NOT EXISTS(with a proper Co-related subquery) as a safe alternative to NOT IN?Depends on your data and what you need to achieve.
Personally I avoid using NOT EXISTS or NOT IN if I can really help it.
My preferred method is to outer join the tables together and then remove any resultant rows where a value exists and I didn't want one. ;) -
Query does not retrieves the correct values
Hi,
pls look into the code.
clear: wf_etenr,
vbep.
To get the Scheduled Loading date and Scheduled Arrival Date.
SELECT MAX( etenr ) FROM vbep INTO wf_etenr
WHERE vbeln = tvbdpl-vgbel
AND posnr = wl_posnr.
IF sy-subrc EQ 0.
clear vbep.
SELECT SINGLE * FROM vbep "R02
WHERE vbeln = tvbdpl-vgbel "R02
AND posnr = tvbdpl-vgpos "R02
AND etenr = wf_etenr.
IF sy-subrc EQ 0.
when i see the values at dictionary level using the same wher conditions are mismatching with the query excution result in the program.
here in the second query ( SELECT SINGLE * ) it giving the wrong results .
if i compare the results at table level ,some of the field values are missing after excuting the above second query.
pls can any one give me ur suggestion on this !
rgds
sanjay reddyHi,
are these the same?
wl_posnr and tvbdpl-vgpos
try
SELECT SINGLE * FROM vbep
WHERE vbeln = tvbdpl-vgbel
AND posnr = wl_posnr
AND etenr = wf_etenr.
IF sy-subrc EQ 0.
to make somewhat consistent querys.
regards
Message was edited by: Zlatko
Zlatko Stracenski
Maybe you are looking for
-
End of Page event not triggering in ALV report
Hello, I am developing an ALV report using REUSE_ALV_LIST_DISPLAY. Whatever I write in top_of_page, it will be displayed in the header portion of the output. But I want to display some footer text at the end of the page. The problem I am facing is, t
-
Hi, I'm currently working on BI-IP with planning function "Repost on Basis of Characteristic relationship" and it works well but i would like to know if there's something like this in BPS. Some old projects are in BPS and there are some derivation by
-
How to add attribute Pricing ref material (PMATN) to 0MAT_SALES in BW
Hi there I need to create reports with the use of pricing ref. material (PMATN) showing the material numbers where PMATN has been used.It will have to be an attribute to infoobject 0MAT_SALES. It is not available in BW, but in table MVKE in R3. How d
-
Hello, With Oracle Cloud we can expose the Data as RESTful Web Service, but how about exposing BLOB... we need to generate a link for that file which is stored in the DB. To make it clearer: Two Tables: Properties (Property_ID number PK, Project varc
-
Trying to re-install CS5 but some applications are still open
Hi! After the computer shop had my computer they removed all of my software. I'm trying to reinstall CS5 from disk, but I keep on getting asked to close the applications :"safariCloudHisto" and "SafariNotificati" but nothing is open and I can't work