Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: what is wrong with my PL/SQL program?

Re: what is wrong with my PL/SQL program?

From: Arjan van Bentem <avbentem_at_DONT-YOU-DAREdds.nl>
Date: Mon, 29 Mar 1999 18:35:39 +0200
Message-ID: <7doa4r$keg$1@weber.a2000.nl>


Johnson wrote
> declare
> username varchar2;
> begin
> select user into username from dual; -- get the current user name
> grant alter user to username; -- grant the right to the user ***
> end;
>
> when I run the script, I was always told there was something
> wrong with the grant sentence. So what is wrong with it?

You declared username to be varchar2. As far as I know, this defaults to length 1, which most likely is too small for your username. Furthermore, you cannot issue the GRANT from within PL/SQL. You need dynamic SQL for that, just like when you would need CREATE TABLE etc.

Arjan.

PS. I hope you can read my reply, as it looks strange here. My Outlook Express somehow feels that Japanese English should use a different font than US English. So, please reply to the group when you read this... :-) Received on Mon Mar 29 1999 - 10:35:39 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US