SQLite .import can´t make it work

Javier Miranda jemirandav at gmail.com
Mon Nov 20 23:34:23 EST 2017


Friends, please inspect this short script:

*local* tDBPath, tCSVPath

*on* mouseUp

*put* specialFolderPath("documents") & "/aguacab.sqlite" into tDBPath

*put* revOpenDatabase("sqlite", tDBPath, , , , ) into gConnID

*-- Crea Tabla*

*put* "CREATE TABLE asociados (codi char(5), nombre char(120))" into tSQL

revExecuteSQL gConnID, tSQL

*-- Llena tabla con datos.csv*

*put* specialFolderPath("documents") & "/datos.csv" into tCSVPath

*put* ".mode csv" into tSQL

revExecuteSQL gConnID, tSQL

*put* ".import " & tCSVPath & " asociados" into tSQL

*put* tSQL

revExecuteSQL gConnID, tSQL

*end* mouseUp



More information about the use-livecode mailing list