on 04-13-2015 4:14 PM
Hi All,
I am using SAP MII 14.0 version & working on MDO's
I am writing a select MDO query to fetch data from a Custom Persistant MDO
This MDO has five fields out of which 4 are string variables & one is a Date time variable
Now, when i filter the Query based on Date time, Its gives me issues
I am giving the condition as below in the filter Expression tab:
[INSERT_DATE] >='[Param.1]' AND [INSERT_DATE]<='[Param.2]' where INSERT_DATE is date time variable
In the Parameters of the Template i give the values for the two parameters say 03/01/2015 00:00:00 and 03/10/2015 00:00:00 as i used the same format to populate the MDO
When i execute the Query, it gives me the below error:
java.sql.SQLException: Error while processing the template TMP452bc540-e1ee-11e4-83f1-d0b90a3b5f3b - 1:69 - type check error: the left hand side >>INSERT_DATE.< (TIMESTAMP) and the right hand side >>'?'<< (CHAR) of a comparison operator are not comparable
- 1:86 - type check error: the left hand side >>INSERT_DATE.< (TIMESTAMP) and the right hand side >>'?'<< (CHAR) of a comparison operator are not comparable
Although the same process gives proper results for a MII SQL Query template
Also, i tried to remove the Quotes in the Filtering Condition, then it gives the below error
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
Could any one kindly help me understand this or give me a solution???
Thanks!!
Best Regards
Praveen
Hi Praveen,
Please check if you've enabled the TYPE PARAMETERS- you can check that and set the parameter type as timestamp for both param1 and param2 and then you can test. You need to set the parameter type.
Hope this helps.
Regards
Rajeev
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Praveen,
This reminds me of, MDOs have been designed on open SQL concept, so it should take commands irrespective of the DB type.
In such scenarios, it's better to channel the complex parameters in a standard way.
Consider a scenario where you develop a product using MII that utilizes MDOs as well. Your system has SQL db and you have two clients, one uses SQL and another uses Oracle, so the same product won't be able to work for both if you supply either of Cast(dateString as Datetime) or to_date(dateString,<format>). In such scenarios, using typed parameters would be apt.
For SQL, it's very much, objects created for in a specific type of DB and hence both the ways are permissible.
This probably is a reason. Hope it helps.
Thanks,
Swaroop
User | Count |
---|---|
11 | |
6 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.