When you update data in the Form painter, InfoMaker builds a SQL UPDATE statement in the background. The DateTime parameter determines how InfoMaker specifies a DateTime datatype when it builds the SQL UPDATE statement. (A DateTime datatype contains both a date value and a time value.)
JDB JDBC
ODBC
O90 Oracle9i
O10 Oracle 10g
ORA Oracle 11g
The syntax you use to specify the DateTime differs slightly depending on the database.
The Database Profile Setup dialog box inserts special characters (quotes and backslashes) where needed, so you can specify just the DateTime format.
In code, you must use the following syntax:
JDBC and ODBC syntax InfoMaker parses the backslash followed by two single quotes (\'') as a single quote when it builds the SQL UPDATE statement.
DateTime=' \''DateTime_format\'' '
Oracle syntax InfoMaker parses each set of four consecutive single quotes ('''') as a single quote when it builds the SQL UPDATE statement.
DateTime=' ''''DateTime_format'''' '
The default value for DateTime depends on the DBMS you are accessing, as summarized in the following table:
DBMS |
Date default value |
---|---|
JDBC |
If no value is specified for the DateTime database parameter, InfoMaker looks for a DateTime format in the section for your JDBC driver in the registry. If no DateTime format is found in the registry, InfoMaker uses the JDBC DateTime format escape sequence. |
ODBC |
If no value is specified for the DateTime database parameter, InfoMaker looks for a DateTime format in the section for your ODBC driver in the PBODB115 initialization file. If no DateTime format is found in the initialization file, InfoMaker uses the ODBC DateTime format escape sequence. |
Oracle |
The default Oracle DateTime format. For information, see your Oracle documentation. |
Assume you are updating a table named Files by setting the Timestamp column to 4/2/03 3:45 pm. This DateTime is represented by the following DateTime format.
Example 1 (ODBC and JDBC syntax) To specify that InfoMaker should use this format for the DateTime datatype when it builds the SQL UPDATE statement, type the following in the DateTime Format box on the Syntax page in the Database Profile Setup dialog box:
m/d/yy h:mm am/pm
What happens InfoMaker builds the following SQL UPDATE statement to update the table:
UPDATE FILES
SET TIMESTAMP = '4/2/03 3:45 pm'
Example 2 (Oracle syntax) To specify that InfoMaker should use this format for the DateTime datatype when it builds the SQL UPDATE statement, type the following in the DateTime Format box on the Syntax page in the Database Profile Setup dialog box:
m/d/yy h:mm am/pm
What happens InfoMaker builds the following SQL UPDATE statement to update the table:
UPDATE FILES
SET TIMESTAMP = '4/2/03 3:45 pm'