我有一個下面的存儲過程:如何從存儲過程獲取數據表?
create or replace
PROCEDURE "SP_UTILITIES_LOG"
(
p_utility_name IN varchar2,
p_r_object_id IN varchar2,
p_platform_name IN varchar2,
p_exported_file_path IN varchar2,
p_Is_binary IN number,
p_extraction_status IN varchar2,
p_extraction_error IN varchar2,
p_extraction_datetime IN VARCHAR2,
p_schema_name IN varchar,
p_publication_path IN varchar,
p_schema_tcm_id IN varchar,
p_component_tcm_id IN varchar,
p_component_name IN varchar,
p_loading_status IN varchar,
p_transformed_file_path IN varchar,
p_transformed_status IN varchar,
p_import_status IN varchar,
p_loading_error IN varchar,
p_transform_error IN varchar,
p_import_error IN varchar,
p_loading_datetime IN TIMESTAMP,
p_transform_datetime IN TIMESTAMP,
p_import_datetime IN TIMESTAMP
)
IS
BEGIN
IF(p_utility_name ='EXTRACTION')
THEN
BEGIN
INSERT INTO utilities_log(R_OBJECT_ID,
PLATFORM_NAME,
EXPORTED_FILE_PATH,
IS_BINARY,
EXTRACTION_STATUS,
EXTRACTION_ERROR,
EXTRACTION_DATETIME
)
VALUES(p_r_object_id, p_platform_name,p_exported_file_path, p_is_binary, p_extraction_status, p_extraction_error, p_extraction_datetime);
END;
END IF;
IF(p_utility_name ='LOADING')
THEN
BEGIN
UPDATE UTILITIES_LOG SET schema_name=p_schema_name,
publication_path= p_publication_path,
schema_tcm_id= p_schema_tcm_id,
component_tcm_id= p_component_tcm_id,
component_name= p_component_name,
loading_status= p_loading_status,
loading_error= p_loading_error,
loading_datetime= current_timestamp
WHERE
r_object_id= p_r_object_id;
END;
END IF;
IF(p_utility_name ='PRE-TRANSFORMATION')
THEN
BEGIN
SELECT exported_file_path,component_tcm_id FROM utilities_log
WHERE
platform_name= p_platform_name and loading_status=p_loading_status
and extraction_status=p_extraction_status;
END;
END IF;
IF(p_utility_name ='TRANSFORMATION')
THEN
BEGIN
UPDATE UTILITIES_LOG SET
transformed_file_path= p_transformed_file_path,
transformed_status= p_transformed_status,
transform_error= p_transform_error,
transform_datetime= current_timestamp
WHERE
exported_file_path= p_exported_file_path;
END;
END IF;
IF(p_utility_name ='RETRIEVE')
THEN
BEGIN
execute immediate 'create global temporary table temp_import as SELECT transformed_file_path,publication_path
FROM utilities_log
WHERE
platform_name= p_platform_name';
END;
END IF;
IF(p_utility_name ='IMPORTER')
THEN
BEGIN
UPDATE UTILITIES_LOG SET
import_status=p_import_status,
import_error=p_import_error,
import_datetime=current_timestamp
WHERE
publication_path= p_publication_path;
END;
END IF;
END;
我收到錯誤「變成」條款中缺少select語句... 任何幫助嗎? 感謝
感謝Yavgeny的建議....我解決了這個問題......我從來沒有實現過,所以它的一點點難以理解......如果你可以修改代碼,它會有很大的幫助...... 。謝謝 – Aquarius24
非常感謝YavgenyP – Aquarius24