@echo off
set user_name=username
set password=
set sid=sid
@echo select distinct scid, to_char(dlog_on_timestamp,'dd-Mon-YYYY hh:mi:ss') from table where dlog_on_timestamp > sysdate-7; | sqlplus -s %user_name%/%password%@%sid% >> C:\Users\test.txt运行此批处理文件时,> symbol created file sysdate-7。但是我需要运行DB查询,结果应该存储在test.txt中
发布于 2018-10-16 00:56:16
为您的shell添加引号(cmd.exe ?)在命令周围:
@echo "select distinct scid, to_char(dlog_on_timestamp,'dd-Mon-YYYY hh:mi:ss') from table where dlog_on_timestamp > sysdate-7;" | sqlplus -s %user_name%/%password%@%sid% >> C:\Users\test.txthttps://stackoverflow.com/questions/52821241
复制相似问题