GreenDao executes SQL statements and greendaosql statements
The method http://greendao-orm.com/documentation/queries/ provided in the document can not meet the needs, has limitations, the use of the following statements to operate is very flexible
String SQL = "select * from" + xxxDao;
Cursor c = session. getDatabase (). rawQuery (SQL, null );
How to execute SQL statements
After installing SQL 2000
Start-> All Programs-> Microsoft SQL Server-> query analyzer enter the corresponding database name (if you forget to enter start-> All Programs-> Microsoft SQL Server-> Server management view)) the user name and password can be used to compile and execute the SQL language.
How to automatically execute an SQL statement
Oracle:
1. Add a new batch file, such as a. bat.
2. Add an SQL script file, such as a. SQL
3. In a. bat, enter the sqlplus user name/password @ C: \ a. SQL (assume that a. SQL is in the c: root directory)
4. Run this batch to execute this SQL script.
Assume that the content of a. SQL is exec autojob; select * from scott. emp; select * from scott. dept;
Then you can execute the statement by statement.
SQL Server:
Isql-U username-P password-I c: \ a. SQL
Similarly, in the bat file, enter the above line and enter the script in a. SQL.
For example:
Use Database Name
Go
Select * from Table Name
Go