我正在尝试像这样填充数据块:
PROCEDURE POP_BLOCK IS
Q VARCHAR2(2000);
BEGIN
Q:='(SELECT ROW_NUMBER () OVER (ORDER BY ROWNUM) SR, LN_DT, PER_MNTH, DEP_CR,
FIRST_VALUE (LOAN_AMOUNT - DOWN_PAYMENT) OVER (ORDER BY ROWNUM)
- SUM (PER_MNTH + DEP_CR) OVER (ORDER BY ROWNUM) BALANCE
FROM (SELECT CAR_LOAN.REGCODE, ROW_NUMBER () OVER (ORDER BY ROWNUM) SR,
LN_DT, PER_MNTH, CASE
WHEN ROWNUM >= 49
THEN 0
ELSE DEP_CR
END DEP_CR, LOAN_AMOUNT, DOWN_PAYMENT
FROM CAR_LOAN, TABLE (LOANINST (CAR_LOAN.LOAN_DATE)))
) WHERE REGCODE = '
||:LOAN_SYSTEM.REGCODE||')';
GO_BLOCK('CAR_LOAN_INSTALLMENT');
Clear_Block ;
SET_BLOCK_PROPERTY('CAR_LOAN_INSTALLMENT', QUERY_DATA_SOURCE_NAME,Q);
EXECUTE_QUERY;
EXCEPTION WHEN OTHERS THEN
MESSAGE(SQLCODE || SQLERRM);
MESSAGE(SQLCODE || SQLERRM);
END;
我在新表单实例上调用此过程,当我运行表单时,它会出错:
frm-41380 error - cannot set the blocks query data source
有人告诉我这里有什么问题,我现在应该做些什么?
答案 0 :(得分:0)
我也有类似的问题。请确保CAR_LOAN_INSTALLMENT数据块具有以下属性(这有助于我解决问题):
数据库数据块:是
允许查询:是
查询数据源类型:FROM子句查询
查询数据源名称:放置表/视图名称或SELECT查询
假设REGCODE是NUMBER而不是VARCHAR2。如果是后者,请确保在动态查询中将其括在单引号中(即上面的Q)。
的问候,
吉里什