Is it possible to include an SQL query inside an XML into raw/ directory? For example:
<query name ="mainQuery">SELECT e.*, et.name as name FROM employee e, employee_type et where e.type = et._id and et._id < et._id</query>
or
<query name ="mainQuery" value="SELECT e.*, et.name as name FROM employee e, employee_type et where e.type = et._id and et._id < et._id" />
Both these give errors on XML structure. One workaround is using < and friends, but this really makes no sense as SQL syntax.
Thanks in advance.
Have you looked into putting the query in a comment and then reading the comment from within your activity?
See here: http://www.codeproject.com/Articles/11178/Writing-SQL-queries-in-XML-A-support-intensive-app
You can use CDATA. Example:
<query name ="mainQuery"><![CDATA[SELECT e.*, et.name as name FROM employee e, employee_type et where e.type = et._id and et._id < et._id]]></query>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With