In my Rails app, I should import data beetwen two database. I would make a select on MS SQL Server(external server), then insert into SQLite (embedded)
To connect to SQL Server i'm using "tiny_tds" and "activerecord-sqlserver-adapter" gem's and select is working fine.
The code to do this :
def fetch_rows
client = TinyTds::Client.new(username: 'MyUser', password: 'foo', host: 'MyServer', database: 'MyDB')
client.execute("SELECT id_person, name, surname FROM [MyDB])
end
- Now, how could I "INSERT INTO" my data in SQLite ?
- Is "SQL way" the right way ?
- Did you know something easier ?
- Very important, it's a daily update, not just one shot !
Many thanks in advance for your help !
Nicolas