控制文件中的时间戳

发布于 2024-07-04 09:47:06 字数 152 浏览 6 评论 0原文

我有一个脚本,它采用表名并通过查询表的所有列/行来生成控制文件。 这适用于数字和字符数据,但不适用于时间戳数据,因此我需要调整脚本以将时间戳数据输出到控件中,以便可以正确读取它。

所以本质上,我的问题是如何格式化控制文件中的时间戳数据,以便可以将其输入到时间戳列中。

I have a script that takes a table name and generates a control file by querying all the columns/rows the table. This works fine for numeric and character data but fails on timestamp data so I need to adjust the script to output the timestamp data into the control in such a way that it can be read in properly.

So essentially, my question is how to format TimeStamp data in a control file so that it can be inputed into a TimeStamp column.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

椒妓 2024-07-11 09:47:06

您需要在列列表中使用 to_date,如下所示 在这里。 就像是:


LOAD DATA
INFILE *
INTO TABLE some_table
FIELDS TERMINATED BY ","
(  col1
   col2        "to_date(:col2, 'YYYY-MM-DD HH24:MI:SS')"
)
BEGINDATA
foo,2008-09-17 13:00:00
bar,2008-09-17 13:30:05

You need to use to_date in your column listing as demonstrated here. Something like:


LOAD DATA
INFILE *
INTO TABLE some_table
FIELDS TERMINATED BY ","
(  col1
   col2        "to_date(:col2, 'YYYY-MM-DD HH24:MI:SS')"
)
BEGINDATA
foo,2008-09-17 13:00:00
bar,2008-09-17 13:30:05

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文