cancel
Showing results for 
Search instead for 
Did you mean: 

Reg:JDBC Select Key

Former Member
0 Kudos

Hi...

I am having mapping problem while doing jdbc scenario.

in oracle table, i am having name,id,active,enable.

The active and enable fields will have values 1 or 0

Name ID Active Enable

Test1 1 1 1

Test2 2 0 0

i need to select all the names where active = 1 and 0 and same for enable = 1 and 0

suppose if the input to the jdbc request is null, then ,

Can you please tell how to use the key field in JDBC request.

select--action

tablename--table

access

Name

ID

Active

Enable

key

?

Can you tell me how to define the key value?

Thanks & Regards,

Leela

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

you need to use or like this for Active =1 or Active=0 and for enable=1 or enable=0

<key1>

<active>1</active>

<enable>1</enable>

</key1>

<key2>

<active>0</active>

<enable>0</enable>

</key2>

<key3>

<active>0</active>

<enable>1</enable>

</key1>

<key4>

<active>1</active>

<enable>0</enable>

</key2>

Former Member
0 Kudos

Hi....

Thank you. I got the output. I have done what you suggested.

Thanks

Leela

Answers (1)

Answers (1)

prateek
Active Contributor
0 Kudos

Use multiple key nodes with the same field name. In you case, create it twice. While mapping, pass value = 1 in first case and 0 in second case.

From help.sap

Column values within a <key> element are combined with a logical AND; different <key> elements are combined with a logical OR.

Regards,

Prateek