Categories
SqLite

How to fix/open Unable to open database “xxxxxsqlite”: file is encrypted or is not a database ?

It means that your are trying to open with SQLITE rather than SQLITE 3

Categories
SqLite

How to add a new column to an existing sqlite database (sqlite3) ?

ALTER TABLE table_name ADD COLUMN column_definition;

Categories
MySql SqLite

SQLITE – update a column from another table

SQLITE – update a column from another table while concatenating a string

UPDATE table1
SET table1.businessOwner =  table1.prenom1UniteLegale || ' ' || table1.nomUniteLegale, 
BusinessNameDavid = table1.denominationUniteLegale ,
BusinessAddressDavid = table1.numeroVoieEtablissement || ' ' || table1.typeVoieEtablissement || ' ' || table1.libelleVoieEtablissement 
from table2 
WHERE table1.siren = table1.siren 
Categories
Laravel SqLite

SQLITE – Auto-increment a column with Laravel

Example : for SQLITE the double quote is critical to make it work

Polls::updateOrInsert(['business_id'=> $business_id],
    [
        "$vote_value" => DB::raw('"$vote_value" + 1'),
        'polls_name' => $theBusiness->BUSINESSNAME,
        'source' => env('APP_CODE'),
        'updated_at' => $lastupdated
    ]);
Categories
MySql SQL SqLite

How to SQLite ? beginner

Download page

Download Page SQLITE

Basic Commands

GUI SQLITE

–> execute sqlite excutable from downladpage

sqlite

Import CSV data to SQlite

.mode csv
.import csvfilename databaseName

Quit SQlite

.quit