日期:2014-05-17  浏览次数:21114 次

EXECUTE IMMEDIATE中调用函数
EXECUTE IMMEDIATE中动态调用函数怎么写才可以 求大神,如果把函数拼装在字符串中,执行有问题  
 PROCEDURE resource_geometry_in_grid(p_table_name  IN VARCHAR2)
   IS
     V_SQL    VARCHAR2(2000);
   BEGIN
     V_SQL := 'TRUNCATE TABLE GS_GRID_RESOURCE_GEOM';
     EXECUTE IMMEDIATE V_SQL;     
     V_SQL := 'INSERT INTO GS_GRID_RESOURCE_GEOM
                 (GRID_ID,GWM_FNO,GWM_CNO,NAME,CODE,GWM_USERNAME,STATUS,GWM_FID)
                SELECT GP.GWM_FID,
                       GI.GWM_FNO,
                       GI.GWM_CNO,
                       PKG_GRID_RESOUCE.GET_GS_RESOURCE_INFO(FL.GWM_FNO, FL.GWM_FID, 1),
                       PKG_GRID_RESOUCE.GET_GS_RESOURCE_INFO(FL.GWM_FNO, FL.GWM_FID, 2),
                       
DECODE(FL.GWM_FNO,4200,
                                (SELECT T.CATEGORY
                                   FROM GS_ONU_INFO T
                                  WHERE T.GWM_FID = FL.GWM_FID),
                                GF.GWM_USERNAME),
                       ''落对'',
                       FL.GWM_FID
                  FROM :1       FL,
                       GS_GRID_P    GP,
                       GS_GRID_INFO GI,
                       GWM_FEATURE  GF
                 WHERE GP.GWM_FID = GI.GWM_FID
 &nb