Morning Joe,
...
In this release it appears that Toad wants me to provide a
value for the same variable every time it used. For instance
I have a query that unions about 10 queries together. The
each are going against the same schema using the same
variable &SCHEMA.
Select *
From $SCHEMA.table1 A,
$SCHEMA.table2 B
...
Is the '$' a typo? It should be an ampersand '&' or two '&&'. Also, I
think you need two dots between the &SCHEMA and the table name:
Select *
From &SCHEMA..table1 A,
&SCHEMA..table2 B
...
Because the first dot tells SQL*Plus/Toad to "stop substitution", as in:
Since this variable is used twice in each query I getting
about 20 SCHEMA values to fill in (SCHEMA(1) through
SCHEMA(20). Older versions such a 9.7.2 correctly
intrpretted that like variables only need to prompted for once.
In SQL*Plus, which Toad emulates to a certain degree, the '&' is used to
prompt for each and every occurrence of a variable (unless it has been
DEFINEd or ACCEPTed first of course) and the '&&' only prompts for the
first occurrence and then uses it again for each subsequent occurrence.
It sounds remarkably like 9.7.2 was broken!
I tried this in 9.5:
SELECT * FROM &SCHEMA..dual
UNION ALL
SELECT * FROM &SCHEMA..dual;
The variables prompt showed two separate variables. When I filled in the
first and clicked OK, I was prompted that "one variable is still empty,
do you want to fix it?".
When I ran it like this:
SELECT * FROM &&SCHEMA..dual
UNION ALL
SELECT * FROM &&SCHEMA..dual;
There was one single variable in the list, and I only received the one
prompt.
Cheers,
Norm. [TeamT]
Information in this message may be confidential and may be legally privileged. If you have received this message by mistake, please notify the sender immediately, delete it and do not copy it to anyone else. We have checked this email and its attachments for viruses. But you should still check any attachment before opening it. We may have to make this message and any reply to it public if asked to under the Freedom of Information Act, Data Protection Act or for litigation. Email messages and attachments sent to or from any Environment Agency address may also be accessed by someone other than the sender or recipient, for business purposes. If we have sent you information and you wish to use it please read our terms and conditions which you can get by calling us on 08708 506 506. Find out more about the Environment Agency at www.environment-agency.gov.uk
Information in this message may be confidential and may be legally privileged. If you have received this message by mistake, please notify the sender immediately, delete it and do not copy it to anyone else.
We have checked this email and its attachments for viruses. But you should still check any attachment before opening it.
We may have to make this message and any reply to it public if asked to under the Freedom of Information Act, Data Protection Act or for litigation. Email messages and attachments sent to or from any Environment Agency address may also be accessed by someone other than the sender or recipient, for business purposes.
If we have sent you information and you wish to use it please read our terms and conditions which you can get by calling us on 08708 506 506. Find out more about the Environment Agency at www.environment-agency.gov.uk