473,508 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

creating a user within a function

8 New Member
Hi, I am new to sql, so I apologize in advance. I wrote a procedure which calls a function. (I am not sure if the procedure will work yet). MY question is on the function. I am not sure I wrote it correctly as it gives me the Error(10,6): PLS-00103: Encountered the symbol "CREATE" ..
Can you create a user in a function? The procedure reads acct names and passwords from a table, then while its not at the end it creates a user. (calls a function to do so, as creating a user inside the procedure wouldn't work). I am lost. Here is the function, any help is appreciated.

CREATE OR REPLACE
FUNCTION MakeUSER(vchACCOUNName IN varchar2,
vchPasswordNmbrin IN varchar2)
RETURN int
AS
BEGIN

DBMS_OUTPUT.PUT_LINE('hey');--testing with begin

CREATE USER vchACCOUNName
IDENTIFIED BY vchPasswordNmbr
DEFAULT TABLESPACE STUDENTTABLESPACE
QUOTA 10M ON example
QUOTA 10M ON system;
--return 0; NOT SURE IF NEEDED

END;
Jul 28 '07 #1
1 1330
holdingbe
78 New Member
Hi, I am new to sql, so I apologize in advance. I wrote a procedure which calls a function. (I am not sure if the procedure will work yet). MY question is on the function. I am not sure I wrote it correctly as it gives me the Error(10,6): PLS-00103: Encountered the symbol "CREATE" ..
Can you create a user in a function? The procedure reads acct names and passwords from a table, then while its not at the end it creates a user. (calls a function to do so, as creating a user inside the procedure wouldn't work). I am lost. Here is the function, any help is appreciated.

CREATE OR REPLACE
FUNCTION MakeUSER(vchACCOUNName IN varchar2,
vchPasswordNmbrin IN varchar2)
RETURN int
AS
BEGIN

DBMS_OUTPUT.PUT_LINE('hey');--testing with begin

CREATE USER vchACCOUNName
IDENTIFIED BY vchPasswordNmbr
DEFAULT TABLESPACE STUDENTTABLESPACE
QUOTA 10M ON example
QUOTA 10M ON system;
--return 0; NOT SURE IF NEEDED

END;
Hi friend,
Kindly understand the user concepts. create user must be create under the dba.what u did means,function or procedure created under the any user.please you login in system/manager and then create a user.
Jul 30 '07 #2

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

Similar topics

6
2700
by: gonzalo briceno | last post by:
I have been using phplib for a while and I really like the framework except for form creation. Maybe it is me but I in my opinion there isn't a good way to create forms or should I say, everything...
6
18705
by: Andi Reisenhofer | last post by:
Hallo C# folks, Somebody know how to create a ODBC DSN dynamically in c# program. Also interesting for me would be the connectionstring for an Access Database. Thinks a lot Andreas
15
6719
by: Carlos Lozano | last post by:
Hi, What is the right way to create an OCX COM component. The component is already registerred, but can't create an instance. I am using the reference to the interop module created. If I use...
1
1836
by: Hal 9000 | last post by:
In c# we have a function that creates a virtual directory in IIS 6.0 using DirectoryServices API. The code looks like this: // log in to IIS DirectoryEntry rootDir = new...
12
3139
by: Mats Lycken | last post by:
Hi, I'm creating a CMS that I would like to be plug-in based with different plugins handling different kinds of content. What I really want is to be able to load/unload plugins on the fly without...
4
1895
by: gyoder | last post by:
what is the prefered method of creating a VB function or subroutine on the fly at runtime. for example: a user types in a function at runtime into a text field. then the user wants to evaluate...
5
2202
by: Dan | last post by:
Hi, I use the <asp:CreateUserWizardcontrol for creating memberusers. In that windows, one must provide an emailaddress. My question is: how can an user later change his emailaddress? Thanks...
1
2104
by: webgour | last post by:
Hello, I would like to create an onload event within my object. The following works fine : function TEST() { this.image= new Image(); } TEST.prototype.Initialize = function()
0
2180
by: robgallen | last post by:
I have 2 user controls within a master page, and I would like one of them to call a function in the other. All the examples I have seen involve a page communicating with the Master page, or with...
0
7225
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,...
0
7123
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...
0
7382
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...
0
7495
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5627
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,...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3181
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1556
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.