Hello Experts-
Is there any error in my script or is there ANOTHER way to use escape character. Thanks In Advance
I am trying to query v$ view of database but the script is failing.
sqlplus -s /nolog<<-EOF >>$LOG_FILE
connect / as sysdba
SET ECHO OFF
select db_unique_name,TO_CHAR(SYSTIMESTAMP,'MM-DD-YY HH-MI') AS TIME_STAMP from v\$database,dual group by db_unique_name;
EXIT;
EOF`
ERROR::
select db_unique_name,TO_CHAR(SYSTIMESTAMP,'MM-DD-YY HH-MI') AS TIME_STAMP from v,dual group by db_unique_name
*
ERROR at line 1:
ORA-04044: procedure, function, package, or type is not allowed here
So I do realize that the script is not processing the $ symbol but all my research was pointing to use '\' - escape character and I am not sure why this is NOT working.
Is it something to do my user profile ?
[oracle@hostname ~]$ stty -a
speed 38400 baud; rows 71; columns 237; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts -cdtrdsr
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke
[oracle@hostname ~]$