Home » SQL & PL/SQL » SQL & PL/SQL » How do i set default database/user for statements?
How do i set default database/user for statements? [message #201099] Thu, 02 November 2006 09:11 Go to next message
quantass
Messages: 20
Registered: April 2006
Junior Member
Im used to Sql Server 2005 where i can use the keyword "Use" to set the default database. Is there an equivalent command within Oracle 10g PL/SQL which allows me to define the default database, user/schema for all subsequent sql statements?
Re: How do i set default database/user for statements? [message #201100 is a reply to message #201099] Thu, 02 November 2006 09:13 Go to previous messageGo to next message
Mohammad Taj
Messages: 2412
Registered: September 2006
Location: Dubai, UAE
Senior Member

cmd>set oracle_sid=db_name
for database.
Re: How do i set default database/user for statements? [message #201125 is a reply to message #201100] Thu, 02 November 2006 12:16 Go to previous messageGo to next message
Littlefoot
Messages: 20900
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As soon as you connect to the Oracle database (providing required credentials: username, its password and database alias you are connecting to), all SQL statements you issue will run on that database, in that schema.
Re: How do i set default database/user for statements? [message #201221 is a reply to message #201125] Fri, 03 November 2006 02:56 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Although you can use the 'ALTER SESSION SET current_schema' command to make the queries you execute and the code you run all behave as though they were run from another schema.
Previous Topic: would like to double check .....
Next Topic: Table name in cursor
Goto Forum:
  


Current Time: Wed Dec 07 14:44:02 CST 2016

Total time taken to generate the page: 0.05348 seconds