1

I have oracle table named Query_Times. So i create TableAdapter using VS2010, and add insert query to it:

INSERT INTO QUERY_TIMES (ID, QRY_TIMESTAMP) VALUES (1, @qry_time)

QRY_TIMESTAMP is timestamp(6) data type.

In code i try to execute query like this:

QUERY_TIMESTableAdapter tblqry_times = new QUERY_TIMESTableAdapter();
tblqry_times.InsertQryTime(currTime);

but i got an error Message=ORA-01036: illegal variable name/number.

How to correctly define parameter to use it in a query?

2 Answers 2

0

Oracle uses the : parameter prefix (see http://dotnetfacts.blogspot.com/2009/01/adonet-command-parameters.html)

Sign up to request clarification or add additional context in comments.

1 Comment

my big fail((. Thank you for help
0

In oracle you use variables like ':variableName'. This called bind variable. It improves query performance as execution plan gets reuse. So, if you use bind variables, you have to assign its value as well through you front-end code.

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.