我有一个获取当前时间的脚本,必须将其传递给另一个脚本。
variable v_s_time varchar2(30);
exec :v_s_time := to_char(sysdate,'YYYY-MM-DD HH:MI:SS AM');
--Lots of unrelated code here
variable v_e_time varchar2(30);
exec :v_e_time := to_char(sysdate,'YYYY-MM-DD HH:MI:SS AM');
@"test report script.sql" :v_s_time :v_e_time; --yes, I also tried ":v_s_time", didn't seem to do anything.
这不起作用,看起来
:v_s_time
传递给脚本,而不是我想要的:
"2010-04-14 05:50:01 PM"
.
要手动执行此操作,我可以输入:
@"test report script.sql" "2010-04-14 05:50:01 PM" "2010-04-14 05:57:34 PM"
我发现有效的是:
define v_s_time = "2010-04-14 05:50:01 PM"
--Lots of unrelated code here
define v_e_time = "2010-04-14 05:57:34 PM"
@"test report script.sql" "&&v_s_time" "&&v_e_time";
但硬编码日期时间是不现实的。有人知道怎么处理吗?
(Oracle 10g)