on 01-10-2008 2:43 PM
Hi all,
In PI, I would like to translate this SQL Query in a select statement :
SELECT * FROM Table1
WHERE FIELD1 = val1 AND FIELD2 = val2
ORDER BY FIELD3 DESC
No problem for the beginning of the select statement with help of the following blogs :
/people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step
/people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30
it gives :
<StatementSelect>
<table name>
<access>
<col1>
<col2>
</access>
<Key>
</key>
</tablename>
My question is : How to implement the function ORDER BY in the key element ?
I was thinking about something like this :
<Key>
<Order_by>
<column_name>
</order_by>
<order_clause>DESC</order_clause>
</key>
or
<Key>
<order_clause>FIELD3</order_close>
</key>
But it seems that FIELD3 must be in the select condition...
Can someone help me plz ?
Thank you.
Edited by: Jean-Philippe PAIN on Jan 10, 2008 5:29 PM
Edited by: Jean-Philippe PAIN on Jan 10, 2008 5:30 PM
Hi !
Check the "SQL_Query" action type in this document
http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
I think you will need to type the query in "raw" mode with placeholders.
Example:
<root>
<stmt>
<myTable action="SQL_QUERY">
<access> SELECT * FROM Table1
WHERE FIELD1 = $val1$ AND FIELD2 = $val2$
ORDER BY FIELD3 DESC
</access>
<key>
<val1>value 1</val1>
<val2>value 2 </val2>
</key>
</myTable>
</stmt>
</root>
Regards,
Matias.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jean,
You can try by directly passing the SQL-Query isn't it?
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.