How to set Oracle bind variables when using SQLPlus?
问题 How do I set Oracle bind variables when using SQLPlus? Example: SELECT orders.order_no FROM orders WHERE orders.order_date BETWEEN :v1 AND :v2 How do I set the dates of :v1 and :v2 ? 回答1: Notice the following: VARIABLE is a SQLPlus command. You don't end it with a semicolon (;). In the VARIABLE command, you do not precede the variable name with colon (:). Bind variable can't be of data type "date" - they are some sort of character value. For that reason, IN YOUR CODE you must use to_date()