This allows multiple data stores but without rewriting all sql queries. Note you have to create two functions, one to accept dates, the other to accept times. Specifically the 4D SQL function DATE_TO_CHAR. Luckily PostgreSQL has the equivalent as a formatting function to_char. For business reasons it’s not practical to replace all instances of DATE_TO_CHAR [...]
Archive for the ‘Databases’ Category
Porting DATE_TO_CHAR function to PostgreSQL
Posted in 4D, Postgres, tagged 4D SQL, Postgres, SQL function on July 11, 2011 | Leave a Comment »
Creating fields via SQL vs creating fields via structure editor
Posted in 4D, tagged 4D, null, sql, v11, v12 on June 8, 2011 | Leave a Comment »
Beware when creating fields via SQL engine with 4Dv12/v11. Creating fields via SQL does not allow setting field property “Map NULL values to blank values”. The suggested work around is to define the field with NOT NULL constraint. The different outcomes of the two ways to create fields is terrible behavior because of lack of [...]
Allow NULL values in 4DB engine
Posted in 4D, tagged 4D, clean code, null, sql, v11, v12 on June 7, 2011 | 1 Comment »
Developers need to be able to use nulls if using SQL engine and 4DB engine in 4D. As of this writing the concepts of NULL values are very loosely integrated with 4D. NULL Values in 4D The NULL values are implemented in the 4D SQL language as well as in the 4D database engine. However, [...]