Questions tagged as 'sqlite'

2
answers

Is it redundant to use LIMIT in a QUERY whose ID is a primary key?

My question is if using LIMIT will there be some performance gain in QUERY . Example: SELECT descricao FROM produto WHERE id = 9999 LIMIT 1 Has better performance than? SELECT descricao FROM produto WHERE id = 9999...
asked by 17.05.2015 / 01:57
1
answer

Is the "row ID" the same as the primary key?

The insert of Android returns a row ID according to the documentation,    the row ID of the newly inserted row, or -1 if an error occurred The row ID corresponds to the primary key, ID , if it exists?     
asked by 23.11.2017 / 12:40
1
answer

Is there a way to open a straight SQL table in a data.table without doing the SQL data.frame data.table path?

I want to open a straight SQL table in a data.table. When I query with dbGetQuery , what I get is a data.frame. I know I can later turn that data.frame into a data.table easily. But I'd like to skip this step - which on some occasions may...
asked by 19.09.2014 / 13:27
2
answers

Prevent DROP TABLE

I would like to prevent deletions in a table in SQLite. CREATE TRIGGER nao_deletar_tabela BEFORE DELETE ON tabela BEGIN SELECT RAISE(IGNORE); END; It worked! Whenever a DELETE is executed, nothing happens. The problem and...
asked by 31.10.2014 / 12:39
2
answers

Where to find the path of the android database?

SQLiteDatabase BancoDados = null; String NomeBanco = "Cadastro"; CriaBanco(); public void CriaBanco(){ try{ BancoDados = openOrCreateDatabase(NomeBanco, MODE_WORLD_READABLE, null); String SQL = "CREAT...
asked by 29.06.2015 / 20:56
1
answer

Order by command with accent in SQLite

I'm programming for Android and using the native database ( SQLite ). I want to make a query in the table of products sorted by name, but when doing SELECT like this: SELECT * FROM produtos ORDER BY nome; it returns, for exampl...
asked by 31.10.2018 / 19:24
1
answer

SQLite and MySQL Synchronization

I have an application in which I have a database using SQLite and an external service using MySQL. Basically it is a task application, in which I can create a task in offline mode . When the user owns internet it will already automatically send...
asked by 05.12.2016 / 14:06
3
answers

Laravel: Migrations

I have a question about Laravel's Migrations and I believe they can help me. 1 - I created a model with migration by php artisan make:model Evento -m; 2 - In addition to increments and timestamps I added one more field to the migrat...
asked by 12.09.2015 / 23:43
0
answers

Save multiline text in Blob field in SQLite [closed]

I would like to help with this issue of saving% multiline in a blob field in SQLite database, because when I add in EditText in the database it saves the texts in Blob Editor with dot end Text Editor of the blob, only saves the fi...
asked by 17.12.2015 / 11:52
1
answer

Problem to execute a SQLite query [closed]

Table declaration @DatabaseTable(tableName = "alarmes") public class ListenerAlarme { @DatabaseField(generatedId = true) public long id; @DatabaseField(canBeNull = true) public Date dataAlarme; @DatabaseField(canBeNull = true) public boole...
asked by 27.07.2015 / 21:28