cancel
Showing results for 
Search instead for 
Did you mean: 

Datatype structure for data obtained by Joining Multiple tables

Former Member
0 Kudos

Hi ,

I am having two tables Table1 and Table2.Both the tables have 3 fields each.I am combining the results of the two table using JOIN command.My Question is what should be the structure of the Target Data type obtained by combining two tables .In Specific Order of the Fields to be mentioned in data type defnition.

Example:

Employee Table:EmpId,EmpName,EmpDOB

Company Table:CompanyRegistration No.,CompanyName,CompanyAdress

Thanks,

Yeshwanth

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi all,

Thanks all for ue Reply,

Regards,

Yeshwanth

Former Member
0 Kudos

I need some more information about it

Former Member
0 Kudos

Just create a data type with fields from both the table as you would create for 1 table.

Ex:

<row>

</EmpId>

</EmpName>

</EmpDOB>

</CompanyRegistration No>

</CompanyName>

</CompanyAdress>

</row>

P.S: You dont have to post your entire question in bold.

Former Member
0 Kudos

Hi JaiShankar,

Thanks for your reply.

I am writng query as below:

SELECT Emptable.EmpId, Emptable .EmpName,Emptable.DOB,CmpTable.Company Registration No,CmpTable.Company name,CmpTable.Adress from Emptable,CmpTable

Will the data type structure be the same you mentioned or do i need to make any changes to structure of data type?.

Thanks,

Yeshwanth

balaji_pichaimuthu
Active Participant
0 Kudos

Hi,

Create the datatype like below

<row>

</Emptable>

</EmpId>

</EmpNam>

</DOB>

</Company Registration No>

</Company name>

</Company Address>

</row>

regards,

Balaji

Former Member
0 Kudos

Hi ,

In the data type structure you have mentioned there is only emptable and there is no company table.So should i need to mention cmpTable name in the structure or not.

Thanks,

Yeshwanth

balaji_pichaimuthu
Active Participant
0 Kudos

Hi,

</Company Registration No>

</Company name>

</Company Address>

the above fields from cmpTable right??

Regards,

Balaji

Edited by: Balaji Pichaimuthu on May 26, 2010 12:11 PM

Former Member
0 Kudos

Hi Balaji,

Thanks for your Reply.

Yes all three fields are from the cmpTable.

In the structure you have not mentioned the CmpTable name i.e. </CMpTable>.So should i need to mention it in the data structure.

<row>

</Emptable>

</EmpId>

</EmpNam>

</DOB>

</CmpTable>

</Company Registration No>

</Company name>

</Company Address>

</row>

Is this the correct way of defining data structure?

balaji_pichaimuthu
Active Participant
0 Kudos

Hi,

The field CmpTable is not needed..

REgards,

Balaji