cancel
Showing results for 
Search instead for 
Did you mean: 

SAP PI 7.3 - JDBC Lookup (Select max)

Former Member
0 Kudos

Hi experts,

I need to make a simple query (SELECT MAX( FIELD ) FROM TABLE WHERE FIELD2 = X) using JDBC lookup. From the designer, you can not use MAX

Can be done with a UDF?

What other options are there?

Thanks & Regards

Accepted Solutions (1)

Accepted Solutions (1)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

you can use jdbc sender option and execute select  max. Query if that is feasible. Or jdbc receiver with execute

Statement query option. Only via jdbc lookup it is currently not possible. If you need via lookup follow michal's suggestion.

Answers (3)

Answers (3)

0 Kudos

hi,

     using JDBC look up its not possible u can call single query in sender  communication channel

It will be work

Thanks,

srikanth

ambrish_mishra
Active Contributor
0 Kudos

Hi,

Explain your scenario pls. this is possible through JDBC select from adapter.

Ambrish

Former Member
0 Kudos

Hi,

The scenario is IDOC to JDBC (INSERT). I need insert data in a table but one of theirs fields is a counter that their value is the result of execute the SELECT (MAX) instruction.

Thanks

ambrish_mishra
Active Contributor
0 Kudos

Hi,

You don't need to worry about populating that field. It should increment automatically by definition. Check with database team.

Hope it helps!

Ambrish

Former Member
0 Kudos

Hi,

the field is not an autonumeric.

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>Can be done with a UDF?

yes - it can - don't use the jdbc lookup but just call the DB from java in the normal way

and then you can execute all sorts of DB calls (just make sure the user/pass is passed to the mapping

using parameters from ID and not hardcoded)

Regards,

Michal Krawczyk