Join is not working accordingly?
Hello expert i have two query based on inner join and outer join.
i am using oracle 10g..
please tell me what is the difference in both
1.
select A.INDP_DIV_CODE,a.indp_indt_num,a.indp_proj_code,A.INDP_INDT_DATE,b.item,b.qty,C.SPC_LOCN_CODE,C.INDP_INDT_NUM
from pur_indp_m a INNER JOIN pur_indp_bom b
ON a.INDP_DIV_CODE=b.LOCN_CODE and a.INDP_INDT_NUM=b.REQ_NO
LEFT OUTER JOIN SPC_PPC_DAILY_D C
ON A.INDP_INDT_NUM=C.INDP_INDT_NUM AND A.INDP_DIV_CODE=C.SPC_LOCN_CODE
and a.INDP_CANCEL_FLAG='N'
and a.INDP_DIV_CODE=400001
and a.INDP_INDT_DATE between '01-AUG-2012' and '10-AUG-2012'total around 15000 record including locn_code of 400002
2.
select A.INDP_DIV_CODE,a.indp_indt_num,a.indp_proj_code,A.INDP_INDT_DATE,b.item,b.qty,C.SPC_LOCN_CODE,C.INDP_INDT_NUM
from pur_indp_m a INNER JOIN pur_indp_bom b
ON a.INDP_DIV_CODE=b.LOCN_CODE and a.INDP_INDT_NUM=b.REQ_NO and a.INDP_DIV_CODE='400001'
and a.INDP_INDT_DATE between '01-AUG-2012' and '10-AUG-2012'
LEFT OUTER JOIN SPC_PPC_DAILY_D C
ON A.INDP_INDT_NUM=C.INDP_INDT_NUM AND A.INDP_DIV_CODE=C.SPC_LOCN_CODE
and a.INDP_CANCEL_FLAG='N'only around 300 records of only locn_code=400001
thanks n regards
yash
this is solved, as i do not mention the where clause in query that's why there is variation of records.
Similar Messages
-
Link for BUT000 table and ADRC in CRM and inner join is not working in PCUI
Hi Gurus,
Please tell me the link btween BUT000 and ADRC table. and i wrote one inner join between BUT000 and BUT0id table but it not working. I m in CRM 4.0 version working with PCUI.
select but000partner but000name_org1 but000name_org2 but000bus_sort1 but0id~parnter1
but0ididnumber from but000 inner join but0id on but0idpartner = but000~parnter
into corresponding fields of table it_result where partner in s_partner.
It is giving error as partner unknown from but000 table. I delcared everything and tried with alias names also.
please clarify me.
regards,
Ramakrishna.Hi Frederic,
thanks a lot. But is inner join between BUT000 and BUT0ID will work. for me it is not working. plesae see this code.
tables : but000,
but0id,
crmm_but_custno,
adrc.
types : begin of typ_but000,
partner type bu_partner,
name_org1 type BU_NAMEOR1,
name_org2 type BU_NAMEOR2,
bu_sort1 type BU_SORT1,
idnumber type BU_ID_NUMBER,
partner1 type bu_partner,
end of typ_but000.
data: lt_but000 type table of typ_but000,
ls_but000 like line of lt_but000.
*select-options : s_partnr for but000-partner.
start-of-selection.
select but000partner but000name_org1 but000name_org2 but000bu_sort1 but0id~parnter1
but0id~idnumber into corresponding fields of table lt_but000 from but000
inner join but0id on but0idpartner = but000parnter. " where partner in s_partner.
it is giving error as but000-partner is not know or but0id-partner not known.
So, i think if it not works then i should write two select stmts.
please clarify me.
i gave u rating.
thanks
ramakrishna. -
Join Now not working after 10.3 update
hi - i have a BBQ10 and have successfully completed the 10.3 OS update. I have to say, i love the phone and the OS; however, since the 10.3 update the option to "join now" from meetings in my calendar is no longer working. This was one of the most useful features when i moved from the Bold to the Q series phones. My meetings tend to be schedule via microsoft lync and i'd suggest at least 80% of the time they worked before upgrading to OS 10.3. Now 0% of the time is it working.
anyone else having this issue?
thanks!
jeffalso not working for me for meeting with Lync call in info.
If you look at the phone # next to the Join Now button it has all kinds of strange #'s added after the normal phone #just before the Bridge #
eg:
if your dial in # is 1-800-123-4567 and the conferance ID is 445566 then my Join now # shows as
+1(800)123-456somestrange#s-445566
also the text in the Notes area of the meeting where the phone numbers are lists has a lot of 'percent sign 20' text so is also hard to simply read.
my OS version is 10.3.1.1767 -
Join is not working in webi report
I have let's say three tables; one fact and two dimensions;
I manually joined each dimension table with the fact with 1 to many cardinality...
Now I'm trying to run a test report using few fields from each dimension and it doesn't seem to join; in the SQL Viewer in Edit Query mode, it has two queries under Synchronization...it doesn't show a joined query between tables....
I have a similar setup in another universe that is out of the box solution and that seems to work just fine...
Am I missing something here...Please help!Hi Ahmed,
Along with the context that is present in your universe, check under the parameters the fifth tab i.e. the sql tab.
In this see whether the options are checked or not.
the options :
1.Multiple sql statements for each context.
2.Multiple sql statements for each measure.
Gaurav -
Join is not working for NULL values on join condition
HI ,
I have the following problem .
SQL> select *from a;
X Y
1
2
3
4
SQL> select *from b;
B Y
1
2
SQL> select f.x,f.y,s.b from a f,b s
2 where f.x=s.b(+);
X Y B
1 1
2 2
4
3
SQL> select f.x,f.y,s.b from a f,b s
2 where f.x=s.b(+)
3 and f.y=s.y;
no rows selected
So now if i include one more join condition where in null = null situation arises , it is now working.
Simply saying its not treating ( 1 and null ) and ( 1 and null ) are same.
What is the solution.Is this a expected behaviour.
Thanks
Pramod GarreHI
I want something like this
SQL> select f.x,f.y,s.b from a f,b s
2 where f.x=s.b(+);
X Y B
1 1
2 2
4
3
SQL> select f.x,f.y,s.b from a f,b s
2 where f.x=s.b(+)
3 and f.y=s.y;
Instead of "now Rows " i have to get
X Y B
1 1
2 2
4
3
Is there is any way to do this.
Thanks
Pramod -
Import Manager Join Tables not working
Hi Experts,
for combining tables in the Import Manager i tried to use the join and lookup function.
My easy example is:
Table1
Product ID
Organsation ID
Table2
Organisation ID
Plant
Now I'm joining using the field Organisation ID which contains the same items and make a lookup on the field Plant. In the Source Preview I can see the looked up field but without any values and it is with a grey background.
Any suggestions?
Thanks
AndyHi,
I tried this at my end. It seems like a Bug. I am using MDM 7.1 SP3.
Facing same issue, I mean Grey background (not editable) in source preview, when we look-up field Plant from Table1 to Table2.
This field values are seen mapped in Map Fields/Values tab, but when i import data. Fields get populated for Product ID and Organization ID only but Plant field is not getting populated into MDM data Manager.
So, i am quite sure it seems like a Bug and I would Suggest you to Raise OSS note for the same.
Temporarily, You can import data in below manner.
I mean when you select Source table as Table1, you can import Product ID and Organization ID.
After importing Table1, select your Source table as Table2 map both fields Organization Id and Plant.
Import data by selecting Matching Field as Organization ID and Default Import Action as Update (All Mapped Fields).
So, in this way you can have your complete data in your MDM but obviously just because of bug which you can do in Single Step, Now going to be done in two Steps.
Note: For one of Client i did this on MDM 5.5 SP6, that time it was working perfectly.
Thanks and Regards,
Mandeep Saini -
PLSQL join does not work with RAW fields
Hi All, I wanna to do a join between two table which have as primary key a GUID field (RAW 16). To do this I'm creating a cursor and the sql is simple. However, it returns the following error when I try to compile the procedure:
Error(41,3): PL/SQL: SQL Statement ignored
Error(42,27): PL/SQL: ORA-06552: PL/SQL: Compilation unit analysis terminated ORA-06553: PLS-320: the declaration of the type of this expression is incomplete or malformed
The tables and the cursor are listed below. I would like to know the best way to do a join with Raw fields in plsql once that the same query works when used out of the procedure.
CURSOR Areas IS
Select ha.partial, ha.acidental_burn, ha.edge_cut
from harvest_area ha, harvest_order ho
where ha."ORDER" = ho."ID";
create table "HARVEST_AREA" (
"ID" RAW(16) not null,
"VERSION" NUMBER(10,0) not null,
"ACCIDENTAL_BURN" NUMBER(1,0) not null,
"AREA" DOUBLE PRECISION not null,
"EDGE_CUT" NUMBER(1,0) not null,
"K_FACTOR" NUMBER(1,0) not null,
"PARTIAL" NUMBER(1,0) not null,
"SISCONAGR_CONTROL" NUMBER(1,0) not null,
"CUT" RAW(16) not null,
"ORDER" RAW(16) not null,
"PROVIDER" RAW(16) not null,
"SHAPE" MDSYS.SDO_GEOMETRY,
primary key ("ID")
create table "HARVEST_ORDER" (
"ID" RAW(16) not null,
"VERSION" NUMBER(10,0) not null,
"CHOPPED" NUMBER(1,0) not null,
"CODE" NUMBER(10,0) not null,
"FILE" NVARCHAR2(256),
"LOAD_DISTRIBUTION" NUMBER(1,0) not null,
"RAW_CANE" NUMBER(1,0) not null,
"TIMESTAMP" TIMESTAMP(4) not null,
"FACTORY" RAW(16) not null,
"FRONT" RAW(16) not null,
"MODE" RAW(16) not null,
"SHAPE" MDSYS.SDO_GEOMETRY,
primary key ("ID")
);Ok, I could reproduce on my 10.2.0.4 (my first test was on 11.2.0.1):
SQL> create table harvest_area
id raw (16) not null,
version number (10, 0) not null,
accidental_burn number (1, 0) not null,
area double precision not null,
edge_cut number (1, 0) not null,
k_factor number (1, 0) not null,
partial number (1, 0) not null,
sisconagr_control number (1, 0) not null,
cut raw (16) not null,
order1 raw (16) not null,
provider raw (16) not null,
primary key (id)
Table created.
SQL> create table harvest_order
id raw (16) not null,
version number (10, 0) not null,
chopped number (1, 0) not null,
code number (10, 0) not null,
file1 nvarchar2 (256),
load_distribution number (1, 0) not null,
raw_cane number (1, 0) not null,
timestamp timestamp (4) not null,
factory raw (16) not null,
front raw (16) not null,
mode1 raw (16) not null,
primary key (id)
Table created.
SQL> declare
cursor areas
is
select null
from harvest_area ha,
harvest_order ho
where ha.order1 = ho.id;
begin
for c in areas
loop
null;
end loop;
end;
Error at line 41
ORA-06550: line 6, column 12:
PL/SQL: ORA-06552: PL/SQL: Compilation unit analysis terminated
ORA-06553: PLS-320: the declaration of the type of this expression is incomplete or malformed
ORA-06550: line 4, column 7:
PL/SQL: SQL Statement ignoredProblem is the timestamp column in harvest_order which I think you need to rename:
SQL> drop table harvest_area
Table dropped.
SQL> drop table harvest_order
Table dropped.
SQL> create table harvest_area
id raw (16) not null,
version number (10, 0) not null,
accidental_burn number (1, 0) not null,
area double precision not null,
edge_cut number (1, 0) not null,
k_factor number (1, 0) not null,
partial number (1, 0) not null,
sisconagr_control number (1, 0) not null,
cut raw (16) not null,
order1 raw (16) not null,
provider raw (16) not null,
primary key (id)
Table created.
SQL> create table harvest_order
id raw (16) not null,
version number (10, 0) not null,
chopped number (1, 0) not null,
code number (10, 0) not null,
file1 nvarchar2 (256),
load_distribution number (1, 0) not null,
raw_cane number (1, 0) not null,
timestamp1 timestamp (4) not null,
factory raw (16) not null,
front raw (16) not null,
mode1 raw (16) not null,
primary key (id)
Table created.
SQL> declare
cursor areas
is
select null
from harvest_area ha,
harvest_order ho
where ha.order1 = ho.id;
begin
for c in areas
loop
null;
end loop;
end;
PL/SQL procedure successfully completed. -
WiFi Ask To Join Networks not working
On both my ipod touch 4th gen that was bought new, and my girlfriends ipod touch 3rd gen she bought used, our Wi-fi itself works fine when we go in and choose to connect to a wifi network, as well as to auto-connect to known networks, but our ipods will never ask us if we'd like to join an available wifi network even though your Ask To Join Networks setting is on. Is this a known issue with ipods, and is there a way to get it working?
My girlfriend originally owned the ipod touch 4th gen and gave it to me and so I did a wipe and setup as new with my own apple id, but that didn't make any difference for this issue, it didn't prompt to join networks before or after.I just found out I had a problem with this with my new 4s as well. It was not a problem with my iphone 4. Even though I have "Ask to Join Networks" off, it seems to ask me whenever I use the Maps application when I am driving. Really annoying and the only way to stop it is to disable wifi.
-
Query Rewrite ISSUE (ANSI JOINS do not work, traditional join works ) 11gR2
For some types of queries constructed with ANSI JOINS, materialized views are not being used.
This is currently increasing time on various reports since we cannot control the way the queries are generated(Tableau Application generates and runs queries against the STAR Schema).
Have tried to debug this behavior using DBMS_MVIEW.EXPLAIN_REWRITE and mv_capabilities function without any success.
The database is configured for query rewrite: REWRITE INTEGRITY, QUERY REWRITE ENABLED and other settings are in place.
Have successfully reproduced the issue using SH Sample schema:
Q1 and Q2 are logically identical the only difference between them being the type of join used:
Q1: ANSI JOIN
Q2: Traditional join
Below is an example that can be validated on SH sample schema.
Any help on this will be highly appreciated.
-- Q1: the query is generated by an app and needs to be rewritten with materialized view
SELECT cntr.country_subregion, cust.cust_year_of_birth, COUNT(DISTINCT cust.cust_first_name)
FROM customers cust
INNER JOIN countries cntr
ON cust.country_id = cntr.country_id
GROUP BY cntr.country_subregion, cust_year_of_birth;
-- Q2: the query with traditional join is rewritten with materialized view
SELECT cntr.country_subregion, cust.cust_year_of_birth, COUNT(DISTINCT cust.cust_first_name)
FROM customers cust
INNER JOIN countries cntr
ON cust.country_id = cntr.country_id
GROUP BY cntr.country_subregion, cust_year_of_birth;Tested both queries with the following materialized views:
CREATE MATERIALIZED VIEW MVIEW_TEST_1
ENABLE QUERY REWRITE
AS
SELECT cntr.country_subregion, cust.cust_year_of_birth, COUNT(DISTINCT cust.cust_first_name)
FROM customers cust
INNER JOIN countries cntr
ON cust.country_id = cntr.country_id
GROUP BY cntr.country_subregion, cust_year_of_birth;
CREATE MATERIALIZED VIEW MVIEW_TEST_2
ENABLE QUERY REWRITE
AS
SELECT cntr.country_subregion, cust.cust_year_of_birth, COUNT(DISTINCT cust.cust_first_name)
FROM customers cust, countries cntr
WHERE cust.country_id = cntr.country_id
GROUP BY cntr.country_subregion, cust_year_of_birth;Explain Plans showing that Q1 does not use materialized view and Q2 uses materialized view
SET AUTOTRACE TRACEONLY
--Q1 does not use MVIEW_TEST_1
SQL> SELECT cntr.country_subregion, cust.cust_year_of_birth, COUNT(DISTINCT cust.cust_first_name)
FROM customers cust
INNER JOIN countries cntr
ON cust.country_id = cntr.country_id
GROUP BY cntr.country_subregion, cust_year_of_birth; 2 3 4 5
511 rows selected.
Execution Plan
Plan hash value: 1218164197
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 425 | 12325 | | 916 (1)| 00:00:11 |
| 1 | HASH GROUP BY | | 425 | 12325 | | 916 (1)| 00:00:11 |
| 2 | VIEW | VM_NWVW_1 | 55500 | 1571K| | 916 (1)| 00:00:11 |
| 3 | HASH GROUP BY | | 55500 | 1842K| 2408K| 916 (1)| 00:00:11 |
|* 4 | HASH JOIN | | 55500 | 1842K| | 409 (1)| 00:00:05 |
| 5 | TABLE ACCESS FULL| COUNTRIES | 23 | 414 | | 3 (0)| 00:00:01 |
| 6 | TABLE ACCESS FULL| CUSTOMERS | 55500 | 867K| | 405 (1)| 00:00:05 |
--Q2 uses MVIEW_TEST_2
SQL> SELECT cntr.country_subregion, cust.cust_year_of_birth, COUNT(DISTINCT cust.cust_first_name)
FROM customers cust, countries cntr
WHERE cust.country_id = cntr.country_id
GROUP BY cntr.country_subregion, cust_year_of_birth; 2 3 4
511 rows selected.
Execution Plan
Plan hash value: 2126022771
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 511 | 21973 | 3 (0)| 00:00:01 |
| 1 | MAT_VIEW REWRITE ACCESS FULL| MVIEW_TEST_2 | 511 | 21973 | 3 (0)| 00:00:01 |
---------------------------------------------------------------------------------------------Database version 11gR1 (Tested also on 11gR2)
SQL> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - ProductionThanks for the formatting tips.
Just found an Oracle Bug which explains the above behavior.
Unfortunately the bug will be fixed only in 12.1 Release so as a workaround will try to use traditional joins.
For those who have metalink access see [Bug 10145667 : ERRORS TRYING TO REWRITE QUERY WITH EXACT TEXT MATCH TO MVIEW] -
Inner join query not working properly
Hi everyone,
It does not gives any error, but it is not fetching any values...but when i dont include fourth table CSKT AND THE FIELD LTEXT it is fetching the values.
SELECT SINGLE
T1~PERNR
T1~BEGDA
T1~ENAME
T1~PLANS
T1~KOSTL
T2~STRAS
T2~PSTLZ
T2~ORT01
T3~PLSTX
T4~LTEXT
INTO FS_TAB
FROM PA0001 AS T1
INNER JOIN PA0006 AS T2 ON T1PERNR eq T2PERNR
INNER JOIN T528T AS T3 ON T1PLANS EQ T3PLANS
INNER JOIN CSKT AS T4 ON T1KOSTL EQ T4KOSTL
WHERE T1~PERNR eq p_pernr.Change like this
SELECT SINGLE
T1~PERNR
T1~BEGDA
T1~ENAME
T1~PLANS
T1~KOSTL
T2~STRAS
T2~PSTLZ
T2~ORT01
T3~PLSTX
T4~LTEXT
INTO FS_TAB
FROM PA0001 AS T1
INNER JOIN PA0006 AS T2 ON T1~PERNR eq T2~PERNR
INNER JOIN T528T AS T3 ON T1~PLANS EQ T3~PLANS
LEFT OUTER JOIN CSKT AS T4 ON T1~KOSTL EQ T4~KOSTL
WHERE T1~PERNR eq p_pernr.
OR
SELECT SINGLE
T1~PERNR
T1~BEGDA
T1~ENAME
T1~PLANS
T1~KOSTL
T2~STRAS
T2~PSTLZ
T2~ORT01
T3~PLSTX
T4~LTEXT
INTO FS_TAB
FROM PA0001 AS T1
LEFT OUTER JOIN PA0006 AS T2 ON T1~PERNR eq T2~PERNR
LEFT OUTER JOIN T528T AS T3 ON T1~PLANS EQ T3~PLANS
LEFT OUTER JOIN CSKT AS T4 ON T1~KOSTL EQ T4~KOSTL
WHERE T1~PERNR eq p_pernr.
as long as the table is not used in where condition, u can use left outter join. -
Hi All,
I don't know whether this is the right forum to post this topic...
I am very new to Hibernate. I have written the following query.
query = session.createQuery(" SELECT a.userId FROM com.myhibernatetrials.vo.UserVO a left join ArtifactVO b where a.roleId='B' and a.userId = b.qaReviewerId group by a.userId order by count(b.artifactNum)");
When I run the application I am getting the error 'Path expected for join! '
Please see the detailed message below.
org.hibernate.hql.ast.QuerySyntaxException: Path expected for join! [ SELECT a.userId FROM com.myhibernatetrials.vo.UserVO a left join ArtifactVO b where a.roleId='B' and a.userId = b.qaReviewerId group by a.userId order by count(b.artifactNum)]
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:31)
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:24)
at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:59)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:235)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
at com.myhibernatetrials.dao.CreateArtifactDAO.createArtifact(CreateArtifactDAO.java:23)
at com.myhibernatetrials.action.SelectReviewerAction.execute(SelectReviewerAction.java:32)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:595)
Please help to resolve this.
Thanks
NeelambaryChange like this
SELECT SINGLE
T1~PERNR
T1~BEGDA
T1~ENAME
T1~PLANS
T1~KOSTL
T2~STRAS
T2~PSTLZ
T2~ORT01
T3~PLSTX
T4~LTEXT
INTO FS_TAB
FROM PA0001 AS T1
INNER JOIN PA0006 AS T2 ON T1~PERNR eq T2~PERNR
INNER JOIN T528T AS T3 ON T1~PLANS EQ T3~PLANS
LEFT OUTER JOIN CSKT AS T4 ON T1~KOSTL EQ T4~KOSTL
WHERE T1~PERNR eq p_pernr.
OR
SELECT SINGLE
T1~PERNR
T1~BEGDA
T1~ENAME
T1~PLANS
T1~KOSTL
T2~STRAS
T2~PSTLZ
T2~ORT01
T3~PLSTX
T4~LTEXT
INTO FS_TAB
FROM PA0001 AS T1
LEFT OUTER JOIN PA0006 AS T2 ON T1~PERNR eq T2~PERNR
LEFT OUTER JOIN T528T AS T3 ON T1~PLANS EQ T3~PLANS
LEFT OUTER JOIN CSKT AS T4 ON T1~KOSTL EQ T4~KOSTL
WHERE T1~PERNR eq p_pernr.
as long as the table is not used in where condition, u can use left outter join. -
Hi,
A wierd problem...
This query,
WITH mon_yr AS
(SELECT DISTINCT ip_date, decode(extract(MONTH FROM ip_date),
01, 'JAN', 02,'FEB',03,'MAR',04,'APR',05,'MAY',06,
'JUN',07,'JUL',08,'AUG',09,'SEP',10,'OCT',11,'NOV',
12,'DEC') || '-' || substr(extract(YEAR FROM ip_date), 3, 4) month_year FROM
SELECT (to_date('01/04/2007', 'dd/mm/yyyy') + LEVEL) ip_date FROM dual
CONNECT BY LEVEL <= (SYSDATE - to_date('01/04/2007', 'dd/mm/yyyy'))))
SELECT
DISTINCT m.month_year,
ip.place_code,
COUNT (1)
FROM my_locations l,
mon_yr m FULL OUTER JOIN my_ip_view ip ON
trunc (m.ip_date) = trunc (ip.ip_date)
WHERE
l.loc_id = ip.place_code AND
ip.ip_date IS NOT NULL AND l.loc_hdr_id = 'LID6'
GROUP BY
m.month_year, ip.place_codeis supposed to fetch 35 * 23 = 805 (35 months from Apr 2007 to Feb 2010 and 23 places) records, but is fetching only 494.
Infact, table my_ip_view needs to be LEFT OUTER JOINed with mon_yr.
Pls help me get out of this problem.
Thanks,
Aswin.Frank Kulash wrote:
By the way, isn't
decode(extract(MONTH FROM ip_date),
01, 'JAN', 02,'FEB',03,'MAR',04,'APR',05,'MAY',06,
'JUN',07,'JUL',08,'AUG',09,'SEP',10,'OCT',11,'NOV',
12,'DEC') || '-' || substr(extract(YEAR FROM ip_date), 3, 4)the same as
TO_CHAR (ip_date, 'MON-YY')?Not quite:
SQL> alter session set nls_language=french;
Session altered.
SQL> select to_char(sysdate, 'MON-YY') mon_yr,
2 decode(extract(MONTH FROM sysdate),
3 01, 'JAN',
4 02,'FEB',
5 03,'MAR',
6 04,'APR',
7 05,'MAY',
8 06,'JUN',
9 07,'JUL',
10 08,'AUG',
11 09,'SEP',
12 10,'OCT',
13 11,'NOV',
14 12,'DEC') || '-' || substr(extract(YEAR FROM sysdate), 3, 4) decode_mon_yr,
15 to_char(sysdate, 'MON-YY', 'nls_date_language=english') english_mon_yr
16 from dual;
MON_YR DECODE_M ENGLIS
FÉVR.-10 FEB-10 FEB-10 -
Left Outer Join Not working in BI 7.0 Infoset
Hi All,
I am working on BI 7.0. I have to create a report where I have to display the Target values from a target DSO against the transactional data (Operational data).
I have a DSO where for a subteam value target has been set up on different KPIs.
In the Info Cube, I have transactional data on daily basis per subteam. I have to show the actual and target values.
I have created an Info Set using Target DSO and Daily operational cube, so that I should able to compare the target and actual values of KPIs, for all the subteam values (From DSO, irrespective of whether the data is available in cube for those sub team).
I have used Outer Left Join in the Info set (DSO on left side), but I am unable to see the desired results. It is working just like an inner join.
Any Idea why the Outer Left Join is not working? The DSO has only one fey field called subteam on which I have set outer left join.
Regards,
AmitHi,
did you solve your problem? because I have the same issue right now: the left outer join doesn't seem to do its job.
Let me know if you have found a solution, it would be appreciated.
have a nice day,
Dominic -
Hi guys,
I am not sure why the left join is not working.. when I try to use the and condition out of the left join condition. The database is relational but the requirement is for reporting. I have 2 user inputs and I should get the query results as explained below..
Let me explain with the sample data.
Table 1: PRTYPE (P)
TYPEID CLASSID
T001 CLS001
T001 CLS002
T001 CLS003
T002 CLS002
T003 CLS001
Table 2: EMPLOYEE (E)
EMPID NAME
E001 Joe
E002 Mark
E003 Lucy
Table 3: DETAILS (D)
EMPID CLASSID STATUS
E001 CLS001 NEW
E001 CLS002 DONE
E002 CLS001 NEW
E002 CLS004 NEW
Report1:
Input: PRTYPE.TYPEID = T001, EMPID = E001
Output:
E.NAME E.EMPID P.TYPEID A.CLASSID D.STATUS
JOE EMP001 T001 CLS001 NEW
JOE EMP001 T001 CLS002 DONE
JOE EMP001 T001 CLS003 BLANK
Report2:
PRTYPE.TYPEID = T003, EMPID = E003
E.NAME E.EMPID P.TYPEID A.CLASSID D.STATUS
LUCY E003 T003 CLS001 BLANK
LUCY E003 T003 CLS004 BLANK
When I use and condition in left join itself, it works but when I take it to the end of the sql using where p.typeid= T001 and E.EMPID = E001 I am not getting the left join results... It looks like Oracle doesn't like the condition at the end. I hope I am clear on explaining. Please share your experience on how to get it working..
Thank youHi,
Welcome to the forum!
user12118328 wrote:
I am not sure why the left join is not working.. when I try to use the and condition out of the left join condition. The database is relational but the requirement is for reporting. I have 2 user inputs and I should get the query results as explained below..
When I use and condition in left join itself, it works but when I take it to the end of the sql using where p.typeid= T001 and E.EMPID = E001 I am not getting the left join results... It looks like Oracle doesn't like the condition at the end. I hope I am clear on explaining. Please share your experience on how to get it working..I'm not sure what you mean. Why don't you post your query? You know, it will be easier for someone to tell you what you're doing wrong if they know what you're doing.
Are you saying that you get the correct results when you have a cerain condition in an outer join, but that you get the wrong results if you put the exact same condition in the WHERE-clause?
If so, keep the condition where it does what you want.
You can usually move INNER join conditions around like that, but never OUTER join conditions.
As Alex said, if you want help, post executable statement to create and populate your tables with a little sample data, as well as the output you want from that sample data, and your best attempt at a query. -
Hello everybody,
I have a folder based on materialized view (Detailed folder). There is another folder which is based on a table (master folder). i have created a jooin and select option as "outer join on master folder". The join is not working properly. Am i doing asomething wrong. Discoverer version is 10.1.2 and database version is 10.2.0.3. i have been creating outer joins among folders based on tables but i am not sure about whats wrong this time??? materalized view defination is as follows:
CREATE MATERIALIZED VIEW MW
BUILD IMMEDIATE
REFRESH FORCE
START WITH SYSDATE
NEXT TRUNC(SYSDATE+1)+1/4
WITH PRIMARY KEY
AS
SELECT * FROM VIEW
Thanx for your help
Regards,
NajeebSo, let me see if I got this...
You have a table and a materialized view. There is a join between the two, where the table is the master, and the MV is the detail. The join is set to be an outer join on master. Ultimately, you want to see the values in the MV where the join condition is NULL.
What boggles me is that you say the query runs fine in the database, but not in Disco. This could mean that there is a condition in the BA or in the worksheet. But, if that were the case, the condition should show up in the SQL generated by Disco.
It looks like the where clause is the problem. NULL is never equal to anything, so when APPROVEDBY is null, the where clause should fail and no data returned. This explains Disco's behavior, but not SQL's.
Something to try: Create a calculation in the materialized view folder of the business area like:
NVL(APPROVEDBY, -1)
I am assuming that all of your IDs are positive. Then modify the join to use the calculated column. This should convert the NULLS to values, and the report should work.
Maybe you are looking for
-
CS# Bridge - Folder Palette unresponsive
This is a CS3 Bridge (2.1.1.9) phenomenon I noticed from day 1. Sometimes when I am in the Default Workspace view with the Folder tab selected, I am unable to click on and select a folder for display in the Content window, or to get the folder hierar
-
How can i add movement type with newly created warehouse
Dear expart In my SAP below messgae is showning at the time of pass the transaction code :MIGO "WM movement type 101 not allowed foe warehouse ABC"- How can i sovle the problem .Plz tell me the SPRO. Yeasin
-
Override Action "Save As" Commands
Here it states that checking this "Ensures that processed files are saved to the destination folder specified in the Batch command (or to their original folder if you chose Save and Close), with their original names or the names you specified in the
-
Hi All The Cisco 1200 WAP, when logged shows me the fowarding state as Blocking. When the carrier test is run, it shows me as busy. Can any one tell me shat can be the cause. I suspect the STP should be the issue here. Regards, Vijay
-
No audio when importing DV streams
I download my movie clips with "Image Capture" from my camera. I open in Quicktime and export as a DV stream. When I import the clips into iMovie I have no audio. I have tried everything for two days now. Can anyone help. No, I am NOT using iMovie 08