我有以下 bash 脚本,它应该使用当前日期调用 sqlplus。
#!/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
但是,我收到以下错误-它绝对不是在评估 date 命令:
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
我该如何修复它,以便它像这样传递当前日期?
PLSQL_PROCEDURE('2013-03-14', '-30', 'someString', '/home/outputFolder');