DROP and CREATE are DDL functions ... you have to use DBMS_SQL package or Native Dynamic SQL (execute immediate) statement to achieve this.
 
Raj
______________________________________________________

Rajendra Jamadagni              MIS, ESPN Inc.

Rajendra dot Jamadagni at ESPN dot com

Any opinion expressed here is personal and doesn't reflect that of ESPN Inc.

QOTD: Any clod can have facts, but having an opinion is an art!

-----Original Message-----
From: Lance Prais [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 16, 2002 4:36 PM
To: Multiple recipients of list ORACLE-L
Subject: procedure error

Why in toad when I try to create a stored proc where I drop and create a table I get the following error: 

 

PLS-00103: Encountered the symbol "DROP" when expecting one of the following:

   begin function package pragma procedure subtype type use
   <an identifier> <a double-quoted delimited-identifier> cur

 

 

Here is my code:

 

CREATE OR REPLACE PROCEDURE Primus_Report

AS

Drop Table PRIMUS_TEMP_DUMP;

CREATE TABLE PRIMUS_TEMP_DUMP (

  SOLUTION_ID              VARCHAR2 (85)  NOT NULL,

  TITLE                    VARCHAR2 (3498),

  OWNER                    VARCHAR2 (255),

  P_TYPE                   VARCHAR2 (96),

  AUTHOR                   VARCHAR2 (255),

  MODIFIED_BY              VARCHAR2 (255),

  ESCALATION_GROUP         VARCHAR2 (255),

  TECH_RESOURCE            VARCHAR2 (255),

  P_PARTITION              VARCHAR2 (96),

  STATUS                   VARCHAR2 (96),

  HyperLinks                    VARCHAR2 (96),

  Style_reviewer             VARCHAR2 (96),

  DATE_CREATED             DATE,

  DATE_MODIFIED            DATE,

  ALERT                    VARCHAR2 (96),

  URGENCY                  VARCHAR2 (96),

  NO_PAGEVIEWS_LAST_MONTH  VARCHAR2 (255),

  NO_PAGEVIEWS_QUARTER     VARCHAR2 (255),

  NO_LINKS_LAST_WEEK       VARCHAR2 (255),

  NO_LINKS_LAST_MONTH      VARCHAR2 (255) );

INSERT INTO PRIMUS_TEMP_DUMP (solution_id,Title) SELECT pc_solution_id, pc_title FROM pt_solution;

end;

/


*********************************************************************1

This e-mail message is confidential, intended only for the named recipient(s) above 
and may contain information that is privileged, attorney work product or exempt from 
disclosure under applicable law. If you have received this message in error, or are 
not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 
and delete this e-mail message from your computer, Thank you.

*********************************************************************1

Reply via email to