Peter,
That won't work either.
DROP and CREATE commands can only be executed in a
procedure via dynamic SQL.
Such as the older DBMS_SQL package, or the newer and
much easier to use EXECUTE IMMEDIATE.
Jared
Peter.McLarty@
mincom.com To: Multiple recipients of list ORACLE-L
<[EMAIL PROTECTED]>
Sent by: cc:
[EMAIL PROTECTED] Subject: Re: procedure error
om
01/16/02 02:15
PM
Please respond
to ORACLE-L
try changing CREATE OR REPLACE PROCEDURE Primus_Report
AS
Drop Table PRIMUS_TEMP_DUMP;
CREATE TABLE PRIMUS_TEMP_DUMP
to CREATE OR REPLACE PROCEDURE Primus_Report
AS
BEGIN
Drop Table PRIMUS_TEMP_DUMP;
CREATE TABLE PRIMUS_TEMP_DUMP
--
=================================================
Peter McLarty E-mail: [EMAIL PROTECTED]
Technical Consultant WWW: http://www.mincom.com
APAC Technical Services Phone: +61 (0)7 3303 3461
Brisbane, Australia Mobile: +61 (0)402 094 238
Facsimile: +61 (0)7 3303 3048
=================================================
A great pleasure in life is doing what people say you cannot do.
- Walter Bagehot (1826-1877 British Economist)
=================================================
Mincom "The People, The Experience, The Vision"
=================================================
"Lance Prais"
<[EMAIL PROTECTED]> To: Multiple recipients of
Sent by: [EMAIL PROTECTED] list ORACLE-L <[EMAIL PROTECTED]>
cc:
Fax to:
17/01/2002 07:35 AM Subject: procedure error
Please respond to ORACLE-L
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;
/
--
This transmission is for the intended addressee only and is confidential
information. If you have received this transmission in error, please delete
it and notify the sender. The contents of this e-mail are the opinion of
the writer only and are not endorsed by the Mincom Group of companies
unless expressly stated otherwise.
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author:
INET: [EMAIL PROTECTED]
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
San Diego, California -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).