Weird behaviour: join of a table with a view
Hello,
I'm evaluating Oracle 10g for the migration of an application currently running on
Oracle 8i and I found a query that doesn't work as expected on the new release.
The query is very simple and uses a table "T_Programm" and a view "V_Adresse".
The column "Id" is the primary key of "T_Programm" and of type number, the other
columns are varchar2.
First I tried this:
SELECT P.Id, A.Schluessel, P.Absender
FROM V_Adresse A,T_Programm P
WHERE A.Schluessel=P.Absender;
with the following expected result:
ID SCHLUESSEL ABSENDER
10020 BZV BZV
10000 BZV BZV
1 BZV BZV
But with the follwing query there are no results:
SELECT P.Id, A.Schluessel, P.Absender
FROM V_Adresse A, T_Programm P
WHERE A.Schluessel=P.Absender
AND P.Id=10020;
Just for fun I tried another query:
SELECT P.Id, A.Schluessel, P.Absender
FROM V_Adresse A, T_Programm P
WHERE A.Schluessel=P.Absender
AND P.Id>10019 AND P.Id<10021;
and I got the expected result:
ID SCHLUESSEL ABSENDER
10020 BZV BZV
On the Oracle 8i with the same data there was no problem.
Maybe there is something wrong with the index or the query optimizer?!?
Is there any idea?
thank you in advance
Stephan
Hello,
the column and table names are in german, I hope that's not a problem.
best regards
Stephan
Here are the describes:
Table T_Programm:
Name Null? Typ
ID NOT NULL NUMBER(12)
JAHRID NUMBER(12)
TITELID NUMBER(12)
WAEHRUNGID NUMBER(12)
TYP VARCHAR2(4)
KREDITORENKONTO VARCHAR2(32)
DEBITORENKONTO VARCHAR2(32)
BANKNAME VARCHAR2(256)
BANKLEITZAHL VARCHAR2(32)
KONTONUMMER VARCHAR2(32)
UNTERSCHRIFT1 VARCHAR2(1024)
UNTERSCHRIFT2 VARCHAR2(1024)
UNTERSCHRIFT3 VARCHAR2(1024)
UNTERSCHRIFT4 VARCHAR2(1024)
EMSATZ NUMBER(5,2)
BMSATZ NUMBER(5,2)
SZSATZ NUMBER(5,2)
VEDATUM DATE
VEBETRAG VARCHAR2(256)
BRIEFKOPF VARCHAR2(256)
GRUSSZEILE VARCHAR2(256)
TITEL_KURZ VARCHAR2(256)
TITEL_LANG VARCHAR2(1024)
ABSENDER VARCHAR2(32)
View V_Adresse:
Name Null? Typ
MANDANTID NUMBER
SCHLUESSEL VARCHAR2(32)
P_ANREDE1 VARCHAR2(16)
P_ANREDE2A VARCHAR2(16)
P_ANREDE2B VARCHAR2(16)
P_POSITION VARCHAR2(32)
P_TITEL VARCHAR2(32)
P_VORNAME VARCHAR2(32)
P_NACHNAME VARCHAR2(32)
P_ABTEILUNG VARCHAR2(64)
P_TELEFON VARCHAR2(32)
P_TELEFAX VARCHAR2(32)
P_EMAIL VARCHAR2(64)
P_INTERNET VARCHAR2(64)
P_ANMERKUNG VARCHAR2(1024)
O_KUERZEL VARCHAR2(32)
O_ARTIKELA VARCHAR2(16)
O_ZEILE1A VARCHAR2(64)
O_ARTIKELB VARCHAR2(16)
O_ZEILE1B VARCHAR2(64)
O_ZEILE1 VARCHAR2(64)
O_ZEILE2 VARCHAR2(64)
O_ZEILE3 VARCHAR2(64)
O_POSTFACH VARCHAR2(16)
O_PLZPOSTFACH VARCHAR2(16)
O_STRASSE VARCHAR2(64)
O_PLZSTRASSE VARCHAR2(16)
O_ORT VARCHAR2(64)
O_TELEFON VARCHAR2(32)
O_TELEFAX VARCHAR2(32)
O_EMAIL VARCHAR2(64)
O_INTERNET VARCHAR2(64)
Here is the view statement:
CREATE VIEW V_Adresse AS
SELECT
1 AS MandantId,
P.Name AS Schluessel,
P.Anrede1 AS P_Anrede1,
P.Anrede2a AS P_Anrede2a,
P.Anrede2b AS P_Anrede2b,
P.Position AS P_Position,
P.Titel AS P_Titel,
P.Vorname AS P_Vorname,
P.Nachname AS P_Nachname,
P.Abteilung AS P_Abteilung,
P.Telefon AS P_Telefon,
P.Telefax AS P_Telefax,
P.Email AS P_Email,
P.Internet AS P_Internet,
P.Anmerkung AS P_Anmerkung,
O.Name AS O_Kuerzel,
O.Artikela AS O_Artikela,
O.Zeile1a AS O_Zeile1a,
O.Artikelb AS O_Artikelb,
O.Zeile1b AS O_Zeile1b,
O.Zeile1 AS O_Zeile1,
O.Zeile2 AS O_Zeile2,
O.Zeile3 AS O_Zeile3,
O.Postfach AS O_Postfach,
O.PLZPostfach AS O_PLZPostfach,
O.Strasse AS O_Strasse,
O.PLZStrasse AS O_PLZStrasse,
O.Ort AS O_Ort,
O.Telefon AS O_Telefon,
O.Telefax AS O_Telefax,
O.Email AS O_Email,
O.Internet AS O_Internet
FROM
T_Organisation O,
T_Person P
WHERE
O.Id=P.OrganisationId
UNION
SELECT
1 AS MandantId,
O.Name AS Schluessel,
'' AS P_Anrede1,
'' AS P_Anrede2a,
'' AS P_Anrede2b,
'' AS P_Position,
'' AS P_Titel,
'' AS P_Vorname,
'' AS P_Nachname,
'' AS P_Abteilung,
'' AS P_Telefon,
'' AS P_Telefax,
'' AS P_Email,
'' AS P_Internet,
'' AS P_Anmerkung,
O.Name AS O_Kuerzel,
O.Artikela AS O_Artikela,
O.Zeile1a AS O_Zeile1a,
O.Artikelb AS O_Artikelb,
O.Zeile1b AS O_Zeile1b,
O.Zeile1 AS O_Zeile1,
O.Zeile2 AS O_Zeile2,
O.Zeile3 AS O_Zeile3,
O.Postfach AS O_Postfach,
O.PLZPostfach AS O_PLZPostfach,
O.Strasse AS O_Strasse,
O.PLZStrasse AS O_PLZStrasse,
O.Ort AS O_Ort,
O.Telefon AS O_Telefon,
O.Telefax AS O_Telefax,
O.Email AS O_Email,
O.Internet AS O_Internet
FROM
T_Organisation O;
Similar Messages
-
Joining two fact tables with different dimensions into single logical table
Hi Gurus,
I try to accomplish in Oracle Business Intelligence 11.1.1.3.0:
F1 (D1, D2 and D3)
F2 (D1 and D2 and D4)
And we want to build a report F1 F2 D1 D2 D3 D4 to have data for:
F1 that match only for D1-D2-D3
and data for
F2 that match only D1-D2-D4
all that in one row, so D3 and D4 are not common dimensions.
I can only do:
F3 (D1, D2)
F4 (D1, D2 and D4)
And report
F3 F4 D1,D2,D4 (all that in one row, and only D4 is not a common dimension)
Here is the very good example how to accomplish the scenario 1
http://108obiee.blogspot.com/2009/08/joining-two-fact-tables-with-different.html
But looks like it does not work in 11.1.1.3.0
I get
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 14025] No fact table exists at the requested level of detail: [,,Clients,,Day,ROI,,,,EW_Names,,,,,,,,,,,,,,,,,]. (HY000)
I am sure I set up everything correctly as advised in the blog but it works with only one not a common dimension
Is it a bug in 11.1.1.3.0 or something?
Thanks,
KateThanks for all your replies.
Actually, I've tried the solutions you guys mentioned. Generally speaking, the result should be displayed. However, my scenario is a little bit tricky.
table Y's figures are not the aggregation of table X for D dimension. Instead, table Y's figures include not only D dimension total, but also others (others do not mean A, B, C dimension). For example, table Y stores all food's figure, while table X stores only drink's figure. D dimension is only about drink's detail. In my scenario, other foods' figure is not provided.
So, even if I set D dimension to all/total for table X, table X's result is still not the same as table Y.
Indeed, table Y does not have a column key to join to D dimension's key. So, if I select D dimension and table Y's measures at the same time in BI Answer, result returns no data. Hence, I can't compare table X and table Y's results with selection of D dimension.
Is there any solution to solve this problem?
Edited by: TomChan on Jun 3, 2009 9:36 AM -
SELECT STATMENT USING JOINS OF 2 TABLE WITH UPT 200 ROWS
Hi
Any give me sample code for select statment'' SELECT STATMENT USING JOINS OF 2 TABLE WITH UPT 200 ROWS''.
Thanks in advance .
regards
veeratables : mara.
data : begin of itab occurs 0,
matnr like mara-matnr,
maktx like makt-maktx,
end of itab.
start-of-selection.
select amatnr bmaktx into table itab up to 200 rows
from mara as a inner join makt as b on bmatnr = amatnr. -
Table with tree view on master column
Hi,
I'm trying to generate a table with tree view on the master column and I get the table values from an RFC.
The problem is that I need to control some properties like "expanded" or "isLeaf" and I can't add the value attributes to the model node to control the rows.
Any ideia on how to overcome this (what i think is a) problem?
Thanks for the help.
Pedro BarbosaHi Subramanian,
Maybe I didn't explain myself right. I also followed that tutorial with success but in this case i have on my custom controller:
-MyNode (model node)
- Output
- MyTable
- attribute 1 (model attribute)
In my context/view controller the only way i can map that node is by using a model node referecing "MyTable" but this way i can't add any of my attributes to same level of the attributes (is that the ideia right?).
I also tried to recreate the structure in the view with value nodes and value attributes with the same type as the model attributes and then bind them but i always get "Incompatible context element type".
Am i missing something?
Pedro Barbosa -
Performance for join 9 custom table with native SQL ?
Hi Expert,
I need your opinion regarding performance to join 9 tables with native sql. Recently i have to tunning some customize extraction cost report. This report extract about 10 million cost of material everyday.
The current program actually, try to populate the condition data and insert into customize table and join all the table to get data using native sql.
SELECT /*+ ordered use_hash(mst,pg,rg,ps,rs,dpg,drg,dps,drs) */
mst.werks, ....................................
FROM
sapsr3.zab_info mst,
sapsr3.zab_pc pg,
sapsr3.zab_rc rg,
sapsr3.zab_pc ps,
sapsr3.zab_rc rs,
sapsr3.zab_g_pc dpg,
sapsr3.zab_g_rc drg,
sapsr3.zab_s_pc dps,
sapsr3.zab_s_rc drs
WHERE mst.zseq_no = :p_rep_run_id
AND mst.werks = :p_werks
AND mst.mandt = rg.mandt(+)
AND mst.ekorg = rg.ekorg(+)
AND mst.lifnr = rg.lifnr(+)
AND mst.matnr = rg.matnr(+)
............................................... unitl all table (9 tables)
AND ps.mandt = dps.mandt(+)
AND ps.knumh = dps.knumh(+)
AND ps.zseq_no = dps.zseq_no(+)
AND COALESCE (dps.kbetr, drs.kbetr, dpg.kbetr, drg.kbetr) <> 0
It seems the query ask for database to using hashed table. would that be it will burden the database ? and impacted to others sap process ?
Please advise
Thank You and Best Regardsyou can only argue coming from measurements and that is not the case.
Coming from the code, I see only that you do not understand it at all, so better leave it as it is. It is not a hash table, but a hash join on these table. -
I have fact table in a subject area. Now due to some requirement we created a view for the same fact table and want to use the view in place of the table.Do we have a way to do it without redoing the whole process?
Hi Tintin,
yes, you can rename in the physical layer the table with the name of the view.
Regards,
Gianluca -
Updating base table with Materialized View's data
Hi,
In order to update base table with MVs data, I am trying real time data transfer between two databases. One is Oracle 8i and other is Oracle 9i. I have created an updatable MV in 9i on a base table using database link. The base table is in 8i. Materialized View log is created in 8i on base table. MV has to be associated to some replication group, but I am not able to create replication group in 9i to which MV has to be associated. The required packages are not installed.
Replication packages are to be used to create replication group are :
/*Create Materialized View replication group*/
BEGIN
DBMS_REPCAT.CREATE_MVIEW_REPGROUP (
gname => 'TEST_MV_GRP',
master => 'TEST_DATA_LINK',
propagation_mode => 'ASYNCHRONOUS');
END;
But above block is giving error.
Can anyone suggest how to resolve this, or are there any other approaches (by not using replication packages) to update base table with MVs data ?
Thanks,
ShaileshYes, I created link between two databases and was able to update tables on 8i from 9i database using that link.
The error I am getting while creating replication group is :
ORA-06550
PLS-00201 : identifier 'SYS.DBMS_REPCAT_UTL2@'TEST_DATA_LINK' must be declared
ORA-06550
PLS-00201 : identifier 'SYS.DBMS_REPCAT_UNTRUSTED@'TEST_DATA_LINK' must be declared
ORA-06512 : at "SYS.DBMS_REPCAT_UTL", line 2394
ORA-06512 : at "SYS.DBMS_REPCAT_SNA_UTL", line 1699
ORA-06512 : at "SYS.DBMS_REPCAT_SNA", line 64
ORA-06512 : at "SYS.DBMS_REPCAT", line 1262
Is there any other approach which can be used to update base table with MVs data instead of using replication packages ?
Thanks,
Shailesh -
Deletion of DDIC Table with Maintaince View
Hello,
I try to delete a table with existing maintance dialog. So first I deleted the generated objects in SE54.
The corresponding funtion group is now no longer existing.
When I now try to delete the table in SE11 I got the message that it is still used. System said it is used
in an include of the deleted function group.
But this include does not exists. Can not be display in se38.
How can i delete this table.
RalfI think when you delete a table in SE11 that has a maintenance dialog, the system asks you if you want to delete the maintenance dialog as well, and in case it is the last one inside a function group, it will even offer to delete the entire function group.
So maybe your solution could be to recreate the maintenance dialog and function group, then delete the table via SE11 and let the system do the cleanup.
Thomas -
Several reports on joined master-detail tables with single row source
I have 1 master table (Fixed Assets) and several datail tables (Improvements, Depreciation, ...)
I need to create several reports based on them all with criteria
'Select ALL from Master and join details
/1 total row from details for 1 master row/
filtered by [on_date <= report_date]'
How to do it better and not copy same code in every report?
As mentioned on this forum, ApEx is not able to use RefCursor as row source for ApEx reports
So I tried this Tom Kyte's example:
create type apex_user.myRecordType as object
(seq int,
a int,
b varchar2(10),
c date
Create Or Replace Type Apex_User.Mytabletype As Table Of Apex_User.Myrecordtype;
create or replace function Apex_User.my_function return Apex_User.myTableType
Is
l_data Apex_User.myTableType;
Begin
l_data := Apex_User.myTableType();
for i in 1..5
loop
L_Data.Extend;
l_data(i) :=Apex_User.myRecordType(i, i, 'row ' || i, sysdate+i);
end loop;
Return L_Data;
End;
Select *
from TABLE (cast(Apex_User.my_function() as Apex_User.mytableType))
Where C > Sysdate+1
Order By Seq Desc
SEQ A B C
5 5 row 5 22.08.2010
4 4 row 4 21.08.2010
3 3 row 3 20.08.2010
2 2 row 2 19.08.2010
4 Rows Selected
- and it really works from ApEx reports.
The questions are:
1) is this the best solution for my task (one centralized code for several reports with parameter filtering detail tables)?
2) how to change example properly to have here -
loop
L_Data.Extend;
l_data(i) :=Apex_User.myRecordType(i, i, 'row ' || i, sysdate+i);
end loop;
- simple SELECT from my MASTER-DETAILS joined tables?Hi,
if (row != null)
Row masterRow = row;
vo.setCurrentRow(masterRow);
// not needed : getMesReponsesPourTiersVO1().executeQuery();
You shouldnot execute the child VO after setting current row in master VO.
When the current row is set in master VO, then the child rows will get refreshed automatically.
Cheers,
Prasanna -
Self join on a table with condition to extract records
Hello PL/SQL Gurus/experts,
I am using Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production version
I have following table -
drop table t1;
create table t1(stud_NM,stud_id) as select
'Vikas',1 from dual union all select
'Andy',2 from dual union all select
'Chi',3 from dual union all select
'Derek',4 from dual union all select
'Kristien',5 from dual union all select
'Tom',6 from dual union all select
'Messi',7 from dual union all select
'Ketty',8 from dual;
drop table t2;
create table t2(stud_id,Class, CDate) as select
1,'BA','20120101' from dual union all select
1,'MA','20120101' from dual union all select
2,'BSc','20120531' from dual union all select
3,'MCA','20120606' from dual union all select
4,'MCA','20120701' from dual union all select
4,'Btech','20120715' from dual union all select
5,'MTech','20120730' from dual union all select
6,'MSc','20120801' from dual union all select
6,'MSc','20120802' from dual union all select
7,'MA','20120815' from dual union all select
8,'MA','20120815' from dual;
I have to get the output based on condition -
Extract Stud_Name, Count of records which has a condition as that of the one that if combination of Stud_Name & CDate is same then count this combination once only else if Stud_Name & CDate are different then count them as different records -
Currently i am using the following query to get the output -
select t1.stud_NM, count(distinct CASE WHEN orig.CDate<>ali.CDate then t1.stud_NM else
CASE WHEN orig.CDate=ali.CDate then '1' else null
end
end) Count
from t1,
t2 orig,
t2 ali
where t1.stud_id=orig.stud_id
and t1.stud_id=ali.stud_id
group by t1.stud_NM
order by t1.stud_NM
which is giving the following output, which looks fine as well -
STUD_NM COUNT
Andy 1
Chi 1
Derek 2
Ketty 1
Kristien 1
Messi 1
Tom 2
Vikas 1
8 rows selected.
So want to confirm if i am doing right or it is just because of the data it is giving me the right result ?
Kindly help me thanks in advance for your time and efforts.Hi,
You can simplify that, too. Since you're GROUPing BY stud_nm, concatenating COUNT (DISTINCT stud_nm || cdate) is just the same as COUNT (DISTINCT cdate), assuming cdate is not NULL.
Also, that assumes stud_nm is unique. (If it's not, the desired output doesn't make sense, but that's a different matter.) I'd do it this way:
SELECT t1.stud_nm
, t1.stud_id -- If wanted
, COUNT (DISTINCT t2.cdate) AS cnt
FROM t1
LEFT OUTER JOIN t2 ON t1.stud_id = t2.stud_id
GROUP BY t1.stud_nm, t1.stud_id
ORDER BY t1.stud_nm, t1.stud_id
OP: the query you posted will get the wrong results with other data. For example, if we add this to the sample data in t2:
7,'WX','20120816' from dual union all select
7,'YZ','20120817' from dual union all select
Karthick's solution (and my variant of it) correctly show a count of 3 for stud_id=7 (Messi), but your query has 2. -
Regarding joining of two tables with same feilds
hello gurus
i am new to abap programming. i have to extract data from two tables ie coss and cosp tables . one table has 180 records and another table has 500 records i want to extract these two table records into internal table(680 records) and then i have to populate it to flatfile through gui download. can any one give me use code to work on it.these two tables has same set of feilds.Hi,
First you should verify if you want to get all the data from both tables regardless if its the same record. If it is, then you can follow this logic:
select * from coss into table it_coss_cosp. "step 1
select * from cosp appending table it_coss_cosp. "step 2
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = data.txt
FILETYPE = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
IMPORTING
FILELENGTH =
tables
data_tab = it_coss_cosp
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
But if you plan to get those record which exists in both tables then use a join condition for your select statement.
Hope this helps...
P.S. Please award points for useful answers. -
Join a Parent Table with 2 Child table based on a value
Dear Guru's
We have a Parent Table and 2 Child table . The Parent Table has a column like seqtype with only 2 possible values C and S . If the Value is C , then the details are available in Child 1 table and if the Value is S then the Details are in Child 2 table
How can we query the Data from this type of arrangement ? I am little bit confused and hit a road block
Will the following query will work ?
Select
from Parent P , Child C1, Child C2
where P.seqtype = C1.Seqtype
and P.seqtype = C2.Seqtype
With Warm Regards
ssrYou didn't mention the column names in two child tables. Whether the columns are same in 2 tables of these are different.
If the columns are same better to go and change your design to have only one child table. However if stiil business stops you having one table you can use UNION ALL (Assuming you want to fetch same column information from two child tables) like below:
SELECT p.col1
,c1.col2
,c1.col3
,c1.col4
FROM parent p
,child c1
WHERE p.seqtype = c1.seqtype
UNION ALL
SELECT p.col1
,c2.col2
,c2.col3
,c2.col4
FROM parent p
,child c2
WHERE p.seqtype = c2.seqtype Regards
Arun -
Select (join) into internal table with nested structures
Hello Experts,
i wonder about the correct notation of a select statement.
I have an internal table it_zoll including two structures as defined below.
The select is a join on the two tables zollp and zolls. As coded below the select is syntactically correct, but the fields
in the nested structures are not filled ....
Any ideas how to write the select statement ? (The internal table it_zoll must have the nested structures for other reasons ..)
Declaration:
TYPES: BEGIN OF ty_zollp,
belnr TYPE zollp-belnr,
werks TYPE zollp-werks,
gebnr TYPE zollp-gebnr,
END OF ty_zollp.
TYPES: BEGIN OF ty_zolls,
grnum type zolls-grnum,
werks type zolls-werks,
name1 TYPE zolls-name1,
END OF ty_zolls.
DATA: BEGIN OF wa_zoll.
DATA: zollp type ty_zollp.
DATA: zolls type ty_zolls.
DATA: END OF wa_zoll.
DATA: it_zoll LIKE TABLE OF wa_zoll.
Select:
SELECT
zollp~belnr zollp~werks zollp~gebnr
zolls~grnum zolls~werks zolls~name1
FROM zollp
JOIN zolls ON zolls~werks = zollp~werks
AND zolls~grnum = zollp~grnum
INTO CORRESPONDING FIELDS OF TABLE it_zoll
WHERE zollp~werks = werks
AND zollp~gebnr IN s-gebnr
AND ...
Thank you !DATA: BEGIN OF ty_zollp,
belnr TYPE zollp-belnr,
werks TYPE zollp-werks,
gebnr TYPE zollp-gebnr,
END OF ty_zollp.
DATA: BEGIN OF ty_zolls,
grnum type zolls-grnum,
werks type zolls-werks,
name1 TYPE zolls-name1,
END OF ty_zolls.
DATA: BEGIN OF wa_zoll.
Include structure ty_zollp.
Include structure ty_zolls.
DATA: END OF wa_zoll.
The above declaration had worked. Please try.
Regards,
Satish Kanteti -
How to use outer join on 2 tables with Oracle 8i
Could anyone tell me the Oracle 8i syntax equivalent to :
select user.name, city.adress, contry.name
from user
left outer join city on (user.rCity = city.code)
left outer join country on (user.rCountry = country.code)
I tried following :
select user.name, city.adress, contry.name
from user, city, contry
where user.rCity (+) = city.code
and user.rCountry (+) = country.code
but displayed following error :
ORA-01417: a table may be outer joined to at most one other table
Thank youLogically I would expect a user to have a city and a country, or not. In that case the outer join should be on the other tables. Making your query:
select user.name, city.adress, country.name
from user, city, country
where user.rCity = city.code (+)
and user.rCountry = country.code (+); -
Join Master Data table with fact table
Hello gurus.
I have a requirement on a characteristic. I have to obtain the description of those values that are not filled with data in the cube, the example looks like this:
Data in the cube:
Characteristic 1 | charactersitic 2 | value
AU HPDV 200
TB OPPG 500
TC HPDV 900
TR OPMR 400
HPDV 300
OPMR 200
OPPG 100
Master Data Table:
Description
HPDV AU Auditoria
OPPG TB Servicios Logisticos
HPDV TC Occidente
OPMR TR Oriente
HPDV AI Punta Norte
OPGS CV Escandón
HPDV QR Barquisimeto
HPDV MM Valencia
HPDV DT Barcelona
I need to display in the query only the description of the characterstic whose data is not in the cube, according to the example the values that are missing in the cube are:
HPDV AI Punta Norte
OPGS CV Escandón
HPDV QR Barquisimeto
HPDV MM Valencia
HPDV DT Barcelona
How can i achive this ??
Thank you in advance.Hi Guillermo,
I think you are trying to achieve this: To display characteristic values for which no transaction data or only low values exist for the selected period.
See here for the solution details:
http://help.sap.com/saphelp_nw04/helpdata/en/3a/d1603d13b5c72ee10000000a114084/content.htm
Hope this helps...
Maybe you are looking for
-
Connection problem while invoking remote method from client using oracle 8.1.6 server
while using a connection object to make connection to oracle in all remote methods(in EJB)only the first remote method called from the EJB client is getting invoked and the connection stops.It gives me COMM_FAILURE while invoking the second method in
-
FTP Adapter - Filename of archived XML File
Hi All, We are trying to poll Files from Remote Servers using FTP Adapter, after its polled we are keeping the archived file in a directory. Files are archived but its with other name eg: XXXXX.XML is archived as XXXXX.XML_HmuUJDA1qKj2btjp_y1JUeLmgZs
-
4s sleep/wake button not working after updates
My 4s sleep/wake button just stopped working. I can't reset the phone by holding sleep/wake and home key. Did the 6.1.2 update minutes ago which resets the phone and still not working! Thoughts/suggestions? Anyone else having this problem????
-
Hi All, I am using ADA Logical database in my Report which is creating Selection Screen. In this selection screen there are two radio buttons in a same group and first radio button is by default selected. But in my report I have to make second radio
-
Change page order of combined file
I want to know how to change the order of a combined pdf file