Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/324.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 将大型SQL文件导入本地Firebird数据库_Python_Firebird - Fatal编程技术网

Python 将大型SQL文件导入本地Firebird数据库

Python 将大型SQL文件导入本地Firebird数据库,python,firebird,Python,Firebird,我正试图通过模块将一个大型SQL文件(15k+语句)导入到一个新的本地Firebird数据库中 我还没有找到更好的方法。。。(就像在sqlite3模块中使用一种executescript(),每次调用执行多个语句) 它在最初的几个语句中工作,然后停止并引发异常: fdb.fbcore.DatabaseError: ('Error while executing SQL statement:\n- SQLCODE: -104\n- Dynamic SQL Error\n- SQL error co

我正试图通过模块将一个大型SQL文件(15k+语句)导入到一个新的本地Firebird数据库中

我还没有找到更好的方法。。。(就像在sqlite3模块中使用一种
executescript()
,每次调用执行多个语句)

它在最初的几个语句中工作,然后停止并引发异常:

fdb.fbcore.DatabaseError: ('Error while executing SQL statement:\n- SQLCODE: -104\n- Dynamic SQL Error\n- SQL error code = -104\n- Client SQL dialect 0 does not support reference to BIGINT datatype', -104, 335544569)

根据我在Firebird文档中读到的内容,我必须使用SQL方言3才能在表模式中使用BIGINT数据类型。我已经用
fdb.create_database()
默认参数正确设置了数据库SQL方言3,但我仍然需要设置客户端SQL方言,我不知道在哪里以及如何设置。我在OS X上使用Firebird 2.5.2和Python 2.7.2。

将大型sql文件导入Firebird数据库的更好方法是使用

,据我所知,
fdb
应默认为方言3,但您可以使用连接属性方言=3显式指定它,请参见中的示例2。奇怪的是,Firebird中没有方言0

如果这确实解决了问题,我建议您在问题跟踪器中提交一个bug,因为驱动程序应该默认为方言3:

isql-user sysdba-pass 不能100%确定以上语法是否完全正确


isql-user sysdba-pass test.fdb耶,方言0表示没有设置方言,这有点奇怪。。。我遵循了你的建议,在他们的追踪器中记录了一个错误:
fdb.fbcore.DatabaseError: ('Error while executing SQL statement:\n- SQLCODE: -104\n- Dynamic SQL Error\n- SQL error code = -104\n- Client SQL dialect 0 does not support reference to BIGINT datatype', -104, 335544569)