使用 SQL 更新 FileMaker 时间戳字段

发布于 2024-11-14 05:38:21 字数 308 浏览 9 评论 0原文

我需要使用从 PHP 获取的时间戳更新 FileMaker 时间戳字段,并使用 PHP API 和执行 SQL API 和插件将其放入脚本中,

因此

UPDATE table SET time ='2011-05-27 11:28:57' 

我的问题如下,如何利用 Filemaker Pro 11 中的可用脚本函数将在 SQL 语句中以 FileMake 可接受的时间戳格式提供的字符串?或者是否可以使用 FileMaker 的executeSQL 插件在执行SQL 插件的ExecuteSQL() 函数内进行转换?

I need to update a FileMaker Timestamp field with a timestamp taken from PHP and put into a script using the PHP API and executeSQL API and plugin

so

UPDATE table SET time ='2011-05-27 11:28:57' 

My Question is as follows, how do I utilise the available scripting functions within Filemaker Pro 11 to convert the string that is being supplied within the SQL statement to an acceptable TimeStamp format for FileMake? or is it possible using the executeSQL plugin for FileMaker to do the conversion within the ExecuteSQL() function within the Execute SQL plugin?

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

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

发布评论

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

评论(2

眼睛会笑 2024-11-21 05:38:21

我还没有尝试过,但它应该使用 CAST 工作:

CAST( expression AS type [ (length) ] )

所以,它应该显示为:

UPDATE table SET time = CAST ('2011-05-27 11:28:57' AS TIMESTAMP)

但是,请注意 Filemaker 自己的 ExecuteSQL() 函数不支持 UPDATE 或 INSERT INTO 语句。为了执行此操作,您需要从 Dracoventions 获取名为 epSQLExecute() 的免费扩展。

希望这对(某人)有帮助。

加里

I haven't tried it out, but it should work using CAST:

CAST( expression AS type [ (length) ] )

so, it should read:

UPDATE table SET time = CAST ('2011-05-27 11:28:57' AS TIMESTAMP)

However, please be aware that Filemaker's own ExecuteSQL() functions doesn't support UPDATE or INSERT INTO statements. You need to get a free extension from Dracoventions called epSQLExecute() in order to do this.

Hope this helps (someone).

Gary

逆蝶 2024-11-21 05:38:21

您没有给我们太多信息,但我的猜测是您正在使用与所需格式不匹配的字符串更新时间戳列。

您应该将字符串转换为适当的对象,然后更新应该可以工作。

You haven't given us much to go on, but my guess would be that you are updating a timestamp column with a string that does not match the required format.

You should convert your string to the appropriate object and then the update should work.

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