- This topic has 5 replies, 4 voices, and was last updated 20 years, 1 month ago by CraigPardey.
-
AuthorPosts
-
Damon RandMemberHi 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
Riyad KallaMemberChecking with DB dev.
support-jeffMemberThis 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.
Damon RandMemberThanks for the reply.. The semicolon workaround will do me for now..
Damon.
Damon RandMemberThanks for the reply.. The semicolon workaround will do me for now..
Damon.
CraigPardeyMemberI 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.
-
AuthorPosts