cancel
Showing results for 
Search instead for 
Did you mean: 

JCo - Single Search JOIN tables

michael_pang4
Active Participant
0 Kudos

Hi MDM gurus,

I'm quite new to the MDM JCo API, and I'm trying to do do a search based on two tables.

E.g. I have two tables

Table A has fields F1(key), F2 (foreign key)

Table B has fields F2(key), F3

Is it possible to do 'One single search' on these tables where F1 = F1value

but getting results: AF1, AF2, B~F3 in a ResultSet?

Currently the only way I know to do this is first Search Table A where F1 = F1value.

Loop through the results and Search Table B.

This is very inefficient coding where in SQL or in ABAP you can do this with one line of code.

Any help would be appreciated! Code would be a bonus!

Cheers,

Michael.

Accepted Solutions (0)

Answers (2)

Answers (2)

michael_pang4
Active Participant
0 Kudos

Hi Mausam,

I looked at the blog, and looked at the Free Form searches.

It appears I can search for a fields value where field EQUALS value.

However I can't do a JOIN.

Select * from A, B

where AF2 = BF1.

Hope this clarifies my question.

Cheers,

Michael.

Message was edited by:

Michael Pang

Former Member
0 Kudos

Hi Michael,

Sorry for mistunderstanding the question.

I dont see any APIs as of now to do that as all the search function finally takes one Search object or one ResultSetDefinition object.

Regards,

Mausam

Former Member
0 Kudos

Hi Michael,

You can use Free Form Search for doing the same. <a href="http://jakarta.apache.org/poi/hwpf/index.html">This</a> weblog would be the best available guide for the same.

For quering multiple tables, you can add one more table parameter by this line,

FreeFormTableParameter table_products=

search.GetParameters().NewFreeFormTableParameter("Products");

FreeFormTableParameter table_accounts=

search.GetParameters().NewFreeFormTableParameter("Accounts");

and then specify the parameter for each Table instance according to your requirement.

Hope this helps.

Thanks and Regards,

Mausam

michael_pang4
Active Participant
0 Kudos

Hi Mausam,

Think your link to the weblog is wrong. It took me to an apache site!

Thanks for your help!

Cheers,

Michael.

Former Member
0 Kudos

Here you go.

/people/andreas.seifried/blog/2006/03/26/performing-free-form-searches-with-mdm-java-api

Regards,

Mausam