MyEclipse Forums
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
damonrand
Post subject: Multiple statements in 'execute sql' [Closed]  PostPosted: Oct 10, 2004 - 03:45 PM
Registered Member
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
 
 View user's profile Send private message  
Reply with quote Back to top
support-rkalla
Post subject:   PostPosted: Oct 11, 2004 - 04:16 AM
Registered Member
Registered Member


Joined: Jan 06, 2004
Posts: 23824

Checking with DB dev.

_________________
Riyad
MyEclipse Support
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
support-jeff
Post subject:   PostPosted: Oct 11, 2004 - 01:24 PM
Moderator
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
 
 View user's profile Send private message  
Reply with quote Back to top
damonrand
Post subject:   PostPosted: Oct 11, 2004 - 01:40 PM
Registered Member
Registered Member


Joined: Aug 18, 2004
Posts: 16

Thanks for the reply.. The semicolon workaround will do me for now..

Damon.
 
 View user's profile Send private message  
Reply with quote Back to top
damonrand
Post subject:   PostPosted: Oct 11, 2004 - 01:40 PM
Registered Member
Registered Member


Joined: Aug 18, 2004
Posts: 16

Thanks for the reply.. The semicolon workaround will do me for now..

Damon.
 
 View user's profile Send private message  
Reply with quote Back to top
CraigPardey
Post subject:   PostPosted: Oct 28, 2004 - 10:10 PM
Veteran Member
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.
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits