It would be useful if, when generating the SQL, it was possible to copy the date format either as it is displayed according to the format in "Data formatting", or it was possible to specify the date format in the Connect profile.
We have an Informix database that has the date set according to the language and thus respects the national date format in SQL as well. Thus, the generated SQL cannot be used in this case.
Possibility to change the date format of the generated SQL. #105
When you use "Copy data to clipboard", the dialog that shows up then, contains a drop down to select the type of DATE (including TIMESTAMP) literals to be used.
For Informix, I have configured the formats to be used:
workbench.sql.literals.informix_dynamic_server.datetime_year_to_minute.pattern=''''yyyy-MM-dd HH:mm'''::datetime year to minute'
So if you are connected to an Informix database choosing "DBMS" should use that format.
If those formats are wrong, you can override them by putting the correct syntax into workbench.settings.
The default used when copying to clipboard, can be configured using Tools -> Options -> SQL Generation.
DATETIME is fine because it is not affected by the language setting. I have a problem with the DATE type that I need to use in the form dd.mm.yyyy. Is there any way to change this? None of the options for Copy data to clipboard -> Date literal type will allow this. I don't see it in workbench.settings either.
The file workbench.settings only contains custom configurations, not the default settings.
You will need to add the configuration manually.
Please try the following:
workbench.sql.literals.informix_dynamic_server.date.pattern=''dd.MM.yyyy''
This will be used when you use "Copy data as SQL", but unfortunately not if you use "Copy data to clipboard" and then choose the date literal type "dbms" in the dropdown labeled "Date literal type"
A workaround for that is to add Informix as another "dbms" to that dropdown by adding the following line to workbench.settings
workbench.sql.literals.types=jdbc,ansi,dbms,default,oracle,sqlserver,sybase,informix_dynamic_server
The you will see "informix_dynamic_server" as an option and if selected it will use the format specified (the drop down will list the entries in the order you define them in the property, so if you want Informix to be the first one, just put it first in the list)
Thanks!
Let me know if it works (then I'll close the issue)
Yes it works, thank you very much for your help.
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?