Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-01006: bind variable does not exist

André Vila CovaMay 15 2017 — edited May 25 2017

Hi guys,

Any idea why we are getting ORA-01006: bind variable does not exist the following code execution?

The strange thing is that this error is not happening for all sessions (some users are able to execute successfully ).

Database version: 12.1.0.2 (red hat 6)

declare

p_owner varchar2(50):= 'OWNER';

p_name  varchar2(50):= 'TABLE_NAME';

idx varchar2(50);

locality  varchar2(50);

BEGIN

SELECT i.index_name idx, api.locality locality into idx, locality

                          FROM all_indexes i, all_part_indexes api

                         WHERE i.table_owner = p_owner

                           AND i.table_name = p_name

                           AND i.owner = api.owner(+)

                           AND i.index_name = api.index_name(+)

                           AND NOT EXISTS (SELECT c.constraint_name

                                  FROM all_constraints c

                                 WHERE c.table_name = i.table_name

                                   AND c.constraint_type IN ('P'

                                                            ,'U')

                                   AND c.constraint_name = i.index_name)

                           AND i.status <> 'UNUSABLE'

                         ORDER BY idx;

END;

ORA-01006: bind variable does not exist

ORA-06512: in line 10

01006. 00000 -  "bind variable does not exist"

Thanks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 22 2017
Added on May 15 2017
13 comments
2,896 views