Question

drop user / pl_sql

Rating9.4Excellent

How do you drop a user using pl_sql in a package? I type in the command drop user username, but I get a compile error:

PLS-00103: Encountered the symbol "DROP" when expecting one of
the following:
begin declare end exit for goto if loop mod null pragma raise
return select update while <an identifier>
<a double-quoted delimited-identifier> <a bind variable> <<
close current delete fetch lock insert open rollback
savepoint set sql commit <a single-quoted SQL string>
The symbol "declare was inserted before "DROP" to continue.

Is it possible to drop a user in a package?

  1. if then drop
    I have the following script: BEGIN IF EXISTS (select 1 from dba_users where username = "SCHEMA1") then drop user SCHEMA1 cascade; END IF; END; When I run this I get error ORA-06550: DROP found where expected one of the following: begin case etc. What goes wrong here?
  2. Oracle 10g -- Enterprise Manager "Schedule…
    I have other Oracle 10g Enterprise Manager "Scheduled Task" that work fine, but the below fails. How can I fix ? 1. login to http://dbserver:1158/em as "SYS" 2. click ADMIN, click JOBS 3. create a new JOB 4. add below code begin drop table APPS.GML_IMPORT_IT…
  3. Oracle SQL - How to insert "¢" (cents) int…
    I have an insert statement that I need to insert to a table. That statement contains '5¢'. I used single quote or double quotes to try to insert the ¢ symbol to the table but the result is '?'. Is there anyway to add the symbol '¢'? insert into test1 values ('One Rate 5¢'); the result in the table is: One Rate 10?
  4. pl_sql insert with order by
    I have a package that inserts records in to a table. It compiles fine until I add an order by. I get the error below. I've also included a simple example. INSERT INTO dual SELECT * FROM dual ORDER BY dummy; 595/5 PLS-00103: Encountered the symbol "ORDER" when expecting one of the fol…
  5. tuning pl_sql
    I'm trying to make a pl_sql proc faster, and I'm not sure about a for loop. The loop grabs information and sends it to another loop in another proc. Is it faster to read all of this information in to an array and then call the other proc? FOR my_record IN (SELECT * FROM emp) LOOP SomeOtherProc(my_record.fname); END LOOP; …

Solution

Sign up now to view this solution! It's quick, easy, and secure to subscribe. We will return you to this solution, unlocked, when you’re done.

About this Solution
View This Solution - Start Your 30 Day Free Trial
Zone
General
Tags
drop pl_sql
Participating Experts
1
Solution Grade
A

Replies

 
by:

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: jflemin

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: jflemin

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: jflemin

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

Stay Connected

Oracle Around the Web

The latest Oracle news, tips, and tricks

Oracle Unveils Netra SPARC T3 Servers

New Carrier-Grade Blade and Rackmount Servers Deliver Better Performance, Density and Power Efficiency for the Communications Industry ...

read more

Oracle fixes 21 flaws in Java SE, Java for Business

Oracle is fixing 21 flaws in its Java SE and Java for Business products in its February critical patch update issued this week ...

read more

Obama’s Silicon Valley “Tech Supper”

Why was he there? Who wasn’t invited and why? What did they talk about? Why was he really there? These are the questions being debated ...

read more

Featured Oracle Experts

slightwv

slightwv has answered more than 2,000 Oracle questions and oversees database management within the U.S. Government. Slightwv

sdstuber

A regular presenter at the Collaborate conference, Oracle developer sdstuber is a top expert in PL/SQL and Oracle 9, 10 and 11. sdstuber

Testimonials

What users are saying about our experts

"The Oracle gurus provide answers, solutions and valuable workarounds"

User: schwertner

"Wow! Excellent, valuable explanation. Hats off to you"

User: aseshu70

"Solution worked fantastic and performs excellent! Thanks heaps"

User: klausbrandlhuber

Top Experts

  1. slightwv

    2,000

    0 points yesterday

    Profile

BrowseBecome an Expert