on 08-12-2008 3:22 PM
I am trying to create a SELECT statement where I use a date range for the same date column, I am having a difficult time creating an AND for the same column I thought maybe you guys could help, here is the XML I have so far.
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_JDBC_TRDHEADER_REQ xmlns:ns0="http://citgo.com/JDBC_to_CSL">
<STATEMENT>
<TABLENAME ACTION="SELECT">
<TABLE>qa_citgo_baseline.trd_header</TABLE>
<ACCESS>
<TRADE_NUM/>
<DEAL_NAME_STR/>
<COUNTERPART_COMPANY_NUM/>
<TRADE_TYPE_CD/>
<STRATEGY_NUM/>
<TRADE_INPUT_DT/>
<TRADE_DT/>
<ACCOUNTING_CLASS_CD/>
</ACCESS>
<KEY>
<TRADE_DT compareOperation="GTEQ">01-Jan-2008</TRADE_DT>
</KEY>
<KEY1>
<TRADE_DT compareOperation="LTEQ">08-Jan-2008</TRADE_DT>
</KEY1>
</TABLENAME>
</STATEMENT>
</ns0:MT_JDBC_TRDHEADER_REQ>
Is there anyway to do an AND instead of an OR.
Thanks
hi,
yes its posible:
see this
<StatementName1>
<dbTableName action=u201DUPDATEu201D | u201CUPDATE_INSERTu201D>
<table>realDbTableName</table>
............<access>
..................<col1>val1</col1>
..................<col2>val2new</col2>
............</access>
............<key1>
..................<col2>val2old</col2>
..................<col4>val4</col4>
............</key1>
............<key2>
..................<col2>val2old2</col2>
............</key2>
......</dbTableName>
</StatementName1>
UPDATE dbTableName SET col1=u2019val1u2019, col2=u2019val2newu2019 WHERE ((col2=u2019val2oldu2019 AND col4=u2019val4u2019) OR (col2=u2019val2old2u2019))
the key1 represent "AND" and the key2 represent OR in the SQL query before. see this link please to undestand ir more clear
http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
in your case your query means
<KEY>
<TRADE_DT compareOperation="GTEQ">01-Jan-2008</TRADE_DT>
</KEY>
<KEY1>
<TRADE_DT compareOperation="LTEQ">08-Jan-2008</TRADE_DT>
</KEY1>
<TRADE_DT compareOperation="GTEQ"> OR <TRADE_DT compareOperation="LTEQ">
in your case, you cannot use AND and OR in same query because your field is the same, just the value change. you only can use OR.
thats your doubt??
Thanks
Rodrigo
Edited by: Rodrigo Alejandro Pertierra on Aug 12, 2008 11:57 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I dont know how its possible........... bcoz its internally it use OR between two Key nodes.
Check this:
http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
Thanks,
Mahi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
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.