· 9 years ago · Dec 06, 2016, 11:54 PM
1package com.example.miguel.financialcare.Database;
2
3import android.content.Context;
4import android.database.sqlite.SQLiteDatabase;
5
6
7public class ScriptCategorias
8{
9 private SQLiteDatabase db;
10 private FinancialDB financialDB;
11
12 public ScriptCategorias(Context context)
13 {
14 financialDB = new FinancialDB(context);
15 }
16
17 public static String getCreateCategoria()
18 {
19 StringBuilder sqlBuilder = new StringBuilder();
20 sqlBuilder.append(" CREATE TABLE IF NOT EXISTS CATEGORIA ( ");
21 sqlBuilder.append("_id INTEGER NOT NULL ");
22 sqlBuilder.append("PRIMARY KEY AUTOINCREMENT, ");
23 sqlBuilder.append("NOME VARCHAR(20) ");
24 sqlBuilder.append(");");
25
26 return sqlBuilder.toString();
27
28 }
29
30}