PLEASE HELP!!!I AM STUCKED!!!ESCAPE CHARACTER!!!
Posted: 11 Aug 2010 05:38
dear my friends, i need to create a batch file for my oracle database on windows and for this i need to write a "select" statement,
(i dont have any problem for the first 2 lines, they work)
For /F "tokens=* delims=" %%A in ('Type a.txt') Do Set MyVar=%%A
Echo [%MyVar%]
set sql=select 'del ' || name from v$archived_log where sequence#>%MyVar% and applied='YES';
echo %sql% > s.sql
shortly, i am reading MyVar value from a text file and i want to write a select statement with using this value, also i want to write my sql statement to a file whose name is s.sql
my aim is to write to the s.sql exactly this:
select 'del ' || name from v$archived_log where sequence#>23456 and applied='YES';
but i cant escape "||" characters, i tried everything (like ^) but i couldnt succedded. can u help me?
(i dont have any problem for the first 2 lines, they work)
For /F "tokens=* delims=" %%A in ('Type a.txt') Do Set MyVar=%%A
Echo [%MyVar%]
set sql=select 'del ' || name from v$archived_log where sequence#>%MyVar% and applied='YES';
echo %sql% > s.sql
shortly, i am reading MyVar value from a text file and i want to write a select statement with using this value, also i want to write my sql statement to a file whose name is s.sql
my aim is to write to the s.sql exactly this:
select 'del ' || name from v$archived_log where sequence#>23456 and applied='YES';
but i cant escape "||" characters, i tried everything (like ^) but i couldnt succedded. can u help me?