Automatic Timestamp in code

Hello,
I have question if is possible somehow to achieve this in Toad using Automation designer in Utilities menu I never used or something else in TOAD?
I would like to add in my SQL or PL/SQL comment text let say somewhere in my top line some special Timestamp tag or field (if I refer to Ms Word), like {LastUpdate} which will automatically show last date and time (in my desired format!) when I save file for the first time with Save As or later just using Save command.

For example below is timestamp in italic:
--- Return all Employees (Ver: 28.03.2024 09:55)
Select
*
From
EMP
;

Why I need this? Code I create in TOAD I later copy to some bigger file, app or window where is used. And later I need to see if my code on production is same like in my Dev environment by quick check both timestamps..

If I could just press some my assigned shortcut which will just "manually" print this instead of manually type this will be also helpfull. Like for example in Notepad where you can press F5. Can this be done?

Regards,
Blacksmith

Sorry, there is no way to do this that I know of. Can you look at the file modified timestamp in Windows?

One option may be to format your code first. By default, formatting adds a leading comment that includes the timestamp.

If you do not want to change the formatting of your code you may be able to use the "Format Case Only" feature which leaves your indentation and newlines intact, but alters the case of reserved words, etc. You can configure the case settings in Options on the "Formatter" page. You can also assign a shortcut to "Format Case Only" in Options on the "Toolbars/Menus | Shortcuts" page.

Hi,
I don't want to use forrmatting code because then my code is broken and not in my style anymore. If I could autoformat my way then this could be option. This is Q for some other time.

Can be made some simple macro or some automation procedure that when I press my specific shortcut in the place of cursor will be printed current date and time in my format as I would type that manually, like if you press F5 in Notepad? If not, I would like to put this in Toad wish bucket. :slight_smile: