Combine queries instead of join
disregard.
Edited by: Jay on Jan 20, 2011 8:12 AM
It is always helpful to provide the following:
1. Oracle version (SELECT * FROM V$VERSION)
2. Sample data in the form of CREATE / INSERT statements.
3. Expected output
4. Explanation of expected output (A.K.A. "business logic")
5. Use \ tags for #2 and #3. See FAQ (Link on top right side) for details.
Similar Messages
-
Hi
I have a query regarding combined queries. I am using BO XI R2 Deski. When i create combined queries, i have observed that BO is processing theses queries in the order from right to left i.e it is executing the last two queries first and then then the next right most and so on...
For example if i want to calculate (A Union B) minus (C Intersection D). I am unable to frame this query. When i see the SQL the order is different. Please advise how can i set this preference like first calculate ( A Union B) and ( C Intersection D) and then subtract bothe the result sets.
Thanks,
RaveendraHi Raveendra,
I Tried and able to perform operation Separately like (A union B) and (C Intersection D) and also succeed to put the result side by side but not able to succeed in finding the Minus of the results. Because as you said DESKI perform operations from left to right for each combined query.
I performed union and Intersection operations separately by using 2 data providers.
I used demo universe eFashion for union and intersection.
The Steps followed are as follows:
1. Select eFashion Take objects Year, Store Name, Sales revenue
2. Click Combine Queries and Take same objects because Union operation requires both queries Must have have same objects.
3. Union these 2 Queries Run The Report you will get the Union of 2 Queries. (A Union B)
4.Select New Data Provider (Data New Data Provider)
5. Select Universe you want Take objects in Query C, I Took Same objects with different condition like (Year Inlist(2002,2003))
6. Query D with Condition (Year Equalto(2002)) you will get Results (Query C intersection D). Results that contain only Year Equal to 2002.
Now you have objects from 2 data providers together, Drag and Drop Objects from 2 data providers and put them at different places on Report now you can compare the results.
Here we canu2019t Minus the results because when you click Edit Data Provider, DESKI will Prompt you to select the data provider to Edit and hence we can perform edit operation on One data provider one at a time and not together.
I Hope this is useful.
Thanksu2026
Pratik -
I can't figure out how to combine a full outer join with another type of join ... is this possible?
Here's some create table and insert statements for some basic sample data:
CREATE TABLE my_tab1
( record_id NUMBER NOT NULL
, workstation VARCHAR2(4)
, my_value NUMBER
CONSTRAINT my_tab1_pk PRIMARY KEY (record_id)
INSERT INTO my_tab1
VALUES(1,'ABCD',10);
INSERT INTO my_tab1
VALUES(2,'ABCD',15);
INSERT INTO my_tab1
VALUES(3,'ABCD',5);
INSERT INTO my_tab1
VALUES(4,'A123',5);
INSERT INTO my_tab1
VALUES(5,'A123',10);
INSERT INTO my_tab1
VALUES(6,'A123',20);
INSERT INTO my_tab1
VALUES(7,'????',5);
CREATE TABLE my_tab2
( workstation VARCHAR2(4)
, wkstn_name VARCHAR2(20)
CONSTRAINT my_tab2_pk PRIMARY KEY (workstation)
INSERT INTO my_tab2
VALUES('ABCD','WKSTN 1');
INSERT INTO my_tab2
VALUES('A123','WKSTN 2');
INSERT INTO my_tab2
VALUES('B456','WKSTN 3');
CREATE TABLE my_tab3
( my_nbr1 NUMBER
, my_nbr2 NUMBER
INSERT INTO my_tab3
VALUES(1,2);
INSERT INTO my_tab3
VALUES(2,3);
INSERT INTO my_tab3
VALUES(3,4);And, the results I want to get:
workstation sum(my_value) wkstn_name my_nbr1 my_nbr2
ABCD 30 WKSTN 1 1 2
ABCD 30 WKSTN 1 2 3
ABCD 30 WKSTN 1 3 4
A123 35 WKSTN 2 1 2
A123 35 WKSTN 2 2 3
A123 35 WKSTN 2 3 4
B456 0 WKSTN 3 1 2
B456 0 WKSTN 3 2 3
B456 0 WKSTN 3 3 4
???? 5 NULL 1 2
???? 5 NULL 2 3
???? 5 NULL 3 4I've tried a number of different things, googled my problem, and no luck yet...
SELECT t1.workstation
, SUM(t1.my_value)
, t2.wkstn_name
, t3.my_nbr1
, t3.my_nbr2
FROM my_tab1 t1
, my_tab2 t2
, my_tab3 t3
...So, what I want is a full outer join of t1 and t2 on workstation, and a cross-join of that with t3. I'm wondering if I can't find any examples of this online because it's not possible....
Note: I'm stuck dealing with Oracle 8i
Thanks!!Hi,
The query I posted yesterday is a little more complicated than it needs to be.
Since my_tab2.workstation is unique, there's no reason to do a separate sub-query like mt1; we can join my_tab1 to my_tab2 and get the SUM all in one sub-query.
SELECT foj.workstation
, foj.sum_my_value
, foj.wkstn_name
, mt3.my_nbr1
, mt3.my_nbr2
FROM ( -- Begin in-line view foj for full outer join
SELECT mt1.workstation
, SUM (mt1.my_value) AS sum_my_value
, mt2.wkstn_name
FROM my_tab1 mt1
, my_tab2 mt2
WHERE mt1.workstation = mt2.workstation (+)
GROUP BY mt1.workstation
, mt2.wkstn_name
UNION ALL
SELECT workstation
, 0 AS sum_my_value
, wkstn_name
FROM my_tab2
WHERE workstation NOT IN ( -- Begin NOT IN sub-query
SELECT workstation
FROM my_tab1
WHERE workstation IS NOT NULL
) -- End NOT IN sub-query
) foj -- End in-line view foj for full outer join
, my_tab3 mt3
ORDER BY foj.wkstn_name
, foj.workstation
, mt3.my_nbr1
, mt3.my_nbr2
;Thanks for posting the CREATE TABLE and INSERT statements, as well as the very clear desired results!
user11033437 wrote:
... So, what I want is a full outer join of t1 and t2 on workstation, and a cross-join of that with t3. That it, exactly!
The tricky part is how and when to get SUM (my_value). You might approach this by figuring out exactly what my_tab3 has to be cross-joined to; that is, exactly what should the result set of the full outer join between my_tab1 and my_tab2 look like. To do that, take your desired results, remove the columns that do not come from the full outer join, and remove the duplicate rows. You'll get:
workstation sum(my_value) wkstn_name
ABCD 30 WKSTN 1
A123 35 WKSTN 2
B456 0 WKSTN 3
???? 5 NULL So the core of the problem is how to get these results from my_tab1 and my_tab2, which is done in sub-query foj above.
I tried to use self-documenting names in my code. I hope you can understand it.
I could spend hours explaining different parts of this query in more detail, but I'm sure I'd waste some of that time explaining things you already understand. If you want an explanation of somthing(s) specific, let me know. -
Can anyone tell me WHY Oracle won't allow sub-queries in outer joins?
Hi,
I've recently been tasked with converting a series of InterBase dbs to Oracle.
Many of the queries in the InterBase dbs use sub-queries in outer joins. Oracle won't countenance this (01799 - a column may not be outer-joined to a subquery).
I can get around it using functions but WHY won't Oracle allow this?
SQL Server allows it, InterBase allows it (I don't know about ANSI SQL) but it seems to be a common enough technique...
I'm just curious (and also a little frustrated!).
Thanks in advance,,,Hi,
>>Oracle treat an empty string as a NULL
Well, you same answer your question. Because it is empty
SGMS@ORACLE10> create table tab (cod number, name varchar2(1));
Table created.
SGMS@ORACLE10> insert into tab values (1,'');
1 row created.
SGMS@ORACLE10> insert into tab values (2,' ');
1 row created.
SGMS@ORACLE10> commit;
SGMS@ORACLE10> select cod,dump(name) from tab;
COD DUMP(NAME)
1 NULL
2 Typ=1 Len=1: 32
SGMS@ORACLE10> select * from tab where name is null;
COD NAME
1Cheers
If you talking about language tools, for example PHP treat empty string <> of NULL values. e.g: functions like is_empty() and is_null()
Message was edited by:
Legatti -
Re : How to retrieve Combined Queries (RE Bean SDK) -XIR2 SP2
Hello all,
Hope all is well. I am kinda stuck here ...trying to retrieve Combined Queries from WebI Document. I just have 1 report , 1 DP, 1 combined query(union) with 2 nodes coming off of universe ( __NO__ Custom SQL).
Could someone give me sample code as how to retrieve this...I was able get DP and then Query container...then kinda got lost.How do I retrieve individual query and then get more information of an individual query like DataSourceObject.
QueryContainer qCont = dataProv.getCombinedQueries();
int operator = qCont ();
// getQueryContainerOperator
// then how doi I proceed further to retrieve individual query.
Thanks in advance,
Sam.I don't have any code for retrieving the combined queries, however I have some code for retrieving the SQL from a dataprovider- it might give you an idea of how to get the combined query
oInfoObject = (IInfoObject) oInfoObjects.get(0);
// Initialize the Report Engine
ReportEngines oReportEngines = (ReportEngines) oEnterpriseSession.getService("ReportEngines");
ReportEngine oReportEngine = (ReportEngine) oReportEngines.getService(ReportEngines.ReportEngineType.WI_REPORT_ENGINE);
// Openning the document
DocumentInstance oDocumentInstance = oReportEngine.openDocument(oInfoObject.getID());
DataProvider oDataProvider = null;
SQLDataProvider oSQLDataProvider = null;
SQLContainer oSQLContainer_root = null;
SQLNode oSQLNode = null;
SQLSelectStatement oSQLSelectStatement = null;
String sqlStatement = null;
out.print("<TABLE BORDER=1>");
for (int i=0; i<oDocumentInstance.getDataProviders().getCount(); i++) {
oDataProvider = oDocumentInstance.getDataProviders().getItem(i);
out.print("<TR><TD COLSPAN=2 BGCOLOR=KHAKI>Data Provider Name: " + oDataProvider.getName() + "</TD></TR>");
oSQLDataProvider = (SQLDataProvider) oDataProvider;
oSQLContainer_root = oSQLDataProvider.getSQLContainer();
if (oSQLContainer_root != null) {
for (int j=0; j<oSQLContainer_root.getChildCount(); j++) {
oSQLNode = (SQLNode) oSQLContainer_root.getChildAt(j);
oSQLSelectStatement = (SQLSelectStatement) oSQLNode;
sqlStatement = oSQLSelectStatement.getSQL();
out.print("<TR><TD>" + (j+1) + "</TD><TD>" + sqlStatement + "</TD></TR>");
out.print("</TABLE>");
oDocumentInstance.closeDocument();
Shawn -
6+ stays on LTE instead of joining my wi fi network
My iPhone 6 plus stays on LTE instead of joining my wi fi network, although my wife's 4s doesn't have this issue. both have the same updates. What can I do?
Lawrence - this is the second time we are seeing this in short order - the previous one was the person who had an issue with the phones at his workplace - just a curiosity
(981) -
Combining two queries in a join
SQL> desc messages;
Name Null? Type
MESSAGEID NOT NULL NUMBER
TITLE NOT NULL VARCHAR2(50)
AUTHOR VARCHAR2(20)
BODY NOT NULL VARCHAR2(4000)
BOARD NUMBER
THREAD NOT NULL NUMBER
DATE_CREATED NOT NULL DATE
SQL>
I'm trying to combine both queries outlined below. The first query
selects the very first message created in the messages table. It does
this by checking whether thread=0. If it is that means it started a message.
The second query checks the number of replies to the thread above.
The replies to the above message
will have a thread value the same as the above messageid.
That is how a reply is identified.
I am trying to do both queries in one so that the output has
the starting message first with the name
of the person who created the new thread(author), date_created, etc....below that
then is the
number of replies to the message,the author of each reply and the date....
I'm using oracle 8i so i cant use the join key word...
any ideas would be appreciated.
----selects message that started thread---------------------------------
select b.title,b.boardid,m.messageid,m.title,m.author,
m.date_created,m.body
from messages m, boards b where b.boardid=m.board and m.thread=0 and b.boardid='198'
and m.messageid='241';
Thread title Author Starting message Last post
Austrailia noel Austrailia 04/01/2005 21:22:35
-----selects replies to the above message-----------
select author,date_created,body
from messages
where board=198 and thread=241;
AUTHOR DATE_CREATED BODY
noel 05-JAN-05 Oz is played on clay
noel 05-JAN-05 Oz played on grass
noel 05-JAN-05 Oz played on grassThis is a duplicate post of the following thread:
URGENT: combining two sql statements -
Join/from/where/ combine queries 3
hello my query below is not working for my cf application can
you help?
thanks
this is my previous question so i tried to do it my self.
tcase_req.tcase_req_id is added
tcase.case_id=tcase_req.case_id :note that this is not part of the
inner join in the from clause. it does not depend on the rest of
the inner join.
the reaon for this is that i need to get
WHERE tcase_req.case_req_typ_cd = cwc and
tcase_req.case_req_typ_cd = cwnc
here is the original question
Hello ,
I need help again on the inner join/and conditions in the
where clause
I have these 2 tables tcase and tcase_req where there common
field Is the case_id.
tcase is the parent table and the tcase_req is the child
table.
(1)I wanted to add this to the from clause using the inner
join table . what do I do and where do I put it
(2)I then need to put a condition in the where clause to
replace
WHERE TCASE.CASE_NBR Like '%HPOZ%'
AND TCASE.CASE_NBR = 'DIR-2004-4269-HPOZ-CCMP'
by
WHERE TCASE.CASE_NBR Like '%CWC%' or TCASE.CASE _NBR Like
'%CWNC%'
AND TCASE.CASE_NBR = 'DIR-2004-4269-CWC'
Or TCASE.CASE_NBR = 'DIR-2004-4269-CWNC'
is this efficient??
thanks
SELECT TLA_PROP.PIN,
TLA_PROP.ASSR_PRCL_NBR,
TCASE.CASE_NBR,
TLA_PROP.STR_NBR,
TLA_PROP.STR_NBR_RNG_END,
TLA_PROP.STR_FRAC_NBR,
Tref_plan_area.plan_area_desc,
TLA_PROP.STR_FRAC_NBR_RNG_END,
TLA_PROP.STR_DIR_CD,
TLA_PROP.STR_NM,
TLA_PROP.STR_SFX_CD,
TLA_PROP.STR_SFX_DIR_CD,
TLA_PROP.STR_UNIT_TYP_CD,
TLA_PROP.UNIT_NBR,
TLA_PROP.UNIT_NBR_RNG_END,
TLA_PROP.ZIP_CD,
TLA_PROP.ZIP_CD_SFX,
TLA_PROP.CNCL_DIST_NBR,
TLA_PROP.PLAN_AREA_NBR,
TLA_PROP.ZONE_REG_CD,
TAPLC.PROJ_DESC_TXT,
TCASE.CASE_ID,
TCASE.CASE_NBR,
taplc.aplc_id,
tcase_req.case_req_typ_cd
FROM TLA_PROP INNER JOIN tref_plan_area ON
tla_prop.plan_area_nbr = tref_plan_area.plan_area_NBR INNER JOIN
TLOC ON TLA_PROP.PROP_ID = TLOC.LOC_ID INNER JOIN TAPLC ON
TLOC.APLC_ID = TAPLC.APLC_ID INNER JOIN TCASE ON TAPLC.APLC_ID =
TCASE.APLC_ID
WHERE TCASE.CASE_NBR Like '%CWC%'and
tcase.case_id=tcase_req.case_id
(3)To a tcase_req
Suffix_id are equal to = cwc and cwnc ( in the tcase_req
table)(Suffix_id is the field that cintains the suffix cwc and cwnc
for the tcase_req)
also,
this is the original query and it works fine
SELECT TLA_PROP.PIN,
TLA_PROP.ASSR_PRCL_NBR,
TCASE.CASE_NBR,
TLA_PROP.STR_NBR,
TLA_PROP.STR_NBR_RNG_END,
TLA_PROP.STR_FRAC_NBR,
Tref_plan_area.plan_area_desc,
TLA_PROP.STR_FRAC_NBR_RNG_END,
TLA_PROP.STR_DIR_CD,
TLA_PROP.STR_NM,
TLA_PROP.STR_SFX_CD,
TLA_PROP.STR_SFX_DIR_CD,
TLA_PROP.STR_UNIT_TYP_CD,
TLA_PROP.UNIT_NBR,
TLA_PROP.UNIT_NBR_RNG_END,
TLA_PROP.ZIP_CD,
TLA_PROP.ZIP_CD_SFX,
TLA_PROP.CNCL_DIST_NBR,
TLA_PROP.PLAN_AREA_NBR,
TLA_PROP.ZONE_REG_CD,
TAPLC.PROJ_DESC_TXT,
TCASE.CASE_ID,
TCASE.CASE_NBR,
taplc.aplc_id
FROM TLA_PROP INNER JOIN tref_plan_area ON
tla_prop.plan_area_nbr = tref_plan_area.plan_area_NBR INNER JOIN
TLOC ON TLA_PROP.PROP_ID = TLOC.LOC_ID INNER JOIN TAPLC ON
TLOC.APLC_ID = TAPLC.APLC_ID INNER JOIN TCASE ON TAPLC.APLC_ID =
TCASE.APLC_ID
WHERE (TCASE.CASE_NBR Like '%CWC%' or TCASE.CASE_NBR Like
'%CWNC%')For guys like us that are not writing queries everyday you
might try a query
builder like the one MS Access has.
"Coldfusionstudent" <[email protected]>
wrote in message
news:[email protected]...
> hello my query below is not working for my cf
application can you help?
> thanks
>
>
> this is my previous question so i tried to do it my
self.
>
>
> tcase_req.tcase_req_id is added
tcase.case_id=tcase_req.case_id :note
> that
> this is not part of the inner join in the from clause.
it does not depend
> on
> the rest of the inner join.
>
> the reaon for this is that i need to get
> WHERE tcase_req.case_req_typ_cd = cwc and
tcase_req.case_req_typ_cd =
> cwnc
>
> here is the original question
>
> Hello ,
> I need help again on the inner join/and conditions in
the where clause
>
> I have these 2 tables tcase and tcase_req where there
common field Is the
> case_id.
> tcase is the parent table and the tcase_req is the child
table.
>
> (1)I wanted to add this to the from clause using the
inner join table .
> what
> do I do and where do I put it
>
> (2)I then need to put a condition in the where clause to
replace
> WHERE TCASE.CASE_NBR Like '%HPOZ%'
> AND TCASE.CASE_NBR = 'DIR-2004-4269-HPOZ-CCMP'
> by
> WHERE TCASE.CASE_NBR Like '%CWC%' or TCASE.CASE _NBR
Like '%CWNC%'
> AND TCASE.CASE_NBR = 'DIR-2004-4269-CWC'
> Or TCASE.CASE_NBR = 'DIR-2004-4269-CWNC'
>
> is this efficient??
>
>
>
> thanks
> --------------------
>
> SELECT TLA_PROP.PIN,
> TLA_PROP.ASSR_PRCL_NBR,
> TCASE.CASE_NBR,
> TLA_PROP.STR_NBR,
> TLA_PROP.STR_NBR_RNG_END,
> TLA_PROP.STR_FRAC_NBR,
> Tref_plan_area.plan_area_desc,
> TLA_PROP.STR_FRAC_NBR_RNG_END,
> TLA_PROP.STR_DIR_CD,
> TLA_PROP.STR_NM,
> TLA_PROP.STR_SFX_CD,
> TLA_PROP.STR_SFX_DIR_CD,
> TLA_PROP.STR_UNIT_TYP_CD,
> TLA_PROP.UNIT_NBR,
> TLA_PROP.UNIT_NBR_RNG_END,
> TLA_PROP.ZIP_CD,
> TLA_PROP.ZIP_CD_SFX,
> TLA_PROP.CNCL_DIST_NBR,
> TLA_PROP.PLAN_AREA_NBR,
> TLA_PROP.ZONE_REG_CD,
> TAPLC.PROJ_DESC_TXT,
> TCASE.CASE_ID,
> TCASE.CASE_NBR,
> taplc.aplc_id,
> tcase_req.case_req_typ_cd
> FROM TLA_PROP INNER JOIN tref_plan_area ON
tla_prop.plan_area_nbr =
> tref_plan_area.plan_area_NBR INNER JOIN TLOC ON
TLA_PROP.PROP_ID =
> TLOC.LOC_ID
> INNER JOIN TAPLC ON TLOC.APLC_ID = TAPLC.APLC_ID INNER
JOIN TCASE ON
> TAPLC.APLC_ID = TCASE.APLC_ID
> WHERE TCASE.CASE_NBR Like '%CWC%'and
tcase.case_id=tcase_req.case_id
>
>
>
>
> (3)To a tcase_req
> Suffix_id are equal to = cwc and cwnc ( in the tcase_req
table)(Suffix_id
> is
> the field that cintains the suffix cwc and cwnc for the
tcase_req)
>
> also,
> this is the original query and it works fine
> SELECT TLA_PROP.PIN,
> TLA_PROP.ASSR_PRCL_NBR,
> TCASE.CASE_NBR,
> TLA_PROP.STR_NBR,
> TLA_PROP.STR_NBR_RNG_END,
> TLA_PROP.STR_FRAC_NBR,
> Tref_plan_area.plan_area_desc,
> TLA_PROP.STR_FRAC_NBR_RNG_END,
> TLA_PROP.STR_DIR_CD,
> TLA_PROP.STR_NM,
> TLA_PROP.STR_SFX_CD,
> TLA_PROP.STR_SFX_DIR_CD,
> TLA_PROP.STR_UNIT_TYP_CD,
> TLA_PROP.UNIT_NBR,
> TLA_PROP.UNIT_NBR_RNG_END,
> TLA_PROP.ZIP_CD,
> TLA_PROP.ZIP_CD_SFX,
> TLA_PROP.CNCL_DIST_NBR,
> TLA_PROP.PLAN_AREA_NBR,
> TLA_PROP.ZONE_REG_CD,
> TAPLC.PROJ_DESC_TXT,
> TCASE.CASE_ID,
> TCASE.CASE_NBR,
> taplc.aplc_id
> FROM TLA_PROP INNER JOIN tref_plan_area ON
tla_prop.plan_area_nbr =
> tref_plan_area.plan_area_NBR INNER JOIN TLOC ON
TLA_PROP.PROP_ID =
> TLOC.LOC_ID
> INNER JOIN TAPLC ON TLOC.APLC_ID = TAPLC.APLC_ID INNER
JOIN TCASE ON
> TAPLC.APLC_ID = TCASE.APLC_ID
> WHERE (TCASE.CASE_NBR Like '%CWC%' or TCASE.CASE_NBR
Like '%CWNC%')
> -
Hi,
Is there a code when we can combine the following three queries in one and imprrove performance
DATA: XAUFPL LIKE AFKO-AUFPL,
XARBPL LIKE CRHD-ARBPL,
XARBID LIKE V_QAPO-ARBID.
SELECT SINGLE AUFPL FROM AFKO INTO XAUFPL WHERE AUFNR = '007200000059'.
SELECT SINGLE ARBID FROM V_QAPO INTO XARBID WHERE AUFPL = XAUFPL AND VORNR = '0020'.
SELECT SINGLE ARBPL FROM CRHD INTO XARBPL WHERE OBJID = XARBID.
WRITE: / XARBPL.you can try this:
SELECT SINGLE CRHD~ARBPL
FROM AFKO
INNER JOIN V_QAPO ON V_QAPOAUFPL = AFKOAUFPL
INNER JOIN CRHD ON CRHDOBJID = V_QAPOARBID
INTO XARBPL
WHERE AFKO~AUFNR = '007200000059'
AND V_QAPO~VORNR = '0020'.
WRITE: / XARBPL.
Hope it will be helpful
Thanks -
Combined Queries in BO 4.0 WebI
Hi,
I am creating a combined query in the report query panel. Query 1 has combined query 1 and combined query 2 with UNION Operator.
The combined query 1 has one dimension from Table1.Col1. The combined query 2 has one dimension from Table2.Col1.
When clicking the view script i am expecting the query to be as
select Table1.Col1
from Table1
union
select Table2.Col1
from Table2
But the webi is returning the query like below.
select Table1.Col1
from Table1, Table2
where Table1.Col1 = Table2.Col1
Union
select Table2.Col1
from Table1, Table2
where Table1.Col1 = Table2.Col1
Can anyone please suggest why it is joining both the tables? Any settings has to be done in the CMC to avoid this join?
when creating a union query in the universe with these tables no joins are formed.
Please help me on this. Thanks in advance.This is really very strenge could you please check the parameter value in the file<Parameter
COMBINED_WITH_SYNCHRO
it should be yes.
Also, please check if this the universe spacific problem or happening with all the universe. Did you check with taking other dimention value in the combind query. -
Grus help needed in finding the queries with Cartesian joins
Hi
I have a reporting tool in which users are allowed to put the joins on the views and add some sub queries that produces a Cartesian product. Is there any tool or way that I can stop the execution of those query before it is being executed for example
Step 1 ) user creates a query
step2 ) user submits it
step 3) by any tool or any check if Cartesian join is found the query execution is stopped and notify the user that the query is not good if no problem executes the query.
I really need help in step 3. I am on 9i release2.
Any help or suggestions will be highly appreciated.I Agree with Gasparotto, you should limit the resource consume.
You must understand that cartesian join, isn´t always a BAD guy, sometimes you need it.
If your developers are in trouble with handle the join , think about NATURAL JOIN, may be it helps you
Regards
Helio Dias -
Combine queries dynamically (union?)
Hello Friends
I got very tuff problem, plz help me out.
I want to combine some some query's using "UNION" oprator of SQL Server. Supposed we name it as SET 1.
Again I have to make UNION of output of SET1 with n number of SET 1 like query set.
In short dynamically I have to create differnt UNION OF SOME QUERIES & AGAIN MAKE CHAIN of such queries.
If any one have solution for it . Plz replay immdtly.Thanx For Rplay
Actually I wan to get empids like id from multiple database. & Id Should not be repeated. I have used UNION option. But Dynamically database can be more or less if use more union query become so big. And StringBuffer Become so big. For execution it take time.
So I got one solution for it. I am fetching id from database & storing it in TreeSet Object.
Its very good idea to store record in TreeSet bcoz no Id get repeated.
I got unquie Id & futher I can process. It took very few minutes. If I use UNION it took too much time.
Thanx For ur response
Dinesh -
Combine Queries in one workbook
Hi guys,
I am looking for a way to combine multiple queries in one workbook.
For example: If I set a filter in one query to the month November, the same filter (e.g. November) should apply to all other queries (which are on another worksheet or on the same worksheet).
How can I do this?
Many thanks,
SabinHi Sabine,
You have two options:
1. the easy one is to use same variables in the refresh screen for all queries in the same workbook; if you do this, then use the "refresh all queries" option, you will get the same restrictions applying to all queries in the workbook simultaneously.
2. the more difficult way to do this is to use a lot of Visual Basic. Using Visual Basic, you can "read" the filter value set on a particular query, then "apply" that filter value to every other query in the workbook. OR, you can use the "Copy Filter Value" function. I prefer the latter for a number of reasons.
From your earlier notes, I assume you want to use option 2. To help you further, it would be useful to know what version of BW you are using, and how your users typically refresh queries (i.e., with a button in the workbook, or using the Business Explorer toolbar?).
It would also be helpful to know your level of comfort with VBA in Excel.
Here are some notes on the "Copy Filter Value" function:
Function SAPBEXcopyFilterValue(fromCell As Range, Optional atCell As Range) As Integer
Return value of zero indicates that no errors were encountered. Otherwise, function returns number of errors encountered.
If atCell is not specified, the active cell is used to determine which characteristic to return information for. If the active cell is not part of a query definition, then function returns an error state.
Characteristics (fromCell and atCell) must have same technical name; for example, cannot copy filters for Ship-to (0SHIP_TO) in Sales cube to Ship-to (YCOCUSSH) in a Shipments cube
Queries (copying from and to) must be in same Excel Workbook.
Sub CopyFilterOnce()
Dim filterRng1 As Range, filterRng2 As Range
'in this example, we are copying filters from query on sheet
'with code name Query1 to query on sheet with code name Query2
Set filterRng1 = Query1.Range("F10")
Set filterRng2 = Query2.Range("D13")
retVal = Run("SAPBEX.xla!SAPBEXcopyFilterValue", filterRng1, filterRng2
End Sub
Hope this helps.
- Pete -
Hi,
I would like to relink all the photos in my LR5 catalogue to a new drive to which I have copied all the items using Finder (and not from within LR unfortunately).
When clicking on the exclamation mark next to the "missing" photo with "Find Nearby Missing Photos" checked, I can relink all photos in that folder. The same is true if done through the folder pane to the left. But when trying to relink several folders at once, like e.g. when selecting the main 2014 folder, it only says that the folders are already recognized and offers to "combine" them and offers no other re-link alternative. Relinking each folder manually would be too time consuming and I am sure there has to be a way to do this since it was possible already in LR3 (and probably before that).
What does "combine folders" mean in this context and how would I go about to solve this? Any suggestions would be greatly appreciated.Hi,
I would like to relink all the photos in my LR5 catalogue to a new drive to which I have copied all the items using Finder (and not from within LR unfortunately).
When clicking on the exclamation mark next to the "missing" photo with "Find Nearby Missing Photos" checked, I can relink all photos in that folder. The same is true if done through the folder pane to the left. But when trying to relink several folders at once, like e.g. when selecting the main 2014 folder, it only says that the folders are already recognized and offers to "combine" them and offers no other re-link alternative. Relinking each folder manually would be too time consuming and I am sure there has to be a way to do this since it was possible already in LR3 (and probably before that).
What does "combine folders" mean in this context and how would I go about to solve this? Any suggestions would be greatly appreciated. -
Cannot run spatial queries with table joins
Hi,
I'm experiencing "No spatial column found" when trying to join 2 tables and calculating using ST_Distance function over a spatial column.
I'm running on HANA XS database in the trial instance.
Anyone experiencing this too?Hi Rob,
This is similar to bug 4268528 which I opened a few months ago. I believe it should work, but it is possible that it shouldn't based on the original response. I've updated it with a case that is closer to yours.
Maybe you are looking for
-
Error while posting asset in PY-ABZON
Hi Expert, Im trying to post asset acquisition through T-code-ABZON and am facing the error that For the K4 Fiscal year Variant, no period is defined for XX period I've checked my fiscal year variant Its not K4 have checked the Posting period Variant
-
I had a problem to capture The Panasonic AJ-1400HD to CS5 Premiere
hi dear every one i had a problem to capture The Panasonic AJ-1400HD to CS5 Premiere , the time code running but there are no video picture . some one help , please...............
-
TOSHIBA L300 doesn't start or charge
Ok. So last night I switched on my moms computer when I noticed that it was on low battery. I thought that was odd , because prior to using it, I had connected it to the adaptor and let it charge for an hour or so, and I reasoned that it should have
-
How to trigger sender rfc from r3 system
Hi experts, can any body send documents about " how to trigger sender rfc from r3 system" regards sandeep.
-
Bridge doesn't open jpg and problem with PS
Hallo to everyone. I work on mac os LION. I'm a cloud member for PS (one year, paying monthly, not extended version). Bridge doesn't open my jpg files 'cause a message telling me I have to register the product (???) . Every time I open PS a window ap