在动态查询中绑定变量

时间:2019-07-18 16:52:37

标签: variables dynamic bind

我似乎无法使该查询正常工作。它与我发现的每个示例匹配,但仍然存在错误:

v_select := 'SELECT count(*)
               FROM customer_order
               WHERE product_id = 197
                 AND subscr_tpye = ''Trial'' 
                 AND TRUNC(order_date) BETWEEN :1 AND :2';

EXECUTE IMMEDIATE v_select INTO v_trials USING y_rec.start_date, y_rec.end_date;

SP2-0552:未声明绑定变量“ 2”

0 个答案:

没有答案