second
second

Reputation: 159

Android OrmLite TableUtils Create View

Using OrmLite, with TableUtils I can create a table, that map my entity in this way

TableUtils.createTable(connectionSource,MyClass.class)

is possible to create a sql tableView?

or I must insert the sql code?

Upvotes: 1

Views: 665

Answers (2)

Wei Lin
Wei Lin

Reputation: 165

I tried code below with SQLite (on memory) and it seems to work fine.

String stmt = "CREATE VIEW viewName AS Select * FROM someTable ;";
foo.getDao().executeRawNoArgs(stmt);

Upvotes: 1

MegaX
MegaX

Reputation: 596

You can select from a view, just like any table, but you can't create views.

Upvotes: 1

Related Questions