Create dynamic folder using SQL*Plus

oracleoracle-12csqlplus

I need to create directory in Linux with date stamp from SQL*Plus. Is there a command that can be run in *.sql file to create a directory with current date?

Best Answer

The SQL*Plus command you're looking for is host. It allows you to run a Linux shell command, so

host mkdir $(date +%F);

Adjust the date format as necessary (man date will help you with that).