I have the following bash script which is supposed to call sqlplus with the current date.
#!/bin/bash
DATE='date +%F'
sqlplus -s << EOF1
DB_username/DB_password
set heading off
exec PLSQL_PROCEDURE('$DATE', '-30','someString','/home/outputFolder');
exit
EOF1
exit
I get the following error however- it's definitely not evaluating the date command:
BEGIN PLSQL_PROCEDURE('date +%F', '-30', 'someString', '/home/outputFolder'); END;
*
ERROR at line 1:
ORA-01841: (full) year must be between -4713 and +9999, and not be 0
ORA-06512: at "DataBaseName.PLSQL_PROCEDURE", line 19
ORA-06512: at line 1
How can I fix it so that it passes the current date in, like this?
PLSQL_PROCEDURE('2013-03-14', '-30', 'someString', '/home/outputFolder');