Run queries in Toad

Message from: fred.schmid_265

I am new to Oracle and used to write code in SQL Server. When testing queries I
could define and set variables and then use them in a select statement. The
output would go to the grid.
Now in Oracle you cannot do that. What is the simplest way to display the
results of a select query to the output data grid.


Historical Messages

Author: fred.schmid_265
Date: Tue Feb 15 07:55:16 PST 2011
I am new to Oracle and used to write code in SQL Server. When testing queries I
could define and set variables and then use them in a select statement. The
output would go to the grid.
Now in Oracle you cannot do that. What is the simplest way to display the
results of a select query to the output data grid.
__


What is the simplest way to display the

results of a select query to the output data grid.

Err… run it?

Perhaps I misunderstood the question.

Here’s a simple query you can run so you can see what happens then you can
modify your question to be more concise on what you’re actually doing.

SELECT :a

FROM DUAL

Put the cursor on the above line and hit + F9 to run it. Toad
should prompt you to populate the variable (unless you’re database is set
up with a different character for variables), you populate that, hit OK, and the
result you populated should show up in the data grid.

Roger S.