Correct my query.
Hi gurus,
I am in need of correction of my query to get the correct output.
The table structure and data is as follows:
create table sample_pid (
pid char(1),
asof date,
edf number
select * from table sample_pid;
PID ASOF EDF
A 29/08/2011 0.1
A 31/07/2011 0.2
B 21/08/2011 0.3
B 31/07/2011 0.4
C 31/07/2011 0.5
D 15/07/2011 0.6
D 30/06/2011 0.7
I have to make a list of PIDs with date sysdate-1.If there are no records for sysdate-1, then get the previous month's records with date between the last seven days of the month.If there are both sysdate-1 and date between the last seven days of the month records available for a PID, then the sysdate-1 record should only be selected.
The output should be:
PID ASOF EDF
A 29/08/2011 0.1
B 31/07/2011 0.4
C 31/07/2011 0.5
As per the requirement, B 21/08/2011 is not selected because it is neither sysdate-1 nor a date between last seven days of the previous month.
Likewise D has not been selected since both the dates of D are neither sysdate-1 nor a date between last seven days of the previous month.
I have written a sql but the result set is wrong.I mean i am not getting the desired output.
select pid, asof, edf
from sample_eid
where
*1=case when asof=to_date('30/08/2011', 'dd/mm/yyyy') - 1 then 1*
when asof between last_day(add_months(to_date('30/08/2011', 'dd/mm/yyyy') - 1, -1)) - 6 and
last_day(add_months(to_date('30/08/2011', 'dd/mm/yyyy') - 1, -1)) then 1 end;
I get as follows which is wrong:
PID ASOF EDF
A 29/08/2011 0.1
A 31/07/2011 0.2
B 31/07/2011 0.4
C 31/07/2011 0.5
Can anyone help me in this?
Thanks in advance.
Edited by: mythili varada on Sep 6, 2011 11:13 AM
is this what you are looking for ?
SELECT *
FROM (SELECT pid, asof, edf,
ROW_NUMBER () OVER (PARTITION BY pid ORDER BY asof DESC) rn
FROM sample_pid
WHERE 1 =
CASE
WHEN asof = TO_DATE ('30/08/2011', 'dd/mm/yyyy') - 1
THEN 1
WHEN asof
BETWEEN LAST_DAY
(ADD_MONTHS ( TO_DATE ('30/08/2011',
'dd/mm/yyyy'
- 1,
-1
- 6
AND LAST_DAY
(ADD_MONTHS ( TO_DATE ('30/08/2011',
'dd/mm/yyyy'
- 1,
-1
THEN 1
END)
WHERE rn = 1
Similar Messages
-
How do I correct this query ?
here is a query:
select roleid from Apps_USERROLE where guid in (select guid from Apps_USER_MASTER order by userid)
This does not work ...because the internal subquery retruns multiple result.
How do I correct this query ?Satish Kandi wrote:
select roleid from Apps_USERROLE where guid in (select guid from Apps_USER_MASTER order by userid)ORDER BY clause is not supported in subqueries since it makes no sense.
If you want an ordered result set, you need add order by clause to the main query.
select roleid from Apps_USERROLE where guid in (select guid from Apps_USER_MASTER)
order by roleid;
HTH...we have a problem then . Apps_USER_MASTER has userid as primary key .
select guid from Apps_USER_MASTER => this could give duplicate guid then . -
iam trying to take input at the prompt in one statement only...
but unable to do it..
so plz correct my query
accept var prompt "enter deptno=>" select * from emp where deptno=&var;
error:
SQL> accept var prompt "enter deptno=>" select * from emp where deptno=&var;
Enter value for var: 20
SP2-0003: Ill-formed ACCEPT command starting as select * from emp where deptno=2
0
SQL>
thank u
rajivThese are two statements you need to exceute separately
SQL> accept var prompt "enter deptno=>"
enter deptno=>10
SQL> select * from emp where deptno=&var;
old 1: select * from emp where deptno=&var
new 1: select * from emp where deptno=10
EMPNO ENAME JOB MGR HIREDATE SAL COMM
DEPTNO
7782 CLARK MANAGER 7839 09-JUN-81 2450
10
7839 KING PRESIDENT 17-NOV-81 5000
10
7934 MILLER CLERK 7782 23-JAN-82 1300
10
SQL> -
Can you pls correct this query :: ( In Oracle Core HRMS )
Dear all,
i have created query get result :: ( In Oracle Core HRMS )
• EE Number
• Forename
• Surname
• Dept
• Start Date
• Leave Date
• Date of Birth
• Address
• Salary (New & Existing Employee)
• Car Allowance
• Effective date (changes/updates)
• Creation Date/Update date
• Email address
• Gender
• Job Description
• Grade
• From and to date for parametres
• Last Modified Date
SELECT
papf.EMPLOYEE_NUMBER emp_no
, papf.FIRST_NAME forname
, papf.LAST_NAME surname
, replace(replace(hou.attribute1,'10-',''), '14-', '') department
, pps.date_start strt_date
, pps.actual_termination_date leave_date
, papf.DATE_OF_BIRTH dob
, pdd.ADDRESS_LINE1||''||pdd.ADDRESS_LINE2||','||pdd.ADDRESS_LINE3 Address
, ppp.proposed_salary_n salary
, papf.EFFECTIVE_START_DATE estart_date
, papf.EFFECTIVE_END_DATE eend_date
, papf.CREATION_DATE crt_date
, papf.EMAIL_ADDRESS mail_addrs
, papf.SEX GENDER
, pj.NAME Job_Des
, substr(pg.name, 1, 1) GRADE
, papf.LAST_UPDATE_DATE Last_Modified_Date
FROM per_all_people_f papf
, per_all_assignments_f paaf
, per_addresses pdd
, per_pay_proposals ppp
, per_grades pg
, pay_payrolls_f pp
, per_jobs pj
, per_periods_of_service pps
, per_person_types ppt
, per_person_type_usages_f pptu
-- , pay_element_entries_f pee
, hr_organization_units hou
WHERE papf.person_id = paaf.person_id
AND papf.person_id = pdd.person_id
AND papf.person_id = pptu.person_id
and papf.person_id = pps.person_id
and pps.period_of_service_id = paaf.period_of_service_id
AND ppp.assignment_id = paaf.assignment_id
-- AND pee.assignment_id = paaf.assignment_id
AND paaf.grade_id = pg.grade_id
AND paaf.payroll_id = pp.payroll_id
AND pptu.person_type_id = ppt.person_type_id
AND paaf.organization_id = hou.organization_id
AND pj.job_id = paaf.job_id
AND ppp.pay_proposal_id = (SELECT MAX (pay_proposal_id)
FROM per_pay_proposals
WHERE assignment_id = paaf.assignment_id)
AND pp.payroll_id = 224
AND pdd.primary_flag = 'Y'
AND pee.element_type_id = 221 for car allowance
AND papf.employee_number <> 'NONE'
AND ppt.user_person_type in ('Employee', 'Ex-employee' ,'Intern')
AND ppt.system_person_type in ('EX_EMP', 'EMP')
AND TRUNC(SYSDATE) between papf.effective_start_date and papf.effective_end_date
AND TRUNC(SYSDATE) between paaf.effective_start_date and paaf.effective_end_date
AND TRUNC(SYSDATE) between pptu.effective_start_date and pptu.effective_end_date ;
can you pls correct this
still i need to add Car Allowance and Bank details in above query pls tell me where i can get dept details in oracle core HR
Thanks all
Edited by: 981527 on Jan 30, 2013 3:41 AM
Edited by: 981527 on Jan 31, 2013 1:22 AM
Edited by: 981527 on Jan 31, 2013 1:30 AM
Edited by: 981527 on Jan 31, 2013 9:03 PM
Edited by: 981527 on Feb 1, 2013 4:50 AMI am taking a guess that 'Dept' is where the employee works, so that will be the column 'NAME' in the table HR_ALL_ORGANIZATION_UNITS; you will need to join with this table on the assignment's organization_id value
Edited to add: Whilst you're testing this, you might want to consider removing the table PAY_ELEMENT_ENTRIES_F from the table list, otherwise you can look forward to potentially large cartesian product of returned rows!
Clive
Edited by: clive_t on 31-Jan-2013 09:59 -
Accent insensitive Search - plz help me correcting this query
Hello,
I just realized that with that query, if I search for "Montreal" (without the accent), I have all the following results, which is what I want
SELECT
"ID","TIT"
from "REGDOSSIERS" "RDO"
where
TRANSLATE(UPPER("TIT"),'ÀÂÉÈÊÎÔÛÙÜ','AAEEEIOUUU')
like upper(nvl(replace('%' || "P1_REPORT_SEARCH || '%',' ','%'),"TIT"))
RESULTS
TIT
Annuaires Lovell (Montréal et banlieue)
Juridiction royale de Montréal. Dossiers, 1677-1769
Montreal Witness, 1845-1938
{code}
But how to change it so when I look for: "Montréal" (with the accent) , I have also the same results? Right now, with Montréal, I have nothing
thanks,
Roseline
Edited by: Roseline on 2009-10-01 18:58
Edited by: Roseline on Oct 1, 2009 7:34 PMIf you are on Oracle 10g you can use regexp expressions to do the search.
Example
with testdata as (select 'Montreal' txt from dual
union all select 'Montréal' txt from dual
union all select 'Montreâl' txt from dual
union all select 'Montreaux' txt from dual)
/* end of test data creation */
select txt from testdata
where regexp_like (txt, 'Montr[[=e=]]al');
txt
Montreal
Montréal[[=e=]] would be an equivalence class for the letter "e" and includes also searches for é, è, ê etc.
The best solution mainly depends how your search string is build.
If you just want to sort, then the nlssort function would be useful.
Mentioning Nlssort I remembered there is a much better way to implement Accent insensitive search. You just need to set your NLS_SORT parameter correctly. Either to BINARY_AI (the AI means accent and case insensitiv) or add _AI to your nls langage.
example
ALTER SESSION SET NLS_COMP=LINGUISTIC;
alter session set nls_sort = 'FRENCH';
with testdata as (select 'Montreal' txt from dual
union all select 'Montréal' txt from dual
union all select 'Montreâl' txt from dual
union all select 'Montreaux' txt from dual)
/* end of test data creation */
select txt from testdata
where txt = 'MONTREAL';
no rows selects
/* now change the nls sorting */
alter session set nls_sort = 'FRENCH_AI';
with testdata as (select 'Montreal' txt from dual
union all select 'Montréal' txt from dual
union all select 'Montreâl' txt from dual
union all select 'Montreaux' txt from dual)
/* end of test data creation */
select txt from testdata
where txt = 'MONTREAL';
txt
Montreal
Montréal
MontreâlEdited by: Sven W. on Oct 2, 2009 8:34 AM
Edited by: Sven W. on Oct 2, 2009 10:22 AM - corrected misleading regexp example. -
Hi,
I am getting different output. could anybody please suggest me what is the difference between below two query and correct the 2nd query
SELECT
COUNT(DISTINCT CASE WHEN B.LSDT >= SYSDATE - 45 AND A.COUNTRY_CD='IN' THEN B.INDIVIDUAL_ID END) AS US_45
,COUNT(DISTINCT CASE WHEN B.LSDT >= SYSDATE - 105 AND A.COUNTRY_CD='IN' THEN B.INDIVIDUAL_ID END) AS US_105
,COUNT(DISTINCT CASE WHEN B.LSDT >= SYSDATE - 195 AND A.COUNTRY_CD='IN' THEN B.INDIVIDUAL_ID END) AS US_195
,COUNT(DISTINCT CASE WHEN B.LSDT >= SYSDATE - 380 AND A.COUNTRY_CD='IN' THEN B.INDIVIDUAL_ID END) AS US_380
,COUNT(DISTINCT CASE WHEN B.LSDT >= SYSDATE - 745 AND A.COUNTRY_CD='IN' THEN B.INDIVIDUAL_ID END) AS US_745
FROM order B, addr A
WHERE B.INDIVIDUAL_ID = A.INDIVIDUAL_ID
AND B.INDIVIDUAL_ID IN (
SELECT C.INDIVIDUAL_ID
FROM order C
WHERE C.PROD_STAT_MKE_CD IN ('A', 'B')
AND C.LAST_PAYMENT_DT >= SYSDATE - 745)
AND A.COUNTRY_CD ='IN';
SELECT
COUNT(DISTINCT CASE WHEN B.LSDT >= SYSDATE - 45 AND A.COUNTRY_CD='IN' THEN B.INDIVIDUAL_ID END) AS US_45
,COUNT(DISTINCT CASE WHEN B.LSDT >= SYSDATE - 105 AND A.COUNTRY_CD='IN' THEN B.INDIVIDUAL_ID END) AS US_105
,COUNT(DISTINCT CASE WHEN B.LSDT >= SYSDATE - 195 AND A.COUNTRY_CD='IN' THEN B.INDIVIDUAL_ID END) AS US_195
,COUNT(DISTINCT CASE WHEN B.LSDT >= SYSDATE - 380 AND A.COUNTRY_CD='IN' THEN B.INDIVIDUAL_ID END) AS US_380
,COUNT(DISTINCT CASE WHEN B.LSDT >= SYSDATE - 745 AND A.COUNTRY_CD='IN' THEN B.INDIVIDUAL_ID END) AS US_745
FROM order B, addr A
WHERE B.INDIVIDUAL_ID = A.INDIVIDUAL_ID and A.COUNTRY_CD ='IN'
and (PROD_STAT_MKE_CD IN ('A', 'B') AND LAST_PAYMENT_DT >= SYSDATE - 745);The two queries are asking quite different questions.
The first looks for all individuals who have a country code of IN and also have a row in the order table (possibly even a different one with prod_stat_mke_cd either A or B and a last_payment_dt sometime in the last 745 days.
The second, looks for a row where the country code is IN and prod_stat_mke_cd is either A or B and has a last_payment_dt sometime in the last 745 days.
So, given these three rows:
individual_id country_code prod_stat_mke_cd last_payment_dt
12345 IN C 01-Jan-2011
12345 IN A 01-Jan-2011
12345 IN B 01-Jan-2011your first query will return the all three, while your second query will only return the last two rows.
What exactly are you expecting?
John -
Hi,
I have below query:
select u.v_um_code,v_um_name,count(f.v_fc_code), count(s.n_sl_no), count(distinct s.n_agent_no)
from subm_buss_um_master u,subm_buss_fc_master f,submitted_business_raw s
where u.v_um_code=f.v_um_code and f.v_fc_code=s.n_agent_no
and f.v_status='A' and u.v_status='A'
and trunc(d_submitted) between '01-JUL-2004' AND '31-JUL-2004'
group by u.v_um_code,v_um_name;
the output should be such that first all the records should be fetched from subm_buss_um_master table (where u.v_status='A')--> then count(f.v_fc_code) then -->count(s.n_sl_no), count(distinct s.n_agent_no)
the data/columns in these tables is large, I cannot paste here.
Thanks in advance
Tariq.Hi,
If SET operator UNION helps then great!!!
For example: As per my requirement, first all employees and sum of salary.....is the query.
SELECT ename, sal FROM emp
UNION
SELECT 'Grand Total ', SUM(sal) FROM emp
ORDER BY sal;
Regards,
Sailaja -
Help with Correcting the Query
Hi Gurus,
Could someone let me know if this query is right? When i am building a report i am getting an error that
Incorrectly defined logical table source (for fact table MTL_DESCR_ELEMENT_VALUES) does not contain mapping for [IBE_MSITES_B.ATTRIBUTE10]. (HY000)
Incorrectly defined logical table source (for fact table MTL_SYSTEM_ITEMS_FVL) does not contain mapping for [MTL_DESCR_ELEMENT_VALUES.ELEMENT_VALUE].
from inv.mtl_system_items_b mtlb,
inv.mtl_descr_element_values mtld,
apps.mtl_item_Caterogies_v cat,
apps.mtl_system_items_fvl fvl,
ibe.ibe_msites_b imb,
ibe.ibe_dsp_section_items idsi,
ibe.ibe_dsp_msite_sct_items idmsi
where mtlb.inventory_item_id = mtld.inventory_item_id
AND cat.inventory_item_id = mtlb.inventory_item_id
AND mtlb.inventory_item_id = fvl.inventory_item_id
AND mtlb.inventory_item_id = idsi.inventory_item_id
AND idsi.section_item_id = idmsi.section_item_id
AND imb.msite_id = idmsi.mini_site_id
RegardsHi,
792011 wrote:
Hi Gurus,
Could someone let me know if this query is right? When i am building a report i am getting an error that I'm not sure what you mean by "right". If you're getting an error, doesn't that mean that it's not right?
Incorrectly defined logical table source (for fact table MTL_DESCR_ELEMENT_VALUES) does not contain mapping for [IBE_MSITES_B.ATTRIBUTE10]. (HY000)
Incorrectly defined logical table source (for fact table MTL_SYSTEM_ITEMS_FVL) does not contain mapping for [MTL_DESCR_ELEMENT_VALUES.ELEMENT_VALUE].Are those the exact error messages you're getting? What version of Oracle, and what tool, are producing them?
from inv.mtl_system_items_b mtlb,
inv.mtl_descr_element_values mtld,
apps.mtl_item_Caterogies_v cat,
apps.mtl_system_items_fvl fvl,
ibe.ibe_msites_b imb,
ibe.ibe_dsp_section_items idsi,
ibe.ibe_dsp_msite_sct_items idmsi
where mtlb.inventory_item_id = mtld.inventory_item_id
AND cat.inventory_item_id = mtlb.inventory_item_id
AND mtlb.inventory_item_id = fvl.inventory_item_id
AND mtlb.inventory_item_id = idsi.inventory_item_id
AND idsi.section_item_id = idmsi.section_item_id
AND imb.msite_id = idmsi.mini_site_idEvery query must have a SELECT clause.
I don't see any other obvious errors in what you posted, though, without the CREATE TABLE statments, there's no way I could see much besides syntax errors. Reading unformatted code is very difficult, however, so I may have missed siomething. Never write, let alone post, unformatted code.
See the following thread for how to pinpoint errors by taking baby steps:
What is wrong with my SQL Keeps Errroring out I cannot see where! HELP -
PL/SQL body function body returning not correct SQL query
Hello,
Please help!
There are 2 select lists (gender and ethnicity) on the page.
When user selects only from one select list or not selects anything - query works fine.
But if user selects for example: male and white - no data found
This is a code under Region Source:
declare
v_sql varchar2(2000);
BEGIN
v_sql:= 'select subject_id,ethnicity,sex from clinical_demo_v
where 1 = 1';
IF :P12_RACE != '%null%' THEN
v_sql := v_sql ||' and ethnicity = '||'''||:P12_RACE||''';
ELSE v_sql := v_sql;
END IF;
IF :P12_SEX != '%null%' THEN
v_sql := v_sql ||' and sex = '||'''||:P12_SEX||''';
ELSE v_sql := v_sql;
END IF;
return v_sql;
end;
Thank you in advance!Try this:
BEGIN
v_sql :=
'SELECT subject_id, ethnicity, sex FROM clinical_demo_v
where 1 = 1';
IF :p12_race != '%null%'
THEN
v_sql := v_sql || ' and ethnicity = ' || :p12_race;
ELSE
v_sql := v_sql;
END IF;
IF :p12_sex != '%null%'
THEN
v_sql := v_sql || ' and sex = ' || :p12_sex;
ELSE
v_sql := v_sql;
END IF;
RETURN v_sql;
END;Denes Kubicek
http://deneskubicek.blogspot.com/
http://htmldb.oracle.com/pls/otn/f?p=31517:1
------------------------------------------------------------------- -
Correction in query using rank
Hi All,
I have a sample table as below:
CREATE TABLE sample_obj (appno VARCHAR2(10),universe VARCHAR2(100),rank_univers NUMBER,country VARCHAR2(100),industrie VARCHAR2(10));
insert into sample_obj (APPNO, UNIVERSE, RANK_UNIVERS, COUNTRY, INDUSTRIE)
values ('E001', 'RE', 1, 'US', 'PS');
insert into sample_obj (APPNO, UNIVERSE, RANK_UNIVERS, COUNTRY, INDUSTRIE)
values ('E002', 'RM', 2, '', 'PD');
I have written the following query which orders the recods by rank_univers
SELECT country,
industrie,
rank() over(ORDER BY rank_univers) rank_univ
FROM sample_obj;
Result set :
COUNTRY INDUSTRIE RANK_UNIV
US PS 1
PD 2
I need the result set to have only the record that has non null values of COUNTRY and INDUSTRIE. Here above, I need only US,PS,1 record.
If for both the records, either all the values for COUNTRY and INDUSTRIE are either null or not null, then i should get records as per the rank_univ.
CASE 1:
If the records both have COUNTRY AND INDUSTRI not null then I should get only
RANK_UNIV=1 record.
CASE 2:
If for any of the records either COUNTRY or INDUSTRIE is null , then record that has the not null value has to be chosen.
Can anyone help me out?
ThanksHaving re-read your question I think I now understand (it was a little cryptic to understand :-) ).
If both country and industrie are not null, that have high priority.
If country is not null and industrie is null, that have medium priority.
If country is null and industrie is not null, that have medium priority.
If both country and industrie are null, that have low priority.
That can also be included in the CASE logic:
SELECT
country,
industrie,
rank() over(
ORDER BY
case
when country is not null and industrie is not null then 1
when country is not null and industrie is null then 2
when country is null and industrie is not null then 2
else 3
end,
rank_univers
) rank_univ
FROM sample_obj;The CASE statement gives a priority for the ranking.
Then if there are more than one record with same priority, they are ordered by rank_univers.
Using such a method you can express practically any ranking/ordering logic in your order by clause. -
I want to update the news_date from Apr to May
update news set news_date=to_char(news_date,'dd-May-yy HH:MI:SS AM')
where to_char(news_date,'dd-Mon-yy HH:MI:SS AM')=to_char(news_date,'dd-Apr-yy HH:MI:SS AM')
/Sorry, the page expired error was appeared and resubmitted thats why.I've got the same phenomenon from time to time...
Nicolas. -
Query Correction and Guidance Needed
Dear Experts
I am adding a query I have developed from three tables ORCT, RCT1 and JDT1. I wanted to get the reconciliation report for Bank Statement. ORCT is used to get the BP Name, RCT1 for check number and JDT1 to get the Debit and Credit fields. I have been successful only to out that transation for Cash are missing can you please correct the query if possible and guide me where I went wrong I will be greatly obliged. Below is the query
SELECT '1Icoming - Reconciled' as grp, T2.RefDate, T1.CheckNum, T0.CardName,
T2.Debit, T2.Credit
FROM ORCT T0, RCT1 T1, JDT1 T2
WHERE (T0.DocEntry = T1.DocNum AND
T0.TransId = T2.TransId AND
T2.Line_ID = T1.LineID) AND
T2.Account IN ('_SYS00000004973') AND
T2.ExtrMatch IN (1,2,3,4,5,6) AND
T2.RefDate BETWEEN '04-30-2010' AND {?To}Hi Faisal,
Try this query:
SELECT '1Icoming - Reconciled' as grp, T2.RefDate, T1.CheckNum,T0.[CheckSum] , T0.CardName, T0.CashSum ,T0.CashAcct,
T2.Debit, T2.Credit
FROM ORCT T0, RCT1 T1, JDT1 T2
WHERE (T0.DocEntry = T1.DocNum AND
T0.TransId = T2.TransId AND
T2.Line_ID = T1.LineID) AND
T2.Account IN ('_SYS00000004973') AND
T2.ExtrMatch IN (1,2,3,4,5,6) AND
(T2.RefDate >= [%1] and T2.RefDate <= [%2])
Thanks,
Neetu -
Hi all
I want to fetch just twenty thousands records from table. My query take more time to fetch twenty thousands records. I post my working query, Could you correct the query for me. thanks in advance.
Query
select
b.Concatenated_account Account,
b.Account_description description,
SUM(case when(Bl.ACTUAL_FLAG='B') then
((NVL(Bl.PERIOD_NET_DR, 0)- NVL(Bl.PERIOD_NET_CR, 0)) + (NVL(Bl.PROJECT_TO_DATE_DR, 0)- NVL(Bl.PROJECT_TO_DATE_CR, 0)))end) "Budget_2011"
from
gl_balances Bl,
gl_code_combinations GCC,
psb_ws_line_balances_i b ,
gl_budget_versions bv,
gl_budgets_v gv
where
b.CODE_COMBINATION_ID=gcc.CODE_COMBINATION_ID and bl.CODE_COMBINATION_ID=gcc.CODE_COMBINATION_ID and
bl.budget_version_id =bv.BUDGET_VERSION_ID and gv.budget_version_id= bv.budget_version_id
and gv.latest_opened_year in (select latest_opened_year-3 from gl_budgets_v where latest_opened_year=:BUDGET_YEAR )
group by b.Concatenated_account ,b.Account_descriptionHi,
If this question is related to SQL then please post in SQL forum.
Otherwise provide more information how this sql is being used and do you want to tune the SQL or the way it fetches the information from DB and display in OAF.
Regards,
Sandeep M. -
Query with error: ORA-01843: not a valid month
Hi,
I have a problem with a query. I have modified a query that before worked but not now!
The correct original query was:
SELECT rtrim('Cambio di: '
|| (CASE WHEN nvl(A.CODICE_EMITTENTE ,' ') <> nvl(B.CODICE_EMITTENTE ,' ') THEN 'Codice emittente, ' ELSE '' END)
|| (CASE WHEN nvl(A.DESCRIZIONE_TITOLO,' ') <> nvl(B.DESCRIZIONE_TITOLO,' ') THEN 'Descrizione titolo, ' ELSE '' END)
|| (CASE WHEN nvl(A.SOTTOSTANTE,' ') <> nvl(B.SOTTOSTANTE,' ') THEN 'Sottostante, ' ELSE '' END)
|| (CASE WHEN nvl(A.TIPO_SOTTOSTANTE, ' ') <> nvl(B.TIPO_SOTTOSTANTE,' ') THEN 'Tipo sottostante, ' ELSE '' END)
|| (CASE WHEN nvl(A.CEDOLA_LORDA_CORRENTE, 0) <> nvl(B.CEDOLA_LORDA_CORRENTE, 0) THEN 'Cedola lorda corrente, ' ELSE '' END)
|| (CASE WHEN nvl(A.FREQUENZA_CEDOLA, ' ') <> nvl(B.FREQUENZA_CEDOLA, ' ') THEN 'Frequenza cedola, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') <> nvl(B.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') THEN 'Data inizio facoltà call, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') <> nvl(B.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') THEN 'Data fine facoltà call, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') <> nvl(B.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') THEN 'Data inizio facoltà put, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') <> nvl(B.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') THEN 'Data fine facoltà put, ' ELSE '' END)
|| (CASE WHEN nvl(A.AMMONTARE_EMESSO, 0) <> nvl(B.AMMONTARE_EMESSO, 0) THEN 'Ammontare emesso, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_PRIMO_GODIMENTO, '31-Dec-2999') <> nvl(B.DATA_PRIMO_GODIMENTO, '31-Dec-2999') THEN 'Data primo godimento, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_SCADENZA, '31-Dec-2999') <> nvl(B.DATA_SCADENZA, '31-Dec-2999') THEN 'Data scadenza, ' ELSE '' END)
|| (CASE WHEN nvl(A.PRIMO_PREZZO_EMISSIONE, 0) <> nvl(B.PRIMO_PREZZO_EMISSIONE, 0) THEN 'Primo prezzo di emissione, ' ELSE '' END)
|| (CASE WHEN nvl(A.MODALITA_RIMBORSO, 0) <> nvl(B.MODALITA_RIMBORSO, 0) THEN 'Modalità rimborso, ' ELSE '' END)
|| (CASE WHEN nvl(A.SUBORDINAZIONE, ' ') <> nvl(B.SUBORDINAZIONE, ' ') THEN 'Subordinazione, ' ELSE '' END)
|| (CASE WHEN nvl(A.DIV_EMIS_CODE, 0) <> nvl(B.DIV_EMIS_CODE, 0) THEN 'Codice divisa di emissione, ' ELSE '' END)
|| (CASE WHEN nvl(A.DIV_EMIS, ' ') <> nvl(B.DIV_EMIS, ' ') THEN 'Divisa di emissione, ' ELSE '' END)
,', ') TIPO_VARIAZIONE,
A.ISICOD ,
A.CODICE_EMITTENTE AS EMIT_COD_T, B.CODICE_EMITTENTE AS EMIT_COD_T1,
A.DESCRIZIONE_TITOLO AS DESC_TITOLO_T, B.DESCRIZIONE_TITOLO AS DESC_TITOLO_T1,
A.SOTTOSTANTE AS SOTTOSTANTE_T, B.SOTTOSTANTE AS SOTTOSTANTE_T1,
A.TIPO_SOTTOSTANTE AS TIPO_SOTTOSTANTE_T, B.TIPO_SOTTOSTANTE AS TIPO_SOTTOSTANTE_T1,
A.CEDOLA_LORDA_CORRENTE AS CEDOLA_LORDA_CORRENTE_T, B.CEDOLA_LORDA_CORRENTE AS CEDOLA_LORDA_CORRENTE_T1,
A.FREQUENZA_CEDOLA AS FREQUENZA_CEDOLA_T, B.FREQUENZA_CEDOLA AS FREQUENZA_CEDOLA_T1,
A.DATA_INIZIO_FACOLTA_CALL AS DATA_INIZIO_FACOLTA_CALL_T, B.DATA_INIZIO_FACOLTA_CALL AS DATA_INIZIO_FACOLTA_CALL_T1,
A.DATA_FINE_FACOLTA_CALL AS DATA_FINE_FACOLTA_CALL_T, B.DATA_FINE_FACOLTA_CALL AS DATA_FINE_FACOLTA_CALL_T1,
A.DATA_INIZIO_FACOLTA_PUT AS DATA_INIZIO_FACOLTA_PUT_T, B.DATA_INIZIO_FACOLTA_PUT AS DATA_INIZIO_FACOLTA_PUT_T1,
A.DATA_FINE_FACOLTA_PUT AS DATA_FINE_FACOLTA_PUT_T, B.DATA_FINE_FACOLTA_PUT AS DATA_FINE_FACOLTA_PUT_T1,
A.AMMONTARE_EMESSO AS AMMONTARE_EMESSO_T, B.AMMONTARE_EMESSO AS AMMONTARE_EMESSO_T1,
A.DATA_PRIMO_GODIMENTO AS DATA_PRIMO_GODIMENTO_T, B.DATA_PRIMO_GODIMENTO AS DATA_PRIMO_GODIMENTO_T1,
A.DATA_SCADENZA AS DATA_SCADENZA_T, B.DATA_SCADENZA AS DATA_SCADENZA_T1,
A.PRIMO_PREZZO_EMISSIONE AS PRIMO_PREZZO_EMISSIONE_T, B.PRIMO_PREZZO_EMISSIONE AS PRIMO_PREZZO_EMISSIONE_T1,
A.MODALITA_RIMBORSO AS MODALITA_RIMBORSO_T, B.MODALITA_RIMBORSO AS MODALITA_RIMBORSO_T1,
A.SUBORDINAZIONE AS SUBORDINAZIONE_T, B.SUBORDINAZIONE AS SUBORDINAZIONE_T1,
A.DIV_EMIS_CODE AS DIV_EMIS_CODE_T, B.DIV_EMIS_CODE AS DIV_EMIS_CODE_T1,
A.DIV_EMIS AS DIV_EMIS_T, B.DIV_EMIS AS DIV_EMIS_T1,
A.START_DATE AS DATA_AGG_T, B.START_DATE AS DATA_AGG_T1
FROM SPR_KLERS_ISD A, SPR_KLERS_ISD B
WHERE A.START_DATE=TRUNC(SYSDATE)
AND A.ISICOD=B.ISICOD
AND B.START_DATE = decode(trim(to_char(sysdate, 'Day')), 'Monday',trunc(sysdate-3), trunc(sysdate-1))
AND (nvl(A.CODICE_EMITTENTE,' ') != nvl(B.CODICE_EMITTENTE,' ')
OR
nvl(A.DESCRIZIONE_TITOLO,' ') != nvl(B.DESCRIZIONE_TITOLO,' ')
OR
nvl(A.SOTTOSTANTE,' ') != nvl(B.SOTTOSTANTE,' ')
OR
nvl(A.TIPO_SOTTOSTANTE, ' ') != nvl(B.TIPO_SOTTOSTANTE,' ')
OR
nvl(A.CEDOLA_LORDA_CORRENTE, 0) != nvl(B.CEDOLA_LORDA_CORRENTE, 0)
OR
nvl(A.FREQUENZA_CEDOLA, ' ') != nvl(B.FREQUENZA_CEDOLA, ' ')
OR
nvl(A.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') != nvl(B.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999')
OR
nvl(A.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') != nvl(B.DATA_FINE_FACOLTA_CALL, '31-Dec-2999')
OR
nvl(A.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') != nvl(B.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999')
OR
nvl(A.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') != nvl(B.DATA_FINE_FACOLTA_PUT,'31-Dec-2999')
OR
nvl(A.AMMONTARE_EMESSO, 0) != nvl(B.AMMONTARE_EMESSO, 0)
OR
nvl(A.DATA_PRIMO_GODIMENTO, '31-Dec-2999') != nvl(B.DATA_PRIMO_GODIMENTO, '31-Dec-2999')
OR
nvl(A.DATA_SCADENZA, '31-Dec-2999') != nvl(B.DATA_SCADENZA, '31-Dec-2999')
OR
nvl(A.PRIMO_PREZZO_EMISSIONE, 0) != nvl(B.PRIMO_PREZZO_EMISSIONE, 0)
OR
nvl(A.MODALITA_RIMBORSO, 0) != nvl(B.MODALITA_RIMBORSO, 0)
OR
nvl(A.SUBORDINAZIONE, ' ') != nvl(B.SUBORDINAZIONE, ' ')
OR
nvl(A.DIV_EMIS_CODE, 0) != nvl(B.DIV_EMIS_CODE, 0)
OR
nvl(A.DIV_EMIS, ' ') != nvl(B.DIV_EMIS, ' '))The new query that not works is:
SELECT rtrim('Cambio di: '
|| (CASE WHEN nvl(A.CODICE_EMITTENTE ,' ') <> nvl(B.CODICE_EMITTENTE ,' ') THEN 'Codice emittente, ' ELSE '' END)
|| (CASE WHEN nvl(A.DESCRIZIONE_TITOLO,' ') <> nvl(B.DESCRIZIONE_TITOLO,' ') THEN 'Descrizione titolo, ' ELSE '' END)
|| (CASE WHEN nvl(A.SOTTOSTANTE,' ') <> nvl(B.SOTTOSTANTE,' ') THEN 'Sottostante, ' ELSE '' END)
|| (CASE WHEN nvl(A.TIPO_SOTTOSTANTE, ' ') <> nvl(B.TIPO_SOTTOSTANTE,' ') THEN 'Tipo sottostante, ' ELSE '' END)
|| (CASE WHEN nvl(A.CEDOLA_LORDA_CORRENTE, 0) <> nvl(B.CEDOLA_LORDA_CORRENTE, 0) THEN 'Cedola lorda corrente, ' ELSE '' END)
|| (CASE WHEN nvl(A.FREQUENZA_CEDOLA, ' ') <> nvl(B.FREQUENZA_CEDOLA, ' ') THEN 'Frequenza cedola, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') <> nvl(B.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') THEN 'Data inizio facoltà call, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') <> nvl(B.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') THEN 'Data fine facoltà call, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') <> nvl(B.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') THEN 'Data inizio facoltà put, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') <> nvl(B.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') THEN 'Data fine facoltà put, ' ELSE '' END)
|| (CASE WHEN nvl(A.AMMONTARE_EMESSO, 0) <> nvl(B.AMMONTARE_EMESSO, 0) THEN 'Ammontare emesso, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_PRIMO_GODIMENTO, '31-Dec-2999') <> nvl(B.DATA_PRIMO_GODIMENTO, '31-Dec-2999') THEN 'Data primo godimento, ' ELSE '' END)
|| (CASE WHEN nvl(A.DATA_SCADENZA, '31-Dec-2999') <> nvl(B.DATA_SCADENZA, '31-Dec-2999') THEN 'Data scadenza, ' ELSE '' END)
|| (CASE WHEN nvl(A.PRIMO_PREZZO_EMISSIONE, 0) <> nvl(B.PRIMO_PREZZO_EMISSIONE, 0) THEN 'Primo prezzo di emissione, ' ELSE '' END)
|| (CASE WHEN nvl(A.MODALITA_RIMBORSO, 0) <> nvl(B.MODALITA_RIMBORSO, 0) THEN 'Modalità rimborso, ' ELSE '' END)
|| (CASE WHEN nvl(A.SUBORDINAZIONE, ' ') <> nvl(B.SUBORDINAZIONE, ' ') THEN 'Subordinazione, ' ELSE '' END)
|| (CASE WHEN nvl(A.DIV_EMIS_CODE, 0) <> nvl(B.DIV_EMIS_CODE, 0) THEN 'Codice divisa di emissione, ' ELSE '' END)
|| (CASE WHEN nvl(A.DIV_EMIS, ' ') <> nvl(B.DIV_EMIS, ' ') THEN 'Divisa di emissione, ' ELSE '' END)
,', ') TIPO_VARIAZIONE,
A.ISICOD ,
A.CODICE_EMITTENTE AS EMIT_COD_T, B.CODICE_EMITTENTE AS EMIT_COD_T1,
A.DESCRIZIONE_TITOLO AS DESC_TITOLO_T, B.DESCRIZIONE_TITOLO AS DESC_TITOLO_T1,
A.SOTTOSTANTE AS SOTTOSTANTE_T, B.SOTTOSTANTE AS SOTTOSTANTE_T1,
A.TIPO_SOTTOSTANTE AS TIPO_SOTTOSTANTE_T, B.TIPO_SOTTOSTANTE AS TIPO_SOTTOSTANTE_T1,
A.CEDOLA_LORDA_CORRENTE AS CEDOLA_LORDA_CORRENTE_T, B.CEDOLA_LORDA_CORRENTE AS CEDOLA_LORDA_CORRENTE_T1,
A.FREQUENZA_CEDOLA AS FREQUENZA_CEDOLA_T, B.FREQUENZA_CEDOLA AS FREQUENZA_CEDOLA_T1,
A.DATA_INIZIO_FACOLTA_CALL AS DATA_INIZIO_FACOLTA_CALL_T, B.DATA_INIZIO_FACOLTA_CALL AS DATA_INIZIO_FACOLTA_CALL_T1,
A.DATA_FINE_FACOLTA_CALL AS DATA_FINE_FACOLTA_CALL_T, B.DATA_FINE_FACOLTA_CALL AS DATA_FINE_FACOLTA_CALL_T1,
A.DATA_INIZIO_FACOLTA_PUT AS DATA_INIZIO_FACOLTA_PUT_T, B.DATA_INIZIO_FACOLTA_PUT AS DATA_INIZIO_FACOLTA_PUT_T1,
A.DATA_FINE_FACOLTA_PUT AS DATA_FINE_FACOLTA_PUT_T, B.DATA_FINE_FACOLTA_PUT AS DATA_FINE_FACOLTA_PUT_T1,
A.AMMONTARE_EMESSO AS AMMONTARE_EMESSO_T, B.AMMONTARE_EMESSO AS AMMONTARE_EMESSO_T1,
A.DATA_PRIMO_GODIMENTO AS DATA_PRIMO_GODIMENTO_T, B.DATA_PRIMO_GODIMENTO AS DATA_PRIMO_GODIMENTO_T1,
A.DATA_SCADENZA AS DATA_SCADENZA_T, B.DATA_SCADENZA AS DATA_SCADENZA_T1,
A.PRIMO_PREZZO_EMISSIONE AS PRIMO_PREZZO_EMISSIONE_T, B.PRIMO_PREZZO_EMISSIONE AS PRIMO_PREZZO_EMISSIONE_T1,
A.MODALITA_RIMBORSO AS MODALITA_RIMBORSO_T, B.MODALITA_RIMBORSO AS MODALITA_RIMBORSO_T1,
A.SUBORDINAZIONE AS SUBORDINAZIONE_T, B.SUBORDINAZIONE AS SUBORDINAZIONE_T1,
A.DIV_EMIS_CODE AS DIV_EMIS_CODE_T, B.DIV_EMIS_CODE AS DIV_EMIS_CODE_T1,
A.DIV_EMIS AS DIV_EMIS_T, B.DIV_EMIS AS DIV_EMIS_T1,
A.START_DATE AS DATA_AGG_T, B.START_DATE AS DATA_AGG_T1
FROM SPR_KLERS_ISD A, SPR_KLERS_ISD B
WHERE A.START_DATE=TRUNC(SYSDATE)
AND A.ISICOD=B.ISICOD
AND B.END_DATE = TRUNC(SYSDATE)
AND (nvl(A.CODICE_EMITTENTE,' ') != nvl(B.CODICE_EMITTENTE,' ')
OR
nvl(A.DESCRIZIONE_TITOLO,' ') != nvl(B.DESCRIZIONE_TITOLO,' ')
OR
nvl(A.SOTTOSTANTE,' ') != nvl(B.SOTTOSTANTE,' ')
OR
nvl(A.TIPO_SOTTOSTANTE, ' ') != nvl(B.TIPO_SOTTOSTANTE,' ')
OR
nvl(A.CEDOLA_LORDA_CORRENTE, 0) != nvl(B.CEDOLA_LORDA_CORRENTE, 0)
OR
nvl(A.FREQUENZA_CEDOLA, ' ') != nvl(B.FREQUENZA_CEDOLA, ' ')
OR
nvl(A.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') != nvl(B.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999')
OR
nvl(A.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') != nvl(B.DATA_FINE_FACOLTA_CALL, '31-Dec-2999')
OR
nvl(A.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') != nvl(B.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999')
OR
nvl(A.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') != nvl(B.DATA_FINE_FACOLTA_PUT,'31-Dec-2999')
OR
nvl(A.AMMONTARE_EMESSO, 0) != nvl(B.AMMONTARE_EMESSO, 0)
OR
nvl(A.DATA_PRIMO_GODIMENTO, '31-Dec-2999') != nvl(B.DATA_PRIMO_GODIMENTO, '31-Dec-2999')
OR
nvl(A.DATA_SCADENZA, '31-Dec-2999') != nvl(B.DATA_SCADENZA, '31-Dec-2999')
OR
nvl(A.PRIMO_PREZZO_EMISSIONE, 0) != nvl(B.PRIMO_PREZZO_EMISSIONE, 0)
OR
nvl(A.MODALITA_RIMBORSO, 0) != nvl(B.MODALITA_RIMBORSO, 0)
OR
nvl(A.SUBORDINAZIONE, ' ') != nvl(B.SUBORDINAZIONE, ' ')
OR
nvl(A.DIV_EMIS_CODE, 0) != nvl(B.DIV_EMIS_CODE, 0)
OR
nvl(A.DIV_EMIS, ' ') != nvl(B.DIV_EMIS, ' '))where I have changed only this:
B.START_DATE = decode(trim(to_char(sysdate, 'Day')), 'Monday',trunc(sysdate-3), trunc(sysdate-1)) --------->AND B.END_DATE = TRUNC(SYSDATE)
Both START_DATE and END_DATE are date filds.
When I execute the second query I receive this:
ORA-01843: not a valid monthin many ponts of the query that change every time I execute the query, why this behaviour?
How can I solve?
Thanks, bye bye.Could you execute the following query and post the output.
select * from nls_session_parameters where parameter = 'NLS_DATE_FORMAT';
select sysdate from dual;Also what are the datatypes for these columns
>
nvl(A.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999') != nvl(B.DATA_INIZIO_FACOLTA_CALL, '31-Dec-2999')
OR
nvl(A.DATA_FINE_FACOLTA_CALL, '31-Dec-2999') != nvl(B.DATA_FINE_FACOLTA_CALL, '31-Dec-2999')
OR
nvl(A.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999') != nvl(B.DATA_INIZIO_FACOLTA_PUT,'31-Dec-2999')
OR
nvl(A.DATA_FINE_FACOLTA_PUT,'31-Dec-2999') != nvl(B.DATA_FINE_FACOLTA_PUT,'31-Dec-2999')
OR
nvl(A.AMMONTARE_EMESSO, 0) != nvl(B.AMMONTARE_EMESSO, 0)
OR
nvl(A.DATA_PRIMO_GODIMENTO, '31-Dec-2999') != nvl(B.DATA_PRIMO_GODIMENTO, '31-Dec-2999')
OR
nvl(A.DATA_SCADENZA, '31-Dec-2999') != nvl(B.DATA_SCADENZA, '31-Dec-2999')
>
I hope you know anything given in single quotes is a string and not a date.
Regards
Raj -
Front end query writing.
Hi gurus,
I know about query designer, Bex analyzer, Bex browser and other related topics such as variables, Conditions and exceptions? But i cant understand what's this Front end query writing or Back end data modelling. Will you plz give me detailed description on this topic, how it should be used in real time scenario.
Thanks,
Sameer.Hi Sameer
If I understand ur question correctly
<b>query designer, Bex analyzer, Bex browser and other related topics such as variables, Conditions and exceptions?</b> all these are for creating queries and used for generating reports. So these come front end side.
And abt <b>Back end data modelling</b>, it is modelling thing we do in Adminstrator work bench(RSA1) i.e creating infoobjects, datatargets etc.,
In real time we will get the data from source system and store it in the data targets and infoobjects we modelled in AWB and then we report on this datatargets.
So this ETL and modelling part becomes back end and Reporting becomes front end.
I think it's clear for u now
Any doubts let me know
Regards
Kiran
Maybe you are looking for
-
How do I export one song from iTunes to a .mp3 file?
Sorry for the newbie question. I want to create a single .mp3 file from one of the songs in my iTunes library. How do I do that? Thanks much.
-
HT1338 my computer constantly restarted itself
Since last week, my computer restarted itself constantly with error message on screen "your computer was restarted because of some problem". It became very frustrating after the Apple Tech could not help with the issues. I would like to know who can
-
News Ticker &PX_ITEM. not populating
I have created a newsticker from Denes' page using &PX_ITEM. PX_ITEM is created from the following process. On Load - After Footer.: SELECT EXTRACT(DAY FROM TO_TIMESTAMP(:P1_END_DT,'MMDDYYYY HH24:MI') - TO_TIMESTAMP(:P1_BEG_DT,'MMDDYYYY HH24:MI')) ||
-
Add new fields to Coding Block using OXK3
Hi Friends I need below clarification in addition of new fields to Coding block from transaction code- OXK3. 1) Which approach is adivsable either EXPERT MODE or BASIC MODE. 2) In Expert mode access key will be required to add field manually into BSE
-
Automated filling of Data Selection in Infopackage
Hello guys, I want to automate a process of filling data into BW 35. I'm using R/3 IS-U, the data model is for cleared items in FI/CA (0FC_CI_01). In order to load data in BW, I have to run FPBW in the source system with a date and a run id as parame