Re: Which DB am I connected to?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Andy (Andrzej7_at_hotmail.com)
Date: 01/20/05


Date: Thu, 20 Jan 2005 11:36:31 -0800


Thanks, that works :)

I was snooping around the database (a little knowledge and
a few passwords are really dangerous... ) and have tried
this, too:

select * from GLOBAL_NAME;

I just don't know which one is more reliable?

--- Andy

>-----Original Message-----
>Hi Andy! :O)
>
>give this query a try :
>---
>select sys_context('userenv', 'db_name') from dual;
>---
>
>--
>Best Regards
>Yanick
>"Andy" <Andrzej7@hotmail.com> a écrit dans le message de
>news:0c8001c4ff21$c46bf6b0$a401280a@phx.gbl...
>> It is not really a VB question, but I will try
anyway....
>>
>> I have some stored procedures in ORACLE that run outside
>> my VB 6 app. When I connect to my DB from VB I know
which
>> DB I access.
>>
>> My stored procedures (in PL/SQL) run either against Test
>> or Production database. Sometimes there are small
>> differences that need to be implemented depending which
DB
>> I run my stored proc from, and I don't want to make
these
>> changes every time I move from test to production - I
just
>> have to remember to do the changes, and if somebody else
>> will have to do it in the future they may not know what
to
>> change. And I am not crazy about putting all of the
>> changes in comments.....
>>
>> I can get date by: select sysdate from dual
>> I can get user by: select user from dual
>>
>> Is there any way to know which DB I am accessing in
PL/SQL?
>>
>> like:
>> Select WHAT from dual ?
>>
>> To get either Test or PROD?
>>
>> --- Andy
>
>
>.
>



Relevant Pages

  • Re: Database Model - Class, objects and interaction
    ... I was just proving stored procedures can call views. ... stuff like security and logging. ... So given 100,000 users, you would create database accounts for each? ... Part of our system's integrity was its reliability, and reliability is often assisted by simplicity. ...
    (comp.object)
  • Re: Database Model - Class, objects and interaction
    ... Stored procedures should only be used as a last resort if you cant use ... I've not said that views shouldn't be created, only that they shouldn't be exposed as the interface to the database. ... But business rules can be more complicated than simply defining overdue invoices. ...
    (comp.object)
  • Re: Infinite Loops and Explicit Exits
    ... the whole payroll system would be dependent on proper database ... I design large systems the same way. ... Stored procedures ARE application code. ... any language, including Cobol. ...
    (comp.lang.cobol)
  • Re: Pathname to access and usernames in shortcut
    ... >> network drive (for maintenance reasons initially, ... >> using usernames but no passwords. ... change their passwords within the access database (they won't know how ... >> gets the current username from the system and then calls access (via the ...
    (microsoft.public.access.security)
  • Re: security issues
    ... It was obviously never meant to be; multiple defences against it being ... The Ubuntu installer uses a framework called debconf to do ... when you're asking for passwords ... you take a lot of care to clean them out of the database ...
    (Ubuntu)