Database Administration (MOSC)

MOSC Banner

Format Of SELECT Statement (Within A Script) For A Table Name That Contains A "$"

edited Dec 26, 2008 3:24AM in Database Administration (MOSC) 4 comments
 I am attempting to create a UNIX script which calls SQLPLUS that does a SELECT of a table with at "$" in the name.... 

This i no problem when calling from within SQLPLUS, but when it is called from a UNIX script, the "$" is intrepreted as a special character.

Here is the script I am trying to write...

    #!/bin/ksh
    set -o xtrace

    USERPW='system/apr05apr'
    FirstLog=`sqlplus -s  2>&1 << ENDSQL
            ${USERPW}
            select sequence# from v\$log  where status='CURRENT';
    ENDSQL`

    echo 'First Archive Log - ${FirstLog}'
    exit

Normally assums I would use an escape character as above... but I just can not seem to get the correct foramt ...

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center