1

i have a script which simply connect to the table in sql*plus and inserts a row in the table.

it is throwing an error as below:

SP2-0552: Bind variable "BIND" not declared

i am not able to figure out exactly what the bind variable is in the query that it is trying to insert.

1
  • 3
    Showing us the script might help us figure out the problem more easily Commented Nov 17, 2009 at 14:28

1 Answer 1

4

You are trying to run a sql like this:

SELECT 1 FROM DUAL WHERE :BIND = 1;

SQL*Plus identifies :BIND as a bind variable, but you haven't declared one in your session yet. To declare the bind variable use the VAR(IABLE) command.

VAR BIND NUMBER

Then, you can assign a value to the variable.

EXEC :BIND := 1

Run the select again to confirm that the bind variable is now set. Note that you can also use this variable to hold results from single-row queries.

SELECT 1 INTO :BIND FROM DUAL;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.