在PL/SQL中如何create table

在PL/SQL中不能直接使用'create table', 可以改用execute immediate, 如下:

CREATE OR REPLACE PROCEDURE DownLoad_ERP_ATR_DATA
AS

BEGIN
execute immediate ' Create Table ATR AS
SELECT ORG_ID, 
SUBINVENTORY, 
ITEM_CODE, 
ITEM_DESC, 
INVENTORY_ITEM_ID, 
UOM, 
ATR, 
VENDOR_NUM
FROM ATR_V'; 
END DownLoad_ERP_ATR_DATA;

你可能感兴趣的:(sql)