facebook

Multiple statements in ‘execute sql’ [Closed]

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #217308 Reply

    Damon Rand
    Member

    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

    #217329 Reply

    Riyad Kalla
    Member

    Checking with DB dev.

    #217345 Reply

    support-jeff
    Member

    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.

    #217346 Reply

    Damon Rand
    Member

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

    Damon.

    #217347 Reply

    Damon Rand
    Member

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

    Damon.

    #218488 Reply

    CraigPardey
    Member

    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.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Multiple statements in ‘execute sql’ [Closed]

You must be logged in to post in the forum log in