Need Help on Joining multiple tables in Golden Gate
Hi,
Can you please help me with some examples on joining multiple tables in Golden Gate. i.e, my requirement is to Join Table 1 & Table 2 in Source and Load it in Target with 10 fields from Table 1 & 5 fields from Table 2 based on the join condition between Table 1.key = Table2.key
I have been trying to do that using SQLEXEC command in Golden Gate. But, is there a way I can do this in the Extract parameter file?
Thanks for your time
Regards
Suresh
Hi,
Thanks a lot for the prompt reply. I am able to do that for the below scenario
Source.T1.Field1
Source.T1.Field2
Source.T2.Field1
Source.T2.Field2
Target Table
T1.Field1, T1.Field2, T2.Field1, T2.Field2.
But, if I already have T2.Field1 in T1 table, then T1.Field1 takes the precendence and getting loaded. i.e., I wanted to join the table 1 & Table 2 and based on the matching condition, I will need to populate the data either from T1 or T2.
Hope you got my requirement.
Below the Data Dump file & Replicat File.
EXTRACT dpump
USERID ********, PASSWORD ********
RMTHOST *******, MGRPORT 7809
RMTTRAIL /oracle/gg/dirdat/rt
--PASSTHRU
TABLE TABLE1,
SQLEXEC (ID LOOKUP,
QUERY "SELECT FIELD1 FROM SOURCE.TABLE2 WHERE FIELD1 = :v_field1",
PARAMS ( v_field1 = field1 )),
TOKENS (tk_field_1 = @GETVAL (lookup.field1));
Replicat file
REPLICAT repjoin
ASSUMETARGETDEFS
HANDLECOLLISIONS
USERID *******, PASSWORD ********
MAP SOURCE.T1, TARGET TARGET.GG_TABLE_T1,
COLMAP ( USEDEFAULTS ,
field1 = @token ("tk_party_id"));
I eventually wanted to join like below.
select t1.field1, t1.field2, t2.field1 from t1, t2
where t1.field1 = t2.field1;
Thanks for your time again
Regards
Suresh
Similar Messages
-
I am trying to develop a query in MS Access 2010 to join two tables using three joins, one of which is a (between) date range. The tables are contained in Access. The reason
the tables are contained in access because they are imported from different ODBC warehouses and the data is formatted for uniformity. I believe this cannot be developed using MS Visual Query Designer. I think writing a query in SQL would be suiting this project.
ABCPART links to XYZPART. ABCSERIAL links to XYZSERIAL. ABCDATE links to (between) XYZDATE1 and ZYZDATE2.
[ABCTABLE]
ABCORDER
ABCPART
ABCSERIAL
ABCDATE
[ZYXTABLE]
XYZORDER
XYZPART
XYZSERIAL
XYZDATE1
XYZDATE2Thank you for the looking at the post. The actual table names are rather ambiguous. I renamed them so it would make more sense. I will explain more and give the actual names. What I do not have is the actual data in the table. That is something I don't have
on this computer. There are no "Null" fields in either of the tables.
This table has many orders (MSORDER) that need to match one order (GLORDER) in GLORDR. This is based on MSPART joined to GLPART, MSSERIAL joined to GLSERIAL, and MSOPNDATE joined if it falls between GLSTARTDATE and GLENDDATE.
[MSORDR]
MSORDER
MSPART
MSSERIAL
MSOPNDATE
11111111
4444444
55555
2/4/2015
22222222
6666666
11111
1/6/2015
33333333
6666666
11111
3/5/2015
This table has one order for every part number and every serial number.
[GLORDR]
GLORDER
GLPART
GLSERIAL
GLSTARTDATE
GLENDDATE
ABC11111
444444
55555
1/2/2015
4/4/2015
ABC22222
666666
11111
1/5/2015
4/10/2015
AAA11111
555555
22222
3/2/2015
4/10/2015
Post Query table
GLORDER
MSORDER
GLSTARTDATE
GLENDDATE
MSOPNDATE
ABC11111
11111111
1/2/2015
4/4/2015
2/4/2015
ABC22222
22222222
1/5/2015
4/10/2015
1/6/2015
ABC22222
33333333
1/5/2015
4/10/2015
3/5/2015
This is the SQL minus the between date join.
SELECT GLORDR.GLORDER, MSORDR.MSORDER, GLORDR.GLSTARTDATE, GLORDR.GLENDDATE, MSORDR.MSOPNDATE
FROM GLORDR INNER JOIN MSORDR ON (GLORDR.GLSERIAL = MSORDR.MSSERIAL) AND (GLORDR.GLPART = MSORDR.MSPART); -
Need help in deleting multiple tables
Hi,
In one of my scenario i want to delete One record from the table, but there are some child and sub child exist for the table. And the on delete cascade is not set fro any of the table.
Structure of my table,
Table-1
tab1_pk
tab1_name
Table-2
tab2_pk
tab1_pk
Table-3
tab3_pk
tab2_pk
i want to delete the record from Table-1 and all the related record of Table-2 and Table-3 in a single query.
Plz helpDear 786725,
What has just came to my mind at first sight is that you can create a trigger for your approach. I don't think that a single query will delete some rows from more than one table.
Please go to the http://tahiti.oracle.com , select your database version and search for the after trigger. Hint: You may need to use the FOR EACH ROW clause and you again may need to use :old :new parameters in the trigger to have the information of what has just been deleted from the relevant table.
Hope That Helps.
Ogan
Edited by: Ogan Ozdogan on 05.Ağu.2010 19:00
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7004.htm#SQLRF01405
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b31695/dialogs.htm#sthref454
4.24 Create Trigger
The following information applies to a trigger, which is which is a stored PL/SQL block associated with a table, a schema, or the database, or an anonymous PL/SQL block or a call to a procedure implemented in PL/SQL or Java. The trigger is automatically executed when the specified conditions occur.
Schema: Database schema in which to create the trigger.
Name: Name of the trigger. Must be unique within the database.
Add New Source in Lowercase: If this option is checked, new text is entered in lowercase regardless of the case in which you type it. This option affects only the appearance of the code, because PL/SQL is not case sensitive in its execution.
Trigger tab
Trigger Type: The type of object on which to create the trigger: TABLE, VIEW, SCHEMA, or DATABASE. (The remaining items depend on the type of trigger.)
Table Owner or View Owner: For a trigger on a table or a view, the name of the owner of the table or the view.
Table Name or View Name : For a trigger on a table or a view, the name of the table or the view.
Before or After: For a trigger on a table, select Before to cause the database to fire the trigger before executing the triggering event, or select After to cause the database to fire the trigger after executing the triggering event.
Statement Level or Row Level: For a trigger on a table, Statement Level fires the trigger once before or after the triggering statement that meets the optional trigger constraint defined in the WHEN condition; Row Level fires the trigger once for each row that is affected by the triggering statement and that meets the optional trigger constraint defined in the WHEN condition.
Insert, Update, Delete: For a trigger on a table or a view, Insert fires the trigger whenever an INSERT statement adds a row to a table or adds an element to a nested table; Update fires fire the trigger whenever an UPDATE statement changes a value in one of the columns specified in Selected Columns (or in any column if no columns are specified); Delete fires the trigger whenever a DELETE statement removes a row from the table or removes an element from a nested table.
Referencing - Old: For a trigger on a table, the correlation names in the PL/SQL block and WHEN condition of a row trigger to refer specifically to old value of the current row.
Referencing - New: For a trigger on a table, the correlation names in the PL/SQL block and WHEN condition of a row trigger to refer specifically to new value of the current row.
Available Columns: For a trigger on a table, lists the columns from which you can select for use in an Update trigger definition.
Selected Columns: For a trigger on a table, lists the columns used in an Update trigger definition.
When: For a trigger on a table, an optional trigger condition, which is a SQL condition that must be satisfied for the database to fire the trigger. This condition must contain correlation names and cannot contain a query.
Schema: For a trigger on a schema, the name of the schema on which to create the trigger.
Available Events: For a trigger on a schema or database, lists events from which you can select for use in the trigger definition.
Selected Events: For a trigger on a schema or database, lists events used in the trigger definition.
DDL tab
This tab contains a read-only display of a SQL statement that reflects the current definition of the trigger.
" -
LEFT OUTER JOIN multiple tables - using the 9i syntax
I've always written my queries using the (+) operator for outer joins. I want to start using the new ANSI standard available in 9i. I can do it when I'm joining two tables in a simple query, but how does it work when I am joining multiple tables?
Here is an example of some SQL that works with the (+) outer join syntax. How can I convert this to use the LEFT OUTER JOIN syntax?
SELECT *
FROM audit_entry aue,
audit_table aut,
audit_statement aus,
audit_row aur,
audit_row_pkey aup1,
audit_row_pkey aup2
WHERE aue.audit_entry_id = aus.audit_entry_id
AND aut.table_name = 'TEST_AUDITING'
AND aut.table_owner = 'CLA_JOURNAL'
AND aus.audit_table_id = aut.audit_table_id
AND aur.audit_statement_id (+) = aus.audit_statement_id
AND aup1.audit_row_id (+) = aur.audit_row_id
AND aup1.pk_column_name (+) = 'TEST_AUDTING_PK_1'
AND aup2.audit_row_id (+) = aur.audit_row_id
AND aup2.pk_column_name (+) = 'TEST_AUDITING_PK_2'
I can join audit_statement to audit_entry easy enough, but then I want to join audit_table to audit_statement, how do I do that, do I start nesting the join statements?
Thanks
RichardThanks for getting back so quickly, I have tried the suggested SQL with mixed results:
SELECT COUNT(*)
FROM audit_entry aue
JOIN audit_statement aus ON aue.audit_entry_id = aus.audit_entry_id
JOIN audit_table aut ON aus.audit_table_id = aut.audit_table_id
RIGHT OUTER JOIN audit_row aur ON aur.audit_statement_id = aus.audit_statement_id
RIGHT OUTER JOIN audit_row_pkey aup1 ON aup1.audit_row_id = aur.audit_row_id
RIGHT OUTER JOIN audit_row_pkey aup2 ON aup2.audit_row_id = aur.audit_row_id
WHERE aut.table_name = 'TEST_AUDITING_TWO'
AND aut.table_owner = 'CLA_JOURNAL'
AND aup1.pk_column_name = 'TEST_AUDTING_PK_1'
AND aup2.pk_column_name = 'TEST_AUDITING_PK_2'
I had to change the order slightly, between the first two JOINs but otherwise it executed OK. My problem is, it should only return 175 rows but its returning 30625 rows. If I comment out the second reference to audit_row_pkey I get the expected result:
SELECT COUNT(*)
FROM audit_entry aue
JOIN audit_statement aus ON aue.audit_entry_id = aus.audit_entry_id
JOIN audit_table aut ON aus.audit_table_id = aut.audit_table_id
RIGHT OUTER JOIN audit_row aur ON aur.audit_statement_id = aus.audit_statement_id
RIGHT OUTER JOIN audit_row_pkey aup1 ON aup1.audit_row_id = aur.audit_row_id
--RIGHT OUTER JOIN audit_row_pkey aup2 ON aup2.audit_row_id = aur.audit_row_id
WHERE aut.table_name = 'TEST_AUDITING_TWO'
AND aut.table_owner = 'CLA_JOURNAL'
AND aup1.pk_column_name = 'TEST_AUDTING_PK_1'
--AND aup2.pk_column_name = 'TEST_AUDITING_PK_2'
It looks the same condition is being used in each case but why do I suddenly get so many rows - its joining differently somehow. It must be to do with the order, do I need to bracket the query?
Thanks again
Richard -
How to join multiple tables !
Give me the Example to join multiple tables 1
Inner join
IF p_bsart IS INITIAL.
SELECT ekko~bukrs
ekko~lifnr
ekko~ebeln
ekko~waers
ekko~bsart
ekko~ekorg
ekko~ekgrp
ekpo~ebelp
ekpo~txz01
ekpo~matnr
ekpo~werks
ekpo~menge
ekpo~meins
ekpo~netpr
ekpo~netwr
INTO TABLE t_itab1 FROM
ekko INNER JOIN ekpo ON ekkoebeln = ekpoebeln
WHERE ekko~ebeln IN s_ebeln AND
ekko~bukrs IN s_bukrs AND
ekko~lifnr IN s_lifnr AND
ekko~ekorg IN s_ekorg AND
ekko~ekgrp IN s_ekgrp AND
ekpo~matnr IN s_matnr.
The difference between an INNER JOIN and an OUTER JOIN is the following. If a query on an INNER JOIN of VBAK (outer table) and VBAP (inner table) finds a record in VBAK but no matching records in VBAP, then no data is retrieved from the database because the inner table is empty. If you still want to keep VBAK rows for which there are no matching VBAP rows, you need to use the OUTER JOIN construct available in ABAP/4 Open SQL in 4.x..
Hi
Syntax
... [(] {dbtab_left [AS tabalias_left]} | join
{[INNER] JOIN}|{LEFT [OUTER] JOIN}
{dbtab_right [AS tabalias_right] ON join_cond} [)] ... .
Effect
The join syntax represents a recursively nestable join expression. A join expression consists of a left-hand and a right- hand side, which are joined either by means of [INNER] JOIN or LEFT [OUTER] JOIN . Depending on the type of join, a join expression can be either an inner ( INNER) or an outer (LEFT OUTER) join. Every join expression can be enclosed in round brackets. If a join expression is used, the SELECT command circumvents SAP buffering.
On the left-hand side, either a single database table, a view dbtab_left, or a join expression join can be specified. On the right-hand side, a single database table or a view dbtab_right as well as join conditions join_cond can be specified after ON. In this way, a maximum of 24 join expressions that join 25 database tables or views with each other can be specified after FROM.
AS can be used to specify an alternative table name tabalias for each of the specified database table names or for every view. A database table or a view can occur multiple times within a join expression and, in this case, have various alternative names.
The syntax of the join conditions join_cond is the same as that of the sql_cond conditions after the addition WHERE, with the following differences:
At least one comparison must be specified after ON.
Individual comparisons may be joined using AND only.
All comparisons must contain a column in the database table or the view dbtab_right on the right-hand side as an operand.
The following language elements may not be used: BETWEEN, LIKE, IN.
No sub-queries may be used.
For outer joins, only equality comparisons (=, EQ) are possible.
If an outer join occurs after FROM, the join condition of every join expression must contain at least one comparison between columns on the left-hand and the right-hand side.
In outer joins, all comparisons that contain columns as operands in the database table or the view dbtab_right on the right-hand side must be specified in the corresponding join condition. In the WHERE condition of the same SELECT command, these columns are not allowed as operands.
Resulting set for inner join
The inner join joins the columns of every selected line on the left- hand side with the columns of all lines on the right-hand side that jointly fulfil the join_cond condition. A line in the resulting set is created for every such line on the right-hand side. The content of the column on the left-hand side may be duplicated in this case. If none of the lines on the right-hand side fulfils the join_cond condition, no line is created in the resulting set.
Resulting set for outer join
The outer join basically creates the same resulting set as the inner join, with the difference that at least one line is created in the resulting set for every selected line on the left-hand side, even if no line on the right-hand side fulfils the join_cond condition. The columns on the right-hand side that do not fulfil the join_cond condition are filled with null values.
Example
Join the columns carrname, connid, fldate of the database tables scarr, spfli and sflight by means of two inner joins. A list is created of the flights from p_cityfr to p_cityto. Alternative names are used for every table.
PARAMETERS: p_cityfr TYPE spfli-cityfrom,
p_cityto TYPE spfli-cityto.
DATA: BEGIN OF wa,
fldate TYPE sflight-fldate,
carrname TYPE scarr-carrname,
connid TYPE spfli-connid,
END OF wa.
DATA itab LIKE SORTED TABLE OF wa
WITH UNIQUE KEY fldate carrname connid.
SELECT ccarrname pconnid f~fldate
INTO CORRESPONDING FIELDS OF TABLE itab
FROM ( ( scarr AS c
INNER JOIN spfli AS p ON pcarrid = ccarrid
AND p~cityfrom = p_cityfr
AND p~cityto = p_cityto )
INNER JOIN sflight AS f ON fcarrid = pcarrid
AND fconnid = pconnid ).
LOOP AT itab INTO wa.
WRITE: / wa-fldate, wa-carrname, wa-connid.
ENDLOOP.
Example
Join the columns carrid, carrname and connid of the database tables scarr and spfli using an outer join. The column connid is set to the null value for all flights that do not fly from p_cityfr. This null value is then converted to the appropriate initial value when it is transferred to the assigned data object. The LOOP returns all airlines that do not fly from p_cityfr.
PARAMETERS p_cityfr TYPE spfli-cityfrom.
DATA: BEGIN OF wa,
carrid TYPE scarr-carrid,
carrname TYPE scarr-carrname,
connid TYPE spfli-connid,
END OF wa,
itab LIKE SORTED TABLE OF wa
WITH NON-UNIQUE KEY carrid.
SELECT scarrid scarrname p~connid
INTO CORRESPONDING FIELDS OF TABLE itab
FROM scarr AS s
LEFT OUTER JOIN spfli AS p ON scarrid = pcarrid
AND p~cityfrom = p_cityfr.
LOOP AT itab INTO wa.
IF wa-connid = '0000'.
WRITE: / wa-carrid, wa-carrname.
ENDIF.
ENDLOOP. -
Need help in creating multiple signature forms?
need help in creating multiple signature forms that can be digitally signed in adobe reader
Automator gets a bit unweildy when trying to vary things outside of what the actions provide. Since you are already using an AppeScript in your workflow, might as well do the whole thing:
set baseFolder to (path to desktop) -- the location to create the folder
display dialog "Please provide a new folder name:" default answer "test"
set folderName to text returned of the result
repeat -- keep repeating until a number is returned
display dialog "How many subfolders?" default answer "5"
set theNumber to text returned of the result
try -- test the result
set theNumber to theNumber as integer
exit repeat -- success
end try
end repeat
tell application "Finder"
try -- make new folder
set newFolder to (make new folder at baseFolder with properties {name:folderName})
on error number -48 -- skip errors if the folder is already there
set newFolder to ((baseFolder as text) & folderName) as alias
end try
repeat with X from 1 to theNumber
try -- make new subfolder
make new folder at newFolder with properties {name:folderName & X}
on error number -48 -- skip errors if the folder is already there
end try
end repeat
end tell -
Need help Setting up Multiple Static Ip , 1 for each port of the fios router
Need help Setting up multiple Static Ip on my fios router
I have been trying to figure out how to set up multiple ip in my fios router.
However I kind of managed how to set up multiple static ip However the way I want it is for each port of my router to have an external ip signed to it. ( like 4 different modem in 1 )
Verizon gave me 5 static ip but they can not help me how to set it up.
Have anyone here done more then one static ip on different ports? I assume that the process will be the after the second static ip.You want to set up Static Nat. You will not assign the IP to a port, but rather to a local machine. Figure out what machines you want your IP's to go to. Under the firewall section you will see static nat. Pick the machine you want and enter one of the IP's you were assigned.
-
Joining multiple tables in ssis
I have to join multiple tables like 10 of them and load the data into destination. I get like 66 million records after joining, I have tried two ways to joining and load the data. First way, I used SQL command in ole db source and wrote the query there but
this is taking forever to start, second way is used sort and merge join transformation and also used Issorted property where ever I can but as it requires multiple sort transformation it is time consuming.
Is there any other way I can load those 66 million records in less time??
Thanks,
sreeHi sree,
If you want to load 66 million records to a SQL server database, the OLE DB Destination Editor allows us to choose either “Table or view” or “Table or view-fast load” from a drop down if data access mode is Table or View. “Table or view-fast load” is the
fastest way to load data to destination. It internally uses the bulk insert statement to send data into the destination table.
Besides, SSIS relies heavily on buffer. A set of records are read into the buffer, and from buffer they are written to the destination. So we can change two properties DefaultMaxBufferRows and DefaultMaxBufferSize to improve the performance. Also we can
add Conditional Split Transformation build some parallelism into the common data flow that directly load data to OLE DB Destination.
Reference:
http://henkvandervalk.com/speeding-up-ssis-bulk-inserts-into-sql-server
http://svangasql.wordpress.com/2012/04/10/simple-tips-to-speed-up-your-ssis-data-flow/
http://www.developer.com/db/top-10-methods-to-improve-etl-performance-using-ssis.html
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
Join multiple tables across separate databases
I needed to perform a join on multiple tables in two separate databases. I am using Sybase ASE 12.5 and jConnect 5.5 JDBC driver.
Table A is in DB1 and Table B is in DB2. Both DB1 and DB2 reside on the same database server.
I have set up JNDI bound datasources DS1 for DB1 and DS2 for DB2.
If the queries involved single tables or multiple tables within the same database, it is simple. But I am not seeing any way where I can perform a join between Tables A and B, which reside in separate databases. The datasources DS1 and DS2 are associated with DB1 and DB2 respectively, so I am not sure if there is anything like performing joins using two data sources.
One alternative I am facing is using a stored procedure in one database refer the table in the other database, for the join. But I may not be allowed to modify the database; currently, I am allowed to perform READ-ONLY queries.
So I am looking for any and all options. Please advice.
Thanks!Two choices..
One find the syntax in DB2 that allows you to do what you want in there. That would often be somelike...
select a.myfield
from database1.table1 a, database2.table2 b
where a.id = b.id
Obviously the database itself must support this. If it doesn't then you have choice two.
You extract the data from database1 using java for table1.
You extract the data from database2 using java for table2.
You write java code that merges the data from both sources. -
Join multiple tables in odi interface
Hi All,
I am new member to Oracle to Data integrator. This is a simple question but i haven't figure out.
I have four source tables and i need to apply joins (left, right and inner)between the table s and use some operators like(and,or) but i am unable to find the this option in odi. I have written a query in SQL Developer and executed it is working fine but when i paste the query in ODI it is showing Missing Expression error.
Thanks for your help,
MadhavaHi - If you have your four source tables in your interface source your neally there, just drag a column from one table to another to create a join (any columns will do) - Then change the join properties to specify the colum = column and the join type, simple as that.
You can build your operators either into the joins (e.g AND) or you can create a filter on that column for any predicate , just drag that column from the table onto the canvas to create the filter object, then change the properties of the filter to suit your needs.
Out of interest - Where are you pasting the query into ODI? -
Join Multiple Tables in Forms 9i
I am attempting to create a tabular form in 9i using two tables. The tables have a one-to-many relationship. The Detail table is the main table for the form and I wish to pull in a column from the master table.
It is similar to the example provided in the on-line help for FORMS 9i 'JOIN of Multiple Tables'. I have gone through all the steps provided. The form compiles OK, however, when I execute_query I get the following error message 'FRM-40505: ORACLE error: unable to perform query.' It does not matter whether the form is of type form or tabular.
If I create a tabular form using the DETAIL table ONLY and then execute_query - the form works correctly.
Thank you in advance of any help
Michael RedfordAndrew, Thank you for your reply.
I concur as I have double checked everything and the Query now works. However I still have a problem.
The error 'FRM-40657 Record changed or deleted by another user' appears as soon as I attempt to change a users record. This form and system is still in development. No other developers/users have access to the tables or forms.
If I remove all references to the joined table then I can update the same field with no errors.
I am trying to display the users name where the users name is not a field on the current table.(similar to creating a form for Employees details and displaying the Department Name for each employee.)
Re: Display Error. We have very recently upgraded from Forms 6i to Forms9i. In 6i we used the Display Error in the Runtime Previewer to debug a Form. Forms 9i runs the form on the web and I'm not sure if the 'Display Error' feature is still available.
Thank you
Michael Redford -
Left Outer Joining multiple tables to one source table FAILS with VLD-1511
Hi all,
Is it me, or is OWB unable to handle left outer joining 1 source table to multiple other tables?
I want to load a fact table so I have 1 source table with measures. This table must be outer joined to some dimensions that have their FK in the fact table.
The SQL statement would look like this (and is perfectly valid):
select ...
from input, dim1, dim2
where input.c1 = dim1.c1(+)
and input.c2 = dim2.c2(+);
I put the where clause in the joiner operator and validate, but that gives me message VLD-1511: A table may be outer joined to at most one other table.
Even splitting this up into one outer join per joiner still gives this message.
A search and look around on the forum and on metalink shows there are related issues (like bug 3334035). Seemingly creating a view is the work-around to use.....? (ie downgrading owb to a simple gui tool) }-;
Have other people experienced this problem of not being able to outer join one input table to multiple other tables?
Thanks,
EdI have had some feedback from Oracle. It turns out this has to do with 2 issues. Below I have pasted the text that Support gave me:
<---------- START QUOTE ---------->
RESEARCH
=========
Bug 3437036 KEY LOOKUP DOES NOT DETECT ORA-1417 IN VALIDATE/GENERATE STEP
Unpublished Bug 4211684 FORWARD PORT OF BUG 3437036
shows:
Some more development has been completed when this bug is fixed in Paris.
The following are the details:
1. If the join condition contains a full outer join such as
tab1.c (+) = tab2.c (+) and tab2.c (+) = tab3.c
then the new validations implemented for this bug do not apply since
in OWB, full outer join triggers generation of joins in ANSI syntax.
ANSI syntax does not have the original problem the base bug of this
bug reported.
2. If the join condition does not contain any full outer join condition,
then the join is generated in Oracle join syntax, which is subject two
several restrictions. The fix to this bug check two of the restrictions.
3. The first restriction in Oracle syntax is that the outer join operator
"(+)" can only directly be attached to a column name. If you attach it
to an expression, such as the following:
(tab1.c + 1) (+) = tab2.c
Then there will be an ORA-936 error at the time of mapping deployment.
For this case, I have added a validation message VLD-1512 to error out
this situation.
4. The second restriction in Oracle syntax is that a table can only be
outer joined to exactly one other table.
For example, this is an invalid join in Oracle syntax:
tab1.c (+) = tab2.c and tab1.d (+) = tab3.d
because tab1 is left outer joined to tab2 and tab3.
But note that the following is still valid in Oracle syntax:
tab1.c (+) = tab2.c and tab1.d = tab3.d (+)
because tab1 is left outer joined to tab2 and right outer joined to tab3.
So this latter case does not violate the restriction that "same oj" to
more than 1 table is not allowed.
If same oj to more than 1 table is specified in a join condition,
VLD-1511 will be issued, and the map is made invalid.
<---------- END QUOTE ---------->
OWB does a partial validation, ie not all access paths are (can be) checked. A full check is only done by the database itself. So some scenarios (like checking whether multiple tables are outer joined the correct way) are not checked, and in this case are flagged with an error (even though it is actually a correct scenario).
Seemingly this was not flagged with an error in earlier versions of OWB, so beware, OWB behaviour may change when upgrading...
Alternative solutions are (1) using key lookups, (2) using a view with all outer joins in there, (3) using intermediate result tables between the joins.
Hope this info helps some people prevent spending too much time on a false error message,
Ed -
Dear Oracle guru's
This is seems to be simple but i couldnt get it right.
I am exploring the features of Oracle 10g and try to implement it .
the thing is how to Join 3 or more tables using the JOIN operator
traditionally we use the following select statement
consider the following tables
EMP table --(Empno,Ename,Deptno,Job,Sal,Grade)
Dept Table (deptno,Dname,Location)
Salgrade (Grade,Gname,Highsal,Lowsal)
Select empno,ename ,dname,Gname
from Emp E ,Dept D,salgrade S
where E.deptno = d.deptno
and e.grade =s.grade
I find this very easy ... but i have been asked to implement new things
how do we do this using 10g's Join
If we have to join two tables like EMP and DEPT i found out from oracle documentation
Select empno,ename,dname
from emp join dept using(deptno)
select empno, ename ,dname from emp e join dept d on e.deptno= d.deptno
Also if i have to do left outer join , i am comfortable with the traditional method of using (+) when using multiple tables
but how to do this using the LEFT OUTER JOIN when i have to join 3 or more tables of which 2 tables have LEFT OUTER JOIN
Consider the following
Select cc.cont_no, cc.instal_no,cc.instal_date , cc.instal_amt
From Cc_Instal_Stru cc,
Dc_Instal_Adj_Dtls dc
Where cc.cont_no = 230300
And cc.cont_no = dc.cont_no(+)
And cc.instal_no = dc.instal_no(+)
how do we go about it using the left outer join ?
With Warm Regards
ssrYes, you really posted this in the wrong forum.
The Join operator is just a different way of restating the SQL that you have done before.
When going with 3 tables, as in your example, you do as something like this -
SELECT empno, ename, dname, Gname
FROM ( Emp E
JOIN
Dept D
On E.deptno = d.deptno)
JOIN
Salgrade S
On E.grade = S.grade
This just makes it clearer what you are really joining on. When using the WHERE clause to specify the joins, you have to think some about what is going on as you try to read the SQL statement.
If wanting to do a LEFT OUTER JOIN, replace the word JOIN with the words LEFT OUTER JOIN (which you have to admit is clearer than the (+) that we have used in the past in explaining what is really happening).
Hope this helps a bit.
John Dickey -
Hi All,
Please help me on the below join condition,
>SELECT * FROM ESTIMATE_LINE WHERE JOB_ID = '214582' AND ESTIMATE_ID = 2;
Output : Returns 1 row,
>SELECT * FROM ESTIMATE_ACCOUNTING_LINE WHERE JOB_ID = '214582' AND ESTIMATE_ID = 2;
Output : Returns 3 rows,
I would like to add these two outputs as on, Finally i've to get 4 rows in the output,
For that am writing the query like this,
SELECT EL.*,EAL.*
FROM ESTIMATE_LINE EL,
ESTIMATE_ACCOUNTING_LINE EAL
WHERE EL.JOB_ID = EAL.JOB_ID (+)
AND EL.ESTIMATE_ID = EAL.ESTIMATE_ID (+)
AND EAL.JOB_ID = '214582'
AND EL.ESTIMATE_ID = 2,
It is not giving the exact output, the common fields are there in the join condition,
Can some one please re write the query for expected output..
I am trying it but not getting the exact output,Unable to find out where the mistake is ...
Thanks,
graHi,
First, let me make sure I undersatnd the problem.
You have a query that lookas for information about a given job_id and estimate_id the estimate_line table. This query produces X rows.
You have another query that lookas for information about the same job_id and estimate_id the estimate_accounting__line table. This query produces Y rows.
You want to get the same results in one query that produces X+Y rows.
That sounds like a job for UNION, not a join.
If the two queries produces the same number of columns, and the data types of the columns are similiar, then you can just write the two queries together. Instead of a semicolon at the end of the first query, you'll say UNION (or UNION ALL):
SELECT * FROM ESTIMATE_LINE WHERE JOB_ID = '214582' AND ESTIMATE_ID = 2
UNION ALL
SELECT * FROM ESTIMATE_ACCOUNTING_LINE WHERE JOB_ID = '214582' AND ESTIMATE_ID = 2;If the columns are not the same, you'll need to call some conversion functions, or add literal columns (such as NULL) to the queries.
If you need help, post a little sampe data (CREATE TABLE and INSERT statements) and the results you want from that data. -
Joining multiple tables using ANSI join
Hi,
I need to join 4 tables using ANSI join. Lets say they are A,B,C adn D. A and B has a common column called x. C and D had a common column called y. I wrote a query like this
select * from A left outer join B on (A.x=B.x),
C left outer join D on (C.y =D.y)
its not working!!!
I need to use ANSI join.
can any body help me please???Hi,
But is there is any common column between A,C or B,C or D,A?
Let me know.
Maybe you are looking for
-
I use symbolic links and program shortcuts as a way to easily open different Firefox profiles ie. one for casual/personal use and another for work. This works well, but I get the "Firefox is already running, but is not responding" error message if I
-
Hp pavillion a6500f product#KQ495AA-ABA windows vista - home premium 64 bit Won't boot
Hi - I cannot boot my desktop hp pavillion. error message says put in an installation disk - don't have. and also says file 32/boot missing or corrupt. tried recovery group of three disks but doesn't do a thing???? Don't want to loose data what i
-
Adobe Acrobat 9 no more updates?
My company has about 50 licenses of Adobe Acrobat 9 (updated to 9.5.5). For a while updates were fast and furious. I checked their website today and saw that V 9.5.5 was "Latest and FINAL release. This patch fixes specific security issues." Does this
-
Is the iphone 4 8 gigabyte the same as all the iphone 4 phones
Is the iphone 4 8 gigabyte the same as all the other iphone 4 phones?
-
Could somebody, please, tell me why iTunes in Brazil does not accept PayPall payment? Is it being intended by Apple?