DatabaseServices.makeJDBCTimestampStringFromField

Creates a SQL escape string in the format {ts 'yyyy-mm-dd hh:mm:ss.fff'} from a form field of type Date, DateTime or Time. An Ebase field of type DateTime is equivalent to a database timestamp column. This method can be used in conjunction with the #executeGenericUpdateStatement(String, String) or #executeSelectStatement(String, String, SelectStatementCallback) methods;

Example:

 var ts1 = new Date();
 var stmt = "update orders set order_timestamp = "
    + services.database.makeJDBCTimestampStringFromField(fields.orderTimestamp)
    + " where order_id = " + orderId; 
 services.database.executeGenericUpdateStatement("SAMPLES", stmt); 
 

returns java.lang.String

Parameters

Field field,