sql - 如何在 SSIS 中截断多个表(使用 ADO.NET 目标和 Oracle 数据库)

标签 sql oracle ssis ado.net truncate

我在 SSIS 中遇到了一些麻烦。我有多个表,我想添加 Truncate 语句,以便该表无法创建双数据。

这是我制作的包的图像:

http://i63.photobucket.com/albums/h140/cindylolietra/17027495-bb91-4f8c-a660-c5eebab904ba_zps64ac0ad9.png

每个数据流,我使用平面文件源和 ADO NET 目标。

然后,在执行 SQL 任务中我想应用截断表

http://i63.photobucket.com/albums/h140/cindylolietra/truncate2_zps1b39513d.png

之后,我收到错误消息:

"[Execute SQL Task] Error: Executing the query "truncate table Table1 truncate table Tabl..." failed with the following error: "ERROR [HY000] [Oracle][ODBC][Ora]ORA-00911: invalid character". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly."

我必须做什么?

附注 抱歉,如果我的英语不好

最佳答案

由于目标是 Oracle 数据库,您应该使用以下语法:

begin
   execute immediate 'truncate table t1';
   execute immediate 'truncate table t2';
end;

关于sql - 如何在 SSIS 中截断多个表(使用 ADO.NET 目标和 Oracle 数据库),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22653018/

相关文章:

sql - ORA-01446 - 无法从带有 DISTINCT、GROUP BY 等的 View 中选择 ROWID

sql-server - SSIS 中的动态平面文件连接字符串

c# - 这是 SSIS 用例吗? (SSIS 的新手)

php - SQL中按2个条件排序?

sql - 如何获取 oracle 多边形集合的一小部分

mysql - 在 SQL 数据库中构建具有可选字段的表的最佳方法是什么?

oracle - 不带参数调用 Oracle 存储过程

sql-server - 使用 "There is a compilation error. Do you want to save anyway"消息保存后,C# 代码从脚本任务中消失

sql - 修剪空白而不影响内部空白

mysql - 如何在 Mysql workbench 中创建零或一对多关系