Learn more about Toad for SQL Server Find solutions and downloads at the |
< To bookmark a page, right-click the Page Title and select Add to Favorites / Bookmark This Page |
Toad for SQL Server 5.7 |
You can execute queries that contain parameter binds and can specify the bind variables. In addition, Toad also allows you to store a value for a bind variable.
Toad supports the following bind variable formats:
Colon (:variable;)
Example: SELECT * from employee WHERE user = :user;
At symbol (@variable;)
Example: SELECT * from employee WHERE user = @user;
Question mark (?;) for anonymous bind formats such as PERL, DBI, or JDBC)
Example: SELECT * from employee WHERE user = ?;
Notes:
Avoid using the same symbol to represent a bind variable and statement delimiter in the same SQL statement.
To set a bind variable
In the Editor, compose and execute a query that contains parameter binds. Toad immediately displays the Bind Variables dialog.
Enter the bind variable information. Review the following for additional information:
Type |
Select the data type for the variable from the list. |
Direction |
Select the direction of variable from the list. |
Value |
Enter the value of the variable. Notes:
|
To use a bind variable in the Query Builder
» | In the Where, Having, or OR Condition editor, enter the bind variable in place of a constant. |
To store a value for a bind variable
Toad allows you to store a value for a bind variable. Then, when you execute a SQL statement containing that bind variable, Toad will not prompt you for a value. You can access this feature from the Project Manager toolbar.