| Author |
Message |
|
|
Post subject: Multiple statements in 'execute sql' [Closed]
Posted: Oct 10, 2004 - 03:45 PM
|
|
Registered Member


Joined: Aug 18, 2004
Posts: 16
|
|
Hi there,
I am trying to run a long sql script with Database Explorer. There seem to be some problems though..
If I execute this code it works fine..
/* fsdf */
insert into document (asset_id, index_id) values(2,7)
insert into document (asset_id, index_id) values(2,8)
But if I use the alternate comment style or use go statements then no statements are run.. There may be a logical reason why the below statements should not work.. There is no error message though, they just fail silently..
Regards,
Damon
-- fsdf
insert into document (asset_id, index_id) values(2,7)
insert into document (asset_id, index_id) values(2,8)
/* or this */
insert into document (asset_id, index_id) values(2,7)
go
insert into document (asset_id, index_id) values(2,8)
go |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Oct 11, 2004 - 04:16 AM
|
|
Registered Member

Joined: Jan 06, 2004
Posts: 23824
|
|
Checking with DB dev. |
_________________ Riyad
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Oct 11, 2004 - 01:24 PM
|
|
Moderator


Joined: Jul 18, 2004
Posts: 357
|
|
This happens because DE interprets:
--comment
select * from ...
as
--comment select * from ....
In other words the document parsing of the content of the SQL Editor is not sophisticated enough to interpret the comment line as a separate statement altogether. BTW, if you add a semi-colon after the comment, it does the right thing.
I will enter a bug report on this, but it is a pretty uncommon scenario so I would not expect quick resolution on it. |
_________________ jeff
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Oct 11, 2004 - 01:40 PM
|
|
Registered Member


Joined: Aug 18, 2004
Posts: 16
|
|
Thanks for the reply.. The semicolon workaround will do me for now..
Damon. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Oct 11, 2004 - 01:40 PM
|
|
Registered Member


Joined: Aug 18, 2004
Posts: 16
|
|
Thanks for the reply.. The semicolon workaround will do me for now..
Damon. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Oct 28, 2004 - 10:10 PM
|
|
Veteran Member


Joined: Jun 24, 2004
Posts: 6
|
|
I don't think this is "a pretty uncommon scenario". In fact, for anyone out there that uses Sybase it is a very common scenario to have scripts with 'go' statements in them.
Sybase won't execute a multi-command script unless the 'go' is present
Whenever stored procedures, table definitions etc are exported from the database into script files, they are generated with the problematic 'go' statements.
I am trying to encourage my developers to use the DB Browser and SQL editor to modify stored procedures so that the changes are kept in CVS, but this is quite a drawback because I'll have to convert all of our existing scripts to work with MyEclipse. |
|
|
| |
|
|
|
 |
|
|