The answer is NEVER. If you need to write programs to load or process data you need to do it outside of your data tier from another computer on the network.
Running external applications directly on your data tier or god forbid in-process with your data tier or the misapplication of external languages when native query languages are a better fit for the job at hand are fine and perfectly acceptable for a small scale custom in-house application. They simply have no place outside of that arena.