on 01-30-2011 4:50 PM
Hi,
I am using the receiver JDBC query structure as,
<Satement>
<Table>
<Action>
<Access>
</Access>
<key> 1</key>
<key> 2</key>
<key> 3</key>
Means..i am simulating the query like
Select ( fields) from Table tablename where key = 1 or key = 2 or key = 3 or....etc
Question:
for this i need to add the ORDER BY condition.
I know that we can do this using DML oprations..But my question is how can we define container variable in in the DML query if the key values are multiple and that too it should work like or condition...
Thanks,
Krish
Hi Murali Krishna,
As far as I know, it is not possible.
If <NAME>Company1</NAME> occurrence in dynamic (0..Unbound), it is not possible to construct the SQL_QUERY.
Please note, the placeholder should have only one NAME, it should not be like this
<NAME>Company1</NAME>
<NAME>Company2</NAME>
It can be
<NAME_1>Company1</NAME_1>
<NAME_2>Company2</NAME_2>
As last option, you can check Native SQL [Link2|http://help.sap.com/saphelp_nwpi711/helpdata/en/44/7c24a75cf83672e10000000a114a6b/frameset.htm]
Regards,
Raghu_Vamsee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Murali Krishna,
As suggested by 'Baskar Gopal', you can use SQL_QUERY [SAP Help Link|http://help.sap.com/saphelp_nwpi711/helpdata/en/44/7b7855fde93673e10000000a114a6b/frameset.htm]
Mapping program should generate XML structure which is present in link.
Regards,
Raghu_Vamsee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Select Query using multiple key values, OR condition, Order by using SQL_QUERY . I implemented like this and works.
Sample Query....
<root>
<stmt>
<Customers action="SQL_QUERY">
<access> Select * from Customers where Name=u2019$NAME$u2019 or Address=u2019$ADDRESS$' or Zipcode='$ZIPCODE$u2019 order by Name
</access>
<key>
<NAME>Company</NAME>
<ADDRESS>Street 3 </ADDRESS>
<ZIPCODE>CO</ZIPCODE>
</key>
</Customers>
</stmt>
</root>
Hope I answered your question.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Basker,
No.(Multiple key values dosn't mean the all value in same Key) I am looking for the below query
<root>
<stmt>
<Customers action="SQL_QUERY">
<access> *Select * from Customers where Name=u2019$NAME$u2019 or Address=u2019$ADDRESS$' or Zipcode='$ZIPCODE$u2019 order by Name*</access>
<key>
<NAME>Company1</NAME>
</key>
<key>
<NAME>Company2</NAME>
</key>
....
....
<key>
<NAME>Company200</NAME>
</key
</Customers>
</stmt>
</root>
How can we represent the above query using DML..??
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.