PL/SQL (MOSC)

MOSC Banner

ORA-01008: not all variables -DBMS_SSQL.BIND_VARIABLE for multiple occurrences of bind string

in PL/SQL (MOSC) 1 commentAnswered

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.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center