473,624 Members | 2,323 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem to write connect user command inside the procedure any other option is there

2 New Member
hi


i have a problem to connect the user inside the stored procedure in oracle
i tried option

CREATE OR REPLACE PROCEDURE Chk_Permission AS
UserID VARCHAR2(10):=' 1234';
fname VARCHAR2(20):=' franklin';
lname VARCHAR2(20):=' baskar';
BEGIN
EXECUTE IMMEDIATE 'CONNECT SYSTEM/manager@almdevp AS sysdba';
EXECUTE IMMEDIATE 'GRANT CREATE SESSION TO dataentry';
EXECUTE IMMEDIATE 'CONNECT jcowner/jcowner';
EXECUTE IMMEDIATE 'GRANT INSERT,SELECT ON PERSON TO dataentry';
EXECUTE IMMEDIATE 'CONNECT SYSTEM/manager@almdevp AS sysdba';
EXECUTE IMMEDIATE 'GRANT dataentry TO appuser';
EXECUTE IMMEDIATE 'CONNECT appuser/appuser';
EXECUTE IMMEDIATE 'INSERT INTO jcowner.PERSON VALUES('||UserI D||','||fname|| ','||lname||')' ;
EXECUTE IMMEDIATE 'CONNECT SYSTEM/manager@almdevp AS sysdba';
EXECUTE IMMEDIATE 'REVOKE dataentry FROM appuser';
--dbms_output.put _line('welcome' );
END;

the above procedure
dataentry is a role it have the collection of privileges( create session, insert, delete etc)

jcowner is a actual schema that contains the person table

appuser is a schema to get the previleges and do the insert operation &

revoke the privileges from the appuser .




is it possible or not. if possible pls help me &


if it is not possible any other option there pls reply this forum.


thanks
Apr 11 '07 #1
1 6052
masdi2t
37 New Member
hi


i have a problem to connect the user inside the stored procedure in oracle
i tried option

CREATE OR REPLACE PROCEDURE Chk_Permission AS
UserID VARCHAR2(10):=' 1234';
fname VARCHAR2(20):=' franklin';
lname VARCHAR2(20):=' baskar';
BEGIN
EXECUTE IMMEDIATE 'CONNECT SYSTEM/manager@almdevp AS sysdba';
EXECUTE IMMEDIATE 'GRANT CREATE SESSION TO dataentry';
EXECUTE IMMEDIATE 'CONNECT jcowner/jcowner';
EXECUTE IMMEDIATE 'GRANT INSERT,SELECT ON PERSON TO dataentry';
EXECUTE IMMEDIATE 'CONNECT SYSTEM/manager@almdevp AS sysdba';
EXECUTE IMMEDIATE 'GRANT dataentry TO appuser';
EXECUTE IMMEDIATE 'CONNECT appuser/appuser';
EXECUTE IMMEDIATE 'INSERT INTO jcowner.PERSON VALUES('||UserI D||','||fname|| ','||lname||')' ;
EXECUTE IMMEDIATE 'CONNECT SYSTEM/manager@almdevp AS sysdba';
EXECUTE IMMEDIATE 'REVOKE dataentry FROM appuser';
--dbms_output.put _line('welcome' );
END;

the above procedure
dataentry is a role it have the collection of privileges( create session, insert, delete etc)

jcowner is a actual schema that contains the person table

appuser is a schema to get the previleges and do the insert operation &

revoke the privileges from the appuser .




is it possible or not. if possible pls help me &


if it is not possible any other option there pls reply this forum.


thanks

CONNECT is SQLPLUS comment, not SQL command. i think u can execute SQLPLUS command with EXECUTE IMMEDIATE (this statement just for SQL command only)

cmiiw
Apr 13 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
11580
by: Sandie Towers | last post by:
We use a number of similar databases and frequently create a new database using a backup restore of another similar database. We try to keep changes between databases in _Additional tables - like Account Additional, Sale_Additional so most tables stay the same. The latest restored database (I'll call it DBaseA) is behaving differently in VB6 code and I need help trying to make it work. I have been using use an ADODB.Command to execute...
0
2806
by: Guy Deprez | last post by:
Hi, i'm having a problem to create indexes. STEP 1 ----------- Connection is OK (you can find the string at the end of the message) Table ("Couleurs") creation is OK STEP 2. Index Creation
6
5868
by: John Morgan | last post by:
I urgently need tom use SP3a upgrade the instance of SQLServer200 MSDE runing on my local machine but I am having problems in doing so. My first problem is that when I start the set up procedure I get the message "A strong SA password is required for security reasons. Please use SAPWD switch to supply the same" Currently the sa password is Abc/def/ghk1
1
1768
by: DNKMCA | last post by:
Hi, I'm facing typical problem in SQL Server SP & ASP When ever i try to insert new record, the record has been inserted and gives error " User Already Found" How to solve this issue? Thanks in Advance. -DNK
3
5119
by: David | last post by:
Hi, Ive been trying to work this out for the past 2 days now and im not getting anywhere fast. The problem i have is that i am using Asynchronous sockets to create a Socket Client library. When i try to connect to a server that doesnt exist it raises a "Connection forcibly rejected by the resmote host" SocketException.
9
2191
by: Nathan Sokalski | last post by:
I am trying to connect to a Microsoft Access Database from my ASP.NET Application. I use the following code to create my connection string: cmdSelect.Connection = New System.Data.OleDb.OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATASOURCE=" & Server.MapPath("/WebApplication1/nathansokalski_com.mdb")) Although the error does not occur until the Fill() method is called:
14
2242
by: bob | last post by:
Can anyone help me connect to SQL Server??? I am new to all this... it is been a titanic struggle consuming hours & days & .... I am trying to create an SQL database programatically. But my code stalls before it gets started, and can't establish a connection to SQL Server. Here is my code:
3
1917
by: Matthew Warren | last post by:
I have the following piece of code, taken from a bigger module, that even as I was writing I _knew_ there were better ways of doing it, using a parser or somesuch at least, but learning how wasn't as fun as coding it... And yes alarm bells went off when I found myself typing eval(), and I'm sure this is an 'unusual' use of for: else: . And I know it's not very robust. As an ex cuse/planation, this is what happens when you get an idea in...
0
994
by: fbk2k5 | last post by:
hi i have a problem to connect the user inside the stored procedure in oracle is it possible or not. if possible pls help me & if it is not possible any other option there pls reply this forum.
0
8242
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8177
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8681
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8629
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8341
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7170
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1793
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1488
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.