dbTalk Databases Forums  

v$abc.. table names - nightmare

comp.databases.oracle.server comp.databases.oracle.server


Discuss v$abc.. table names - nightmare in the comp.databases.oracle.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
neilsolent
 
Posts: n/a

Default v$abc.. table names - nightmare - 05-16-2011 , 12:55 PM






Why oh why did Oracle decide to make table names with special symobols
in them, like v$database?
This makes it a nightmare in shell scripts wrapping sqlplus for
example!
Try writing a shell script that su's to oracle and executes sqlplus to
get data from v$database..
Is there any workaround to avoid the dollars, such as aliases?

thanks,
Neil

Reply With Quote
  #2  
Old   
Mladen Gogala
 
Posts: n/a

Default Re: v$abc.. table names - nightmare - 05-16-2011 , 02:03 PM






On Mon, 16 May 2011 10:55:24 -0700, neilsolent wrote:

Quote:
Why oh why did Oracle decide to make table names with special symobols
in them, like v$database?
This makes it a nightmare in shell scripts wrapping sqlplus for example!
Try writing a shell script that su's to oracle and executes sqlplus to
get data from v$database..
Is there any workaround to avoid the dollars, such as aliases?

thanks,
Neil
Yes. Use PHP 5.3 and "nowdoc" format which allows you to use special
characters without reinterpretation. Shell is not for databases.



--
http://mgogala.byethost5.com

Reply With Quote
  #3  
Old   
Matthias Hoys
 
Posts: n/a

Default Re: v$abc.. table names - nightmare - 05-16-2011 , 02:08 PM



"neilsolent" <n (AT) solenttechnology (DOT) co.uk> wrote

Quote:
Why oh why did Oracle decide to make table names with special symobols
in them, like v$database?
This makes it a nightmare in shell scripts wrapping sqlplus for
example!
Try writing a shell script that su's to oracle and executes sqlplus to
get data from v$database..
Is there any workaround to avoid the dollars, such as aliases?

thanks,
Neil
v\$database

Reply With Quote
  #4  
Old   
Sybrand Bakker
 
Posts: n/a

Default Re: v$abc.. table names - nightmare - 05-16-2011 , 04:25 PM



On Mon, 16 May 2011 10:55:24 -0700 (PDT), neilsolent
<n (AT) solenttechnology (DOT) co.uk> wrote:

Quote:
Why oh why did Oracle decide to make table names with special symobols
in them, like v$database?
This makes it a nightmare in shell scripts wrapping sqlplus for
example!
Try writing a shell script that su's to oracle and executes sqlplus to
get data from v$database..
Is there any workaround to avoid the dollars, such as aliases?

thanks,
Neil
Many attributes of v$database, which is for privileged users, are
available unprivileged via sys_context('userenv','<attribute>')
for instance 'db_name".
Usually to know that some manual reading is required. Most people
don't read documentation, and this results in unjustified rants like
you posted above.

----------
Sybrand Bakker
Senior Oracle DBA

Reply With Quote
  #5  
Old   
John Hurley
 
Posts: n/a

Default Re: v$abc.. table names - nightmare - 05-16-2011 , 06:18 PM



Neil:

# Why oh why did Oracle decide to make table names with special
symobols in them, like v$database?

Been like that for a long long time ...

# This makes it a nightmare in shell scripts wrapping sqlplus for
example! Try writing a shell script that su's to oracle and executes
sqlplus to get data from v$database..

Not a nightmare at all.

One approach is to put your sql inside a file and then execute that
file from sqlplus.

cd /to_some_location

export ORACLE_SID=whatever
sqlplus / as sysdba << EOF
@run_some_sql_script.sql
exit;
EOF

# Is there any workaround to avoid the dollars, such as aliases?

What are you trying to do exactly?

Reply With Quote
  #6  
Old   
Noons
 
Posts: n/a

Default Re: v$abc.. table names - nightmare - 05-16-2011 , 07:19 PM



On May 17, 3:55*am, neilsolent <n... (AT) solenttechnology (DOT) co.uk> wrote:
Quote:
Why oh why did Oracle decide to make table names with special symobols
in them, like v$database?
This makes it a nightmare in shell scripts wrapping sqlplus for
example!
Try writing a shell script that su's to oracle and executes sqlplus to
get data from v$database..
Is there any workaround to avoid the dollars, such as aliases?

thanks,
Neil
backslash (\) is your friend.

Reply With Quote
  #7  
Old   
neilsolent
 
Posts: n/a

Default Re: v$abc.. table names - nightmare - 05-17-2011 , 08:49 AM



On May 17, 1:19*am, Noons <wizofo... (AT) gmail (DOT) com> wrote:
Quote:
On May 17, 3:55*am, neilsolent <n... (AT) solenttechnology (DOT) co.uk> wrote:

Why oh why did Oracle decide to make table names with special symobols
in them, like v$database?
This makes it a nightmare in shell scripts wrapping sqlplus for
example!
Try writing a shell script that su's to oracle and executes sqlplus to
get data from v$database..
Is there any workaround to avoid the dollars, such as aliases?

thanks,
Neil

backslash (\) is your friend.

Yes but it's not just as simple as one backslash.
My Perl script is calling sqlplus via su (to switch to Oracle) - 7
backslahses needed v\\\\\\\$database !!
Try it and see.. that's what I mean by a nightmare.
If they could just refrained from naming tables with $ symbols.. :-)

I could just put the script in a file, but not very neat.
Using other tools means other problems - more dependencies to cater
for.
Oh well, thanks anyway..

Reply With Quote
  #8  
Old   
onedbguru
 
Posts: n/a

Default Re: v$abc.. table names - nightmare - 05-17-2011 , 11:43 AM



On May 17, 9:49*am, neilsolent <n... (AT) solenttechnology (DOT) co.uk> wrote:
Quote:
On May 17, 1:19*am, Noons <wizofo... (AT) gmail (DOT) com> wrote:

On May 17, 3:55*am, neilsolent <n... (AT) solenttechnology (DOT) co.uk> wrote:

Why oh why did Oracle decide to make table names with special symobols
in them, like v$database?
This makes it a nightmare in shell scripts wrapping sqlplus for
example!
Try writing a shell script that su's to oracle and executes sqlplus to
get data from v$database..
Is there any workaround to avoid the dollars, such as aliases?

thanks,
Neil

backslash (\) is your friend.

Yes but it's not just as simple as one backslash.
My Perl script is calling sqlplus via su (to switch to Oracle) - 7
backslahses needed v\\\\\\\$database * * *!!
Try it and see.. that's what I mean by a nightmare.
If they could just refrained from naming tables with $ symbols.. *:-)

I could just put the script in a file, but not very neat.
Using other tools means other problems - more dependencies to cater
for.
Oh well, thanks anyway..
Just an FYI - those table names have been that way since Version 1.
put your sql in a script and call the script.. much easier than what
you are trying to do... been there, done that.

Reply With Quote
  #9  
Old   
Mark D Powell
 
Posts: n/a

Default Re: v$abc.. table names - nightmare - 05-17-2011 , 11:55 AM



On May 17, 9:49*am, neilsolent <n... (AT) solenttechnology (DOT) co.uk> wrote:
Quote:
On May 17, 1:19*am, Noons <wizofo... (AT) gmail (DOT) com> wrote:

On May 17, 3:55*am, neilsolent <n... (AT) solenttechnology (DOT) co.uk> wrote:

Why oh why did Oracle decide to make table names with special symobols
in them, like v$database?
This makes it a nightmare in shell scripts wrapping sqlplus for
example!
Try writing a shell script that su's to oracle and executes sqlplus to
get data from v$database..
Is there any workaround to avoid the dollars, such as aliases?

thanks,
Neil

backslash (\) is your friend.

Yes but it's not just as simple as one backslash.
My Perl script is calling sqlplus via su (to switch to Oracle) - 7
backslahses needed v\\\\\\\$database * * *!!
Try it and see.. that's what I mean by a nightmare.
If they could just refrained from naming tables with $ symbols.. *:-)

I could just put the script in a file, but not very neat.
Using other tools means other problems - more dependencies to cater
for.
Oh well, thanks anyway..
If you are using Perl why not use the perl database interface to
Oracle? That would allow you to avoid the shell environment and
eliminate the need to escape so much.

I also dislike Oracle use of the dollar and pound sign in table and
column names but I have learned to live with an occassional backslash,
using script files, and having to mask output files that use object
name for dollar signs.

HTH -- Mark D Powell --

Reply With Quote
  #10  
Old   
neilsolent
 
Posts: n/a

Default Re: v$abc.. table names - nightmare - 05-17-2011 , 12:52 PM



Quote:
I also dislike Oracle use of the dollar and pound sign in table and
column names but I have learned to live with an occassional backslash,
using script files, and having to mask output files that use object
name for dollar signs.



Yes, I am doing it that way now (building a script file, then running
it).

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.