Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / Oracle / Oracle Server / March 2006

Tip: Looking for answers? Try searching our database.

plsql statement for login

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
infested - 31 Mar 2006 11:35 GMT
Is it possible to login as specified user by plsql statement?

Signature

Lukasz

frank.van.bortel@gmail.com - 31 Mar 2006 11:57 GMT
infested schreef:

> Is it possible to login as specified user by plsql statement?

No.

But you could switch content (set current schema) if that is what you
want.
But what you actually are trying to archieve is not clear.

Unless you are logged on, you cannot execute PL/SQL, therefore, you
cannot log on from PL/SQL (it would also require logging off the
current session)
infested - 31 Mar 2006 12:16 GMT
Ok, i can switch schema, but i want to create view on this schema. Is
it possible to grant creating view on achema?

Signature

Lukasz

Frank van Bortel - 31 Mar 2006 15:43 GMT
> Ok, i can switch schema, but i want to create view on this schema. Is
> it possible to grant creating view on achema?

No - grants are issued to users, not schema's.
Grants are issued for object usage; an object
belongs to a schema, which belongs to a user.

What are you trying to do?
Log on as A, and create view B.a_view as select ...
from C.a_table?

Grant create any view to A.
C has to grant select on a_table to B.

switch schema will just change the "create view b.a_view"
to "create view a_view".
In both cases B will own the view:

Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production
With the Partitioning, Oracle Label Security, OLAP and Oracle Data
Mining options
JServer Release 9.2.0.6.0 - Production

SQL> show user
USER is "SYSTEM"
SQL> create view scott.a_view as select * from dual;
View created.

SQL> select owner, view_name from dba_views where view_name='A_VIEW';
OWNER                          VIEW_NAME
------------------------------ ------------------------------
SCOTT                          A_VIEW

SQL> drop view scott.a_view;
View dropped.

SQL> alter session set current_schema=SCOTT;
Session altered.

SQL> create view a_view as select * from dual;
View created.

SQL> select owner, view_name from dba_views where view_name='A_VIEW';
OWNER                          VIEW_NAME
------------------------------ ------------------------------
SCOTT                          A_VIEW

Signature

Regards,
Frank van Bortel

Top-posting is one way to shut me up...

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.