我正在尝试将表的列名传递给存储过程,以便生成分位数(min,25th,50th,75thcentntiles,max)。创建过程成功。但是当我执行调用时,我收到了所有者引用的错误。 以下是我的代码:
REPLACE PROCEDURE PROD_CE_WORK_SPACE.NPVAZ_CVM_CHECK_TEST_CASE (IN COL CHAR(50))
BEGIN
INSERT INTO PROD_CE_WORK_SPACE.NPVAZ_CVM_CHECK_TEST_CASE_5
SELECT
'ACPT_'||:COL AS VAR,
MIN(:COL) AS PER_MIN,
MIN(CASE WHEN SEQNUM / 0.25 >= CNT THEN :COL END) AS PER_25,
MIN(CASE WHEN SEQNUM / 0.50 >= CNT THEN :COL END) AS PER_50,
MIN(CASE WHEN SEQNUM / 0.75 >= CNT THEN :COL END) AS PER_75,
MAX(:COL) AS PER_MAX
FROM (
SELECT PC.*,
ROW_NUMBER() OVER (ORDER BY :COL) AS SEQNUM,
COUNT(*) OVER () AS CNT
FROM PROD_EXP_DL_CVM.ACPT_PROD_CVM PC
WHERE PC.PW_END_DATE = '2016-10-18'
)A
GROUP BY 1
UNION ALL
SELECT
'PROD_'||:COL AS VAR,
MIN(:COL) AS PER_MIN,
MIN(CASE WHEN SEQNUM / 0.25 >= CNT THEN :COL END) AS PER_25,
MIN(CASE WHEN SEQNUM / 0.50 >= CNT THEN :COL END) AS PER_50,
MIN(CASE WHEN SEQNUM / 0.75 >= CNT THEN :COL END) AS PER_75,
MAX(:COL) AS PER_MAX
FROM (
SELECT PC.*,
ROW_NUMBER() OVER (ORDER BY :COL) AS SEQNUM,
COUNT(*) OVER () AS CNT
FROM PROD_EXP_DL_CVM.PROD_CVM PC
WHERE PC.PW_END_DATE = '2016-10-18'
)B
GROUP BY 1
;
CALL PROD_CE_WORK_SPACE.NPVAZ_CVM_CHECK_TEST_CASE('DURATION_MACRO_CURR');
期望的结果:
对我来说,看起来我必须接近DBA吗?
以下是我得到的错误: