ORA-01008: not all variables -DBMS_SSQL.BIND_VARIABLE for multiple occurrences of bind string
Hi.
I have a sql statement which references the same bind string more than once. For example:
select /* SQL generated for export code : LANGUAGE_SUPPORT_CB */
lv_type
, lv_code
, display_value
, description
, lang_code
, tenant_id
from sch_cfg_lov_values
where tenant_id IN ( NVL(:TENANT_ID, 0), 0)
and (lv_type, lv_code, tenant_id)
in (select lv_type, lv_code, tenant_id
from sch_cfg_lov_codes
where tenant_id IN ( :TENANT_ID, 0))
I make a call to bind the value within my code:
dbms_sql.bind_variable(c_dyna_cursor,':TENANT_ID', l_tenant_id);
However, I still get the "ORA-01008: not all variables" error. If I remove the second occurrence of :TENANT_ID (replace with a literal value), then the bind and execution works fine.