我正在尝试将一组平面文件导入 SQL 服务器数据库。我下载并安装了适用于 Mac OS 的 Oracle SQL Developer。我安装了正确的插件,可以很好地连接到数据库、创建表和执行查询。问题是我正在尝试使用批量插入将一些制表符分隔的文件导入数据库。但问题是,批量插入似乎不起作用。批量插入代码如下
BULK INSERT sessions
FROM '/.../sessions.txt'
WITH (FIELDTERMINATOR='\t',ROWTERMINATOR='\n')
这是我得到的错误日志
Error starting at line 1 in command:
BULK INSERT sessions
Error at Command Line:1 Column:0
Error report:
SQL Error: Incorrect syntax near 'sessions'.
Error starting at line 2 in command:
FROM '/..../sessions.txt'
Error at Command Line:2 Column:0
Error report:
SQL Error: Incorrect syntax near the keyword 'FROM'.
Error starting at line 3 in command:
WITH (FIELDTERMINATOR='\t',ROWTERMINATOR='\n')
Error at Command Line:3 Column:0
Error report:
SQL Error: Incorrect syntax near '('.