To_date function not fetching the desired result.....
Hi Gurus,
I get varied results from the below 2 queries, I am pessimistic about using to_char instead prefer using to_date, but query doesn't seem to fetch the complete data while using the to_date but with to_char it works. Please can someone make this to_date used query below work for me.
Main table structure:
Column Name ID Pk Null? Data Type Default Histogram Encryption Alg Salt
MINISTRY_CODE 1 Y VARCHAR2 (15 Byte) Yes
BILL_MONTH 2 Y DATE Yes
CUBIC 3 Y NUMBER Yes
GALLONS 4 Y NUMBER Yes
AMOUNTS 5 Y NUMBER Yes
MTR_TYPE 6 Y CHAR (1 Byte) Yes 1st query:
SELECT ministry_code,
DECODE(mtr_type, 'C','Billed Cubic',
'G','Billed Gallons',
'A','Billed OMR',
'R','Collected',
'U','Total Unpaid Bills') mtr_type,
SUM(CASE
WHEN mtr_type NOT IN ('C','G','A','R','U') THEN 0 WHEN to_char(bill_month,'MMYYYY') = '012011' AND mtr_type = 'C' THEN cubic
WHEN mtr_type NOT IN ('C','G','A','R','U') THEN 0 WHEN to_char(bill_month,'MMYYYY') = '012011' AND mtr_type = 'G' THEN (gallons)
WHEN mtr_type NOT IN ('C','G','A','R','U') THEN 0 WHEN to_char(bill_month,'MMYYYY') = '012011' AND mtr_type = 'A' THEN amounts
WHEN mtr_type NOT IN ('C','G','A','R','U') THEN 0 WHEN to_char(bill_month,'MMYYYY') = '022011' AND mtr_type = 'R' THEN amounts
WHEN mtr_type NOT IN ('C','G','A','R','U') THEN 0 WHEN to_char(bill_month,'MMYYYY') <= '022011' AND mtr_type = 'U' THEN amounts ELSE 0 END) January
FROM tmp_paew_month_gafu1 WHERE ministry_code IN
(SELECT DISTINCT ministry_code FROM tmp_paew_month_gafu GROUP BY ministry_code)
GROUP BY ministry_code,mtr_type
ORDER BY 1,3 DESCSAMPLE OUTPUT:
MINISTRY_CODE MTR_TYPE JANUARY
001 Billed Gallons 5326252
001 Billed Cubic 24210.2363636364
001 Total Unpaid Bills 16402.5
001 Billed OMR 13287.36
001 Collected 10410.508
002 Total Unpaid Bills 12089.99
002 Billed Cubic 0
002 Billed OMR 0
002 Billed Gallons 0
002 Collected 0
003 Total Unpaid Bills 27418.711
2nd query:
SELECT ministry_code,
DECODE(mtr_type, 'C','Billed Cubic',
'G','Billed Gallons',
'A','Billed OMR',
'R','Collected',
'U','Total Unpaid Bills') mtr_type,
SUM(CASE
WHEN mtr_type NOT IN ('C','G','A','R','U') THEN 0 WHEN to_char(bill_month) = to_date('012011','MMYYYY') AND mtr_type = 'C' THEN cubic
WHEN mtr_type NOT IN ('C','G','A','R','U') THEN 0 WHEN to_date(bill_month) = to_date('012011','MMYYYY') AND mtr_type = 'G' THEN (gallons)
WHEN mtr_type NOT IN ('C','G','A','R','U') THEN 0 WHEN to_date(bill_month) = to_date('012011','MMYYYY') AND mtr_type = 'A' THEN amounts
WHEN mtr_type NOT IN ('C','G','A','R','U') THEN 0 WHEN to_date(bill_month) = to_date('022011','MMYYYY') AND mtr_type = 'R' THEN amounts
WHEN mtr_type NOT IN ('C','G','A','R','U') THEN 0 WHEN to_date(bill_month) <= to_date('022011','MMYYYY') AND mtr_type = 'U' THEN amounts ELSE 0 END) January
FROM tmp_paew_month_gafu1 WHERE ministry_code IN
(SELECT DISTINCT ministry_code FROM tmp_paew_month_gafu GROUP BY ministry_code)
GROUP BY ministry_code,mtr_type
ORDER BY 1,3 DESCSample OUTPUT:
MINISTRY_CODE MTR_TYPE JANUARY
001 Total Unpaid Bills 106062.002
001 Billed OMR 0
001 Billed Cubic 0
001 Billed Gallons 0
001 Collected 0
002 Total Unpaid Bills 42023.243
002 Collected 0
002 Billed Gallons 0
002 Billed Cubic 0
002 Billed OMR 0
003 Total Unpaid Bills 133260.435
What is the sense of to_date(bill_month) in the second query?
bill_month is already a date. to_date function will expect a character parameter and convert it in a date value.
So what will happen? First the bill_month will be implicitely converted to a character value.
Second this character value will be converted back to a date. You gave no format string. So both conversions will be made will your setting of nls_date_format.
I can only guess what you really want. Perhaps you want to trunc the bill_month with trunc(bill_month,'MM').
Please give us
- table create script
- insert statements for test data
- required output for these test data
- description of your requirements
Edited by: hm on 22.11.2012 23:16
Similar Messages
-
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
" -
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 -
Progression not yielding the desired result
Hi
I have written a text query using the progressive relaxation method. It is not giving me the desired results. Here are the query details:
I have created an Intermedia index on a table with following specs:
BEGIN
CTX_DDL.DROP_PREFERENCE('CTXSYS.COMPANY_SEARCH_MULTI');
CTX_DDL.CREATE_PREFERENCE('CTXSYS.COMPANY_SEARCH_MULTI', 'MULTI_COLUMN_DATASTORE');
CTX_DDL.SET_ATTRIBUTE( 'CTXSYS.COMPANY_SEARCH_MULTI',
'columns',
'COMPANY,
DESC_N_PRODS,
PROD_DESC_N_PRODS,
PG_TITLE_GLUSR,
PG_KWD_DESC,
GEOGRAPHICAL_PROFILE,
GLUSR_DESC,
SUBCAT_DESC,
CTL_DESC,
SHORT_PROFILE,
LONG_PROFILE');
CTX_DDL.DROP_SECTION_GROUP('CTXSYS.COMPANY_SEARCH_GROUP');
CTX_DDL.CREATE_SECTION_GROUP('CTXSYS.COMPANY_SEARCH_GROUP', 'BASIC_SECTION_GROUP');
CTX_DDL.ADD_FIELD_SECTION('CTXSYS.COMPANY_SEARCH_GROUP' , 'F1', 'COMPANY');
CTX_DDL.ADD_FIELD_SECTION('CTXSYS.COMPANY_SEARCH_GROUP' , 'F2', 'DESC_N_PRODS');
CTX_DDL.ADD_FIELD_SECTION('CTXSYS.COMPANY_SEARCH_GROUP' , 'F3', 'PROD_DESC_N_PRODS');
CTX_DDL.ADD_FIELD_SECTION('CTXSYS.COMPANY_SEARCH_GROUP' , 'F4', 'PG_TITLE_GLUSR');
CTX_DDL.ADD_FIELD_SECTION('CTXSYS.COMPANY_SEARCH_GROUP' , 'F5', 'PG_KWD_DESC');
CTX_DDL.ADD_FIELD_SECTION('CTXSYS.COMPANY_SEARCH_GROUP' , 'F6', 'GEOGRAPHICAL_PROFILE');
CTX_DDL.ADD_FIELD_SECTION('CTXSYS.COMPANY_SEARCH_GROUP' , 'F7', 'GLUSR_DESC');
CTX_DDL.ADD_FIELD_SECTION('CTXSYS.COMPANY_SEARCH_GROUP' , 'F8', 'SUBCAT_DESC');
CTX_DDL.ADD_FIELD_SECTION('CTXSYS.COMPANY_SEARCH_GROUP' , 'F9', 'CTL_DESC');
CTX_DDL.ADD_FIELD_SECTION('CTXSYS.COMPANY_SEARCH_GROUP' , 'F10','SHORT_PROFILE');
CTX_DDL.ADD_FIELD_SECTION('CTXSYS.COMPANY_SEARCH_GROUP' , 'F11','LONG_PROFILE');
CTX_DDL.DROP_PREFERENCE('CTXSYS.IIL_LEXER');
CTX_DDL.CREATE_PREFERENCE('CTXSYS.IIL_LEXER','BASIC_LEXER');
CTX_DDL.SET_ATTRIBUTE('CTXSYS.IIL_LEXER', 'INDEX_STEMS', 'ENGLISH');
CTX_DDL.DROP_PREFERENCE('CTXSYS.IIL_FUZZY_PREF');
CTX_DDL.CREATE_PREFERENCE('CTXSYS.IIL_FUZZY_PREF', 'BASIC_WORDLIST');
CTX_DDL.SET_ATTRIBUTE('CTXSYS.IIL_FUZZY_PREF','FUZZY_MATCH','ENGLISH');
CTX_DDL.SET_ATTRIBUTE('CTXSYS.IIL_FUZZY_PREF','FUZZY_SCORE','60');
CTX_DDL.SET_ATTRIBUTE('CTXSYS.IIL_FUZZY_PREF','FUZZY_NUMRESULTS','100');
CTX_DDL.SET_ATTRIBUTE('CTXSYS.IIL_FUZZY_PREF','SUBSTRING_INDEX','TRUE');
CTX_DDL.SET_ATTRIBUTE('CTXSYS.IIL_FUZZY_PREF','PREFIX_INDEX','TRUE');
CTX_DDL.SET_ATTRIBUTE('CTXSYS.IIL_FUZZY_PREF','PREFIX_MIN_LENGTH','1');
CTX_DDL.SET_ATTRIBUTE('CTXSYS.IIL_FUZZY_PREF','PREFIX_MAX_LENGTH','3');
CTX_DDL.SET_ATTRIBUTE('CTXSYS.IIL_FUZZY_PREF','WILDCARD_MAXTERMS','15000');
CTX_DDL.SET_ATTRIBUTE('CTXSYS.IIL_FUZZY_PREF','STEMMER','ENGLISH');
END;
CREATE INDEX COMPANY_SEARCH_IM on COMPANY_SEARCH(DUMMY) INDEXTYPE IS
CTXSYS.CONTEXT PARAMETERS
('DATASTORE CTXSYS.COMPANY_SEARCH_MULTI SECTION GROUP CTXSYS.COMPANY_SEARCH_GROUP MEMORY 50M
LEXER CTXSYS.IIL_LEXER WORDLIST CTXSYS.IIL_FUZZY_PREF STOPLIST CTXSYS.IIL_STOPLIST');
Now if I want to search for a string - acrylic crochet
My progressive clause is as follows:
<QUERY>
<TEXTQUERY>
<PROGRESSION>
<SEQ>(acrylic crochet) within F2</SEQ>
<SEQ>($acrylic $crochet) within F2</SEQ>
<SEQ>(acrylic crochet) within F3</SEQ>
<SEQ>($acrylic $crochet) within F3</SEQ>
<SEQ>(NEAR((acrylic,crochet))) within F2</SEQ>
</PROGRESSION>
</TEXTQUERY>
</QUERY>
The data set has a record where F2 Contains following text:
Manufacturers and exporters of yarns like acrylic yarn, viscose yarns, acrylic blended yarn, acrylic knitting yarn, spun yarn, blended yarns, braided thread, chenille yarn, cotton yarn, crochet yarn, dupion silk yarns etc
My problem is that - This record is not coming in the search result.
The record starts appearing if I use only NEAR Clause. as shown below:
<QUERY>
<TEXTQUERY>
<PROGRESSION>
<SEQ>(NEAR((acrylic,crochet))) within F2</SEQ>
</PROGRESSION>
</TEXTQUERY>
</QUERY>
Please advise what could be wrong - is my Index proper, or my progressive clause has some problem or there is something else which I have totally missed.
Regards
MadhupThe discussion in the link below contains the same bug that you have encoutered and some workarounds.
Re: progressive relaxation doesn't progress -
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.
-
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 -
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 -
MDX Formula - Not Getting the Desired Results
Hi All,
I have the following formula that I am using to calculate the "Average Daily Volume MTD" but if I drilldown into the Products dimension then I don't see any values. It seems like it's only calculating the values at the top level (GEN1).
CASE
WHEN
IsLevel ([Time Periods].CurrentMember, 0)
THEN
Sum(CrossJoin({[Trade Quantity]},{FirstChild(Parent([Time Periods].CurrentMember)):([Time Periods].CurrentMember)}))
Sum(CrossJoin({[Trade Days Input]},{FirstChild(Parent([Time Periods].CurrentMember)):([Time Periods].CurrentMember)}))
WHEN
(IsLevel ([Time Periods].CurrentMember, 1))
THEN
[Trade Quantity] / ([Measures].[Trade Days Input])
ELSE
Missing
END
I tried to insert the another condition in the WHEN clause,
AND IsAncestor([Products], [Products].Dimension.CurrentMember, INCLUDEMEMBER)
but it still doesn't give me any values.
Can anyone please help me out here?
ThanksHi Dighe,
Thanks , I have tried that , but its not working.
What is happening that , with every setting system is unable to filter batch .
For each material it selects all the batches in query2 .
If I try to jump from batch1 still it displays all the batches.
If I use only the Batch in the assignment it dispalys all the rows of the query so its evident that there is no filter applied at the batch level , I tried all the combination , single value , P , E , Infoobject etc. But it remains same.
Any guess???
Thanks. -
How to define the Market Sales KF, in order to receive the desired result
Hi all,
I dont know how to define the Market Sales Kefigure, in order to get the following result. Any hint is more than welcome.
Prd_ID = Product ID
PS = Product Sales
M_ID = Market ID
MS = Market Sales
MS% = Market Share ( formula in BEX PS/MS)
<b>
Prd_ID;PS;M_ID;MS;MS%</b>
A00001;10;MRK1;100;10%
A00002;20;MRK1;100;20%
<b>SBTOT</b>;30;MRK1;100;30%
B00001;40;MRK2;200;20%
B00002;30;MRK2;200;15%
<b>SBTOT</b>;70;MRK2;200;35%
<b>GTOTL</b>;100;MRKX;300;33,3%
Products A00001 and A00002 compete in the same market. So the individual marketshares should be calculated against the market MRK1(200), e.g. 40/200 and 30/200.
The totals now, of the A00001 and A00002 products(3040) should be compared against <b>the same market</b> MRK1(200),</b> and <b>not against</b> the MRK1MRK1(200+200).
Thanks
Vasso Siagri<b></b><b></b><b></b>Maik,
thank you for your answer, but I am afraid this is not giving the desired results.
What I want----
>What am getting
Prd_ID;PS;M_ID;MS;MS%
A00001;10;MRK1;100;10% ---> 10;MRK1;200;5%
A00002;20;MRK1;100;20% ---> 20;MRK1;200;10%
SBTOT;30;MRK1;100;30% ---> 30;MRK1;200;15%
B00001;40;MRK2;200;20% ---> 40;MRK2;400;10%
B00002;30;MRK2;200;15% ---> 30;MRK2;400;7,5%
SBTOT;70;MRK2;200;35% ---> 70;MRK2;400;17,5%
GTOTL;100;MRKX;300;33,3% ---> 1000;MRKX;600;16,7%
Neither resticted KF restricted on Market ID is working for many markets; it is working only if you analyze one market id.
Any idea? bw idea? What actually I need is aggregation of unique records in terms on market id. -
Report is not fetching the data from Aggregate..
Hi All,
I am facing the problem in aggregates..
For example when i am running the report using Tcode RSRT2, the BW report is not fetching the data from Aggregates.. instead going into the aggregate it is scanning whole cube Data....
FYI.. Checked the characteristcis is exactely matching with aggregates..
and also it is giving the message as:
<b>Characteristic 0G_CWWPTY is compressed but is not in the aggregate/query</b>
Can some body explain me about this error message.. pls let me know solution asap..
Thankyou in advance.
With regards,
HariHi
Deactivate the aggregates and then rebuild the indexes and then activate the aggregates again.
GTR -
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 -
Hello,
Could someone help me please ?
I have a listing of my sales orders and I want to make changes in my order by opening the form and fetched with that record. When I click on that particular orderno in my listing of order and call the form to display the details, it calls the form but says "Query could not fetch the record". I do not know why ? Please help me with the solution.
ThanxHello,
I think you are passing orderno to called form as a parameter. If you are using parameter list check..
1. If parameter data is getting in form correctly ?
2. Next, have you changed where clause of other block,so that is will display record with passed orderno ?
I am expecting more details from you.
Thanx
Adi -
RSBBS jump query not fetching the document no in R3
Dear Gurus
With RSBBS transcation jump is given to R3 tansaction FB03. When query is executed and with right click go to option and with display document (FB03) its fetching the document no in DEVELOPMENT server . But when the query is transported to Production its not fetching the document no.
Kindly do the needful at the earliest
Regards,
R.SatishHi
You said it is not fetching the doc no. Is it failing and showing some error?
Have all the pre-requisite settings been done via Tcode SICF.
Regards
Nageswara -
Hi,
We migrate a DSEE instance from 6.3.1 to 11.1.1.7.1 but now we encounter random errors with some scripts we used on the 6.3.1 instance
For instance when we try to disable a replication agreement :
Unable to bind securely on "myHost:51389".
"myHost:51389" and "dsconf" could not negotiate the desired level of security.
Details: Received fatal alert: bad_record_mac
The "disable-repl-agmt" operation failed on "myHost:51389".
Or when we list the replication agreements :
Unable to bind securely on "localhost:51389".
"localhost:51389" and "dsconf" could not negotiate the desired level of security.
Details: Received fatal alert: bad_record_mac
The "list-repl-agmts" operation failed on "localhost:51389".
Those scripts are launched in a once a day and they fail randomly.
Il we launch the command mannually we do not encounter the problem.
So the questions are :
- why do we have those random errors? what is the root cause? (certificate problem?)
- On the forum, I have found that we can use -e option or set the $DIRSERV_UNSECURED variable (see : https://community.oracle.com/thread/2282940?tstart=0)
=> Is it THE solution?
Regards,
GillesHi.
This looks like a known issue that occurs on Solaris platform. See known DS bug in 14467092 in the release note:Directory Server Bugs Fixed and Known Problems - 11g Release 1 (11.1.1.7.0)
Regards,
Carole. -
Invoice hold workflow is not fetching the approver from ame
Hi,
I'm trying to get the next approver(3rd level) in wf process from ame through profile option, but it's not fetching the approver.
my query is
SELECT persion_id||employee_id
FROM fnd_user
WHERE employee_id = fnd_profile.VALUE('MG_AP09_PAYABLES_SUPERVISOR')
other two level approvers (level1 and level 2)I'm getting , which is not through profile but direct join of tables as given below
SELECT 'person_id:'|| rcv.EMPLOYEE_ID
FROM ap_holds_all aph
,po_distributions_all pd
,rcv_transactions rcv
WHERE pd.line_location_id = aph.line_location_id
AND pd.PO_DISTRIBUTION_ID= rcv.PO_DISTRIBUTION_ID
AND aph.hold_id = :transactionId
AND transaction_type = 'DELIVER'
SELECT 'person_id:'|| HR2.attribute2
from ap_holds_all AH
,po_line_locations_all PLL
,hr_locations_all HR1
,hr_locations_all HR2
where pll.line_location_id = AH.line_location_id
AND pll.ship_to_location_id = HR1.location_id
AND nvl(HR1.attribute1,HR1.location_id) = HR2.location_id
AND AH.hold_id = :transactionId
what may be the issue?Hi Surjith,
Please look at the code I have written in the user exit, which is just for testing purpose. In SPRO I set workflow as 9 for all the release codes.
IF i_eban-werks = '1000'.
actor_tab-otype = 'US'.
actor_tab-objid = 'S_RITESH'.
APPEND actor_tab.
CLEAR actor_tab.
ENDIF.
In PR I am getting the user name in processor coloumn correctly.
please let me know if I am going wrong.
Thank you.
Maybe you are looking for
-
Cisco ASA 5505 not able to access flash
Hi All: I have searched and searched all over the net for an answer to this question and have decided to just post it. I have a 5505 that was given to me by my job to use for working on my CCNA Sec. cert and did the following: I plugged it in and boo
-
How to display 'Bold format' header in classical report? Is there any functional module for formatting normal text? Edited by: Amrita Mane on Jun 11, 2009 9:31 AM
-
In a table 'Video' there is a field 'Video' with SYSORD.ORDVIDEO datatype. using data control , I drag and drop VideoView1 to a jsp page . Then I replace value element with render value element to desplay the video. So the code is : <adf:render model
-
Invalid date/time value error
I downloaded a trial version of Acrobat XI Pro when I try to save or edit and resave a document I get 'invalid date/time value', error. I presume it's set for the US and not the UK, can you tell me where I can change the date/time format? I'm runnin
-
Autorization not validated for Transaction S_aut10
Hi Everyone, We have a concen to restrict the Report S_Aut10 by transaction code used in selection, but system is not giving any stop message but letting using execute the report and brings in the records based on selection. screen shot of Autorizati