PDA

View Full Version : multiple queries in toad


Cambridgeways
06-19-2004, 03:53 PM
I'm new to Toad (free version). I would like to execute a series of
SQL statements like this:

select table_code, table_val from address_types;

select table_code, table_val from name_types;

When I select either one and select 'Execute Current SQL' it runs.
When I select 'Execute SQL All', I get an error 'ORA-00911: invalid
character' and the first statement is highlighted until the semicolon.
So it seems to be objecting to the semicolon. When I select 'Execute
SQL Window Via SQL Plus', both statements run successfully.

Am I missing a setting somewhere that would allow Toad to understand
that I want multiple statements to run? Any help is appeciated.

Anon-o-mouse
06-20-2004, 09:16 AM
On 19 Jun 2004 16:53:29 -0700, cambridgeways@hotmail.com
(Cambridgeways) wrote:
I'm new to Toad (free version). I would like to execute a series ofSQL statements like this:select table_code, table_val from address_types;select table_code, table_val from name_types;When I select either one and select 'Execute Current SQL' it runs.When I select 'Execute SQL All', I get an error 'ORA-00911: invalidcharacter' and the first statement is highlighted until the semicolon. So it seems to be objecting to the semicolon. When I select 'ExecuteSQL Window Via SQL Plus', both statements run successfully.Am I missing a setting somewhere that would allow Toad to understandthat I want multiple statements to run? Any help is appeciated.


You need to select the execute as a script option.

--

Cambridgeways
06-20-2004, 03:46 PM
Anon-o-mouse <Anonomouse@notmail.com> wrote in message news:<n2fbd0tsftq78gurhu82c90ma6fk8htll5@4ax.com>... On 19 Jun 2004 16:53:29 -0700, cambridgeways@hotmail.com (Cambridgeways) wrote:I'm new to Toad (free version). I would like to execute a series ofSQL statements like this:select table_code, table_val from address_types;select table_code, table_val from name_types;When I select either one and select 'Execute Current SQL' it runs.When I select 'Execute SQL All', I get an error 'ORA-00911: invalidcharacter' and the first statement is highlighted until the semicolon. So it seems to be objecting to the semicolon. When I select 'ExecuteSQL Window Via SQL Plus', both statements run successfully.Am I missing a setting somewhere that would allow Toad to understandthat I want multiple statements to run? Any help is appeciated. You need to select the execute as a script option. --
I tried this but nothing appears in the results grid.

Anon-o-mouse
06-23-2004, 12:32 PM
On 20 Jun 2004 16:46:14 -0700, cambridgeways@hotmail.com
(Cambridgeways) wrote:
Anon-o-mouse <Anonomouse@notmail.com> wrote in message news:<n2fbd0tsftq78gurhu82c90ma6fk8htll5@4ax.com>...
-- deleted to preserve my sanity..... --I tried this but nothing appears in the results grid.

OK ... that is because this is not output to the grid.

If you want the output to the grid... I believe you need to have a
single query.
(you could try a union all .. as long as the returned columns are the
same)

*shrug*
this is the best advice I can offer ... aside from running seperate
queried & cut/paste results to some other product.

Open Wound
06-23-2004, 01:05 PM
cambridgeways@hotmail.com (Cambridgeways) wrote in message news:<e0774553.0406191553.4637d3d1@posting.google.com>... I'm new to Toad (free version). I would like to execute a series of SQL statements like this: select table_code, table_val from address_types; select table_code, table_val from name_types; When I select either one and select 'Execute Current SQL' it runs. When I select 'Execute SQL All', I get an error 'ORA-00911: invalid character' and the first statement is highlighted until the semicolon. So it seems to be objecting to the semicolon. When I select 'Execute SQL Window Via SQL Plus', both statements run successfully. Am I missing a setting somewhere that would allow Toad to understand that I want multiple statements to run? Any help is appeciated.


You can surround multiple statements with a BEGIN and an END; to execute
at them at once. However, it appears you are trying to display multiple
resultsets (tables) in one grid at the same time. Toad doesn't support
this. Why do you want multiple tables to be displayed in the grid at the
same time?

Cambridgeways
06-24-2004, 03:20 PM
openwound5000@aol.com (Open Wound) wrote in message news:<e33ccdb5.0406231305.7d8f3ff6@posting.google.com>... cambridgeways@hotmail.com (Cambridgeways) wrote in message news:<e0774553.0406191553.4637d3d1@posting.google.com>... I'm new to Toad (free version). I would like to execute a series of SQL statements like this: select table_code, table_val from address_types; select table_code, table_val from name_types; When I select either one and select 'Execute Current SQL' it runs. When I select 'Execute SQL All', I get an error 'ORA-00911: invalid character' and the first statement is highlighted until the semicolon. So it seems to be objecting to the semicolon. When I select 'Execute SQL Window Via SQL Plus', both statements run successfully. Am I missing a setting somewhere that would allow Toad to understand that I want multiple statements to run? Any help is appeciated. You can surround multiple statements with a BEGIN and an END; to execute at them at once. However, it appears you are trying to display multiple resultsets (tables) in one grid at the same time. Toad doesn't support this. Why do you want multiple tables to be displayed in the grid at the same time?

I want to have in one continuous document a list of lookup tables
without cutting and pasting results. Anyway, I've determined that
this is probably not supported, at least not in the free version. I
just wish the help file were more explicit since the menu commands
imply a certain functionality. Thanks for responding.


MyLounge.com Site Map
Forum: Cars, Cell Phone, Database, Games, Home Improvement, IT, Music, School, Sports, Web Design, Web Server, Weight Loss

The MyLounge.com forum is intended for informational use only and should not be relied upon and is not a substitute for any advice. The information contained on MyLounge.com are opinions and suggestions of members and is not a representation of the opinions of MyLounge.com. MyLounge.com does not warrant or vouch for the accuracy, completeness or usefulness of any postings or the qualifications of any person responding. Please consult a expert or seek the services of an attorney in your area for more accuracy on your specific situation. Please note that our forums also serve as mirrors to Usenet newsgroups. Many posts you see on our forums are made by newsgroup users who may not be members of MyLounge.com Term of Service