Connecting Tech Pros Worldwide Forums | Help | Site Map

Cerating Table In Procedure

Newbie
 
Join Date: Dec 2007
Posts: 1
#1: Dec 3 '07
HELO !
Please HELP me SOON in creating table in procerdure i write the following statment but it gives error
CREATE OR REPLACE
PROCEDURE EMP_BACK_UP_SALARY
(param IN VARCHAR2) AS

BEGIN

CREATE TABLE a AS (SELECT * FROM b);

END;

Error
"Encountered the symbol CREATE while expecting the following like BEGIN CASSE DECLARE ETC"
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,508
#2: Dec 3 '07

re: Cerating Table In Procedure


You need to execute the create table statment with EXECUTE IMMEDIATE.

EX
------

execute immediate 'create table ..............' ;
Reply