导入SQL对于SQLite [英] Importing SQL to SQLite

查看:202
本文介绍了导入SQL对于SQLite的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在SQL格式的数据库,我需要做的SQLite的副本,以增加它在Android应用我做。

I have a database in sql format, and I need to make an sqlite copy in order to add it in an Android App I'm making.

到目前为止,我还没有得到任何东西为我工作。我试图导入到SQL SQLite数据库浏览器,但它没有正确导入,它总是给了一个错误的语句。我试图创建一个数据库,然后导入的表,但它坠毁。

So far, I haven't got anything working for me. I tried to import the sql into SQLite Database Browser but it doesn't import properly, it always gives out an error statement. I tried creating a database then import the tables but it crashed.

我试图通过终端使用sqlite3的(我使用的是Mac,如果这将使任何区别),但是.IMPORT文件表格式不工作,它说:错误:没有这样的表:表。我试过一个空表使用CREATE TABLE test42再创造.IMPORT TEST.SQL test42和变体,但它说:错误:附近的测试:语法错误

I tried using sqlite3 via Terminal (I'm using a Mac if that would make any difference), however the .import FILE TABLE format doesn't work, it says: "Error: no such table: TABLE". I tried creating an empty table using "create table test42" then ".import test.sql test42 and variants but it says "Error: near "test": Syntax error".

我卡住了。

任何帮助将极大地帮助。谢谢你。

Any help would greatly help. Thanks.

推荐答案

我最终什么事做的是出口的每个表为CSV,这给我的表值。
所有我需要做的就是修改表头和我有我的SQLite文件来完成。
这是一个有点费时,但没有最终的伎俩。

What I ended up doing is exporting each table as a CSV, which gave me the table values. All I needed to do then is modify the table headers and I had my sqlite file done. This was a bit time consuming, but did the trick in the end.

这篇关于导入SQL对于SQLite的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆