Search code examples
sqlfilemaker

FileMaker TimeStamp field UPDATE using SQL


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?


Solution

  • 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