tags:

views:

87

answers:

1

im trying to use the vs2008 query builder to create a query with a parameter. i know that in sql server it would work with: select col1,col2 from tbl where col3=@myParam

how would it be typed in oracle or is it pl/sql? i get the problem in the @myParam part.

+2  A: 

Oracle SQL parameters are specified using ':'

SELECT col1, col2 FROM tbl WHERE col3=:myParam

You'll have to be careful when specifying this in an OracleParameter though, as some libraries miss off the :, and some require it to bind correctly.

thecoop
when i do that, it accepts the query, but when i prevew the query it says: "ORA-01008: not all variables bound" and i did put a value in that parameter for the preview.
Alon Amir
The problem is that i use an old version of oracle (7) and it does not support named parameters.
Alon Amir
@thecoop: *bind* variables are prefixed with a colon.
OMG Ponies