facebook

SQL Editor – SQL Comments top processing

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

    If I attempt to run have the following SQL:

    select * from AMCPSINTHP where apinvoice_ in ( ‘35426155R’, ‘35426154R’);
    — select * from AMCPSINMP where apinvoice# in ( ‘35426155R’, ‘35426154R’);
    select * from AMCPSINTP where apinvoice# in ( ‘35426155R’, ‘35426154R’);

    It only process the first SQL statement and stops once it hits the comment block. This is a bug to me as SQL commented lines should be skipped and processing should move to the next line.

    I am runing on Windows XP with the following Eclipse setup:

    Eclipse SDK
    Version: 3.1.0
    Build id: I20050627-1435

    MyEclipse JSF Support
    Version: 4.0.0
    Build id: 20050829-4.0.0-GA

    The interesting thing is that on Version 3.8.4 this does not occur.

    #238583 Reply

    Slight update to the above. If I highlight all 3 rows then it properly process the 2 un-commented lines. But if I put the cursor right be side the 1st line then only that one runs. There are many other variations that do/do not work though.

    #238611 Reply

    Kapil Kapre
    Member

    Any errors in the log?
    (MyEclipse>About..>Configuration..>View Error Log)

    #238628 Reply

    support-michael
    Keymaster

    The SQL editor has the ability to execute the contents of the entire edit buffer or a selected region. If you have any selection then only the lines in the selected region will be evaluated. We will take closer look to see if the selection is goofing the full buffer processing.

    Please provide feedback on if you have any selection when you select the “running-man” icon.

    #238629 Reply

    support-michael
    Keymaster

    A follow up question while on this issue. We recently discussed having 2 sql scriplet execution actions: 1 for the selected lines and 1 for the entire buffer. Thoughts?

    #238631 Reply

    Brian Fernandes
    Moderator

    I tried out something similar with a MySQL database, it worked as expected, even though the second select statement was commented.
    I moved the cursor to the beginning and the end of the first line, the 2 uncommented queries still executed without issue.

    As Michael mentioned above, if you explicitly select a query, only that query was executed.

    The SQL Results view shows two Result tabs (one for each query), which I’m sure you would’ve noticed, but just checking…

    Could you try removing the comment block and then try repositioning your cursor, does it work for you always? I’m trying to ascertain whether the problem is the comment block or something else.
    Could you give us more details like the DB and Driver you are using?

    Best,
    Brian.

    #238670 Reply

    I am using a DB2 AS400 database driver [jt400.jar] and I am on the windows platform. Now the weird part is that it is working today. But I re-started my Eclipse instances. I wonder if something happens over time?

    #238675 Reply

    Brian Fernandes
    Moderator

    There is nothing that “happens over time” 🙂

    If you install MyEclipse to an existing eclipse installation, restarting eclipse with a -clean switch (just once) is probably a good idea.

    What you saw was probably a configuration glitch. If it happens again, let us know.

    Best,
    Brian.

    #238678 Reply

    I attempted to post some more updates but it stopped me. Any way I can send the another way to you?

    #238679 Reply

    I was tryign to type in a lot of formmated SQL with other text

    Forbidden
    You don’t have permission to access /index.php on this server.

    In any event, here is a condesed version of what I did minus the actualy SQL:

    I found out some more infromati onfor you. It seems as though if I open a *.sql file then it seems to work just fine. But if I open up SQL Editor from the database connection, that is when it starts to get weird.

    So what I did was right click on the DB Connection and say “New SQL Editor”. Then I click on the the open file button and open up my *.sql file which looks like the following:

    The interesting thing is that I select NOTHING or select the entire buffer then it only executes only 3 SQL statement and not the third one. But if I start select parts of it it works better.

    #238682 Reply

    Brian Fernandes
    Moderator

    Could you mail us the SQL at support@genuitec.com ATTN Brian?

    I just tried out exactly the same steps you outlined, but experienced no problems, it works as I stated above.

    The interesting thing is that I select NOTHING or select the entire buffer then it only executes only 3 SQL statement and not the third one. But if I start select parts of it it works better.

    I didn’t quite understand that – if you select nothing or the entire buffer, it executes only the 3rd SQL statment, but all 3 statements if you make an arbitrary selection?
    Can you try removing the comment and repeat your above steps, does it still fail intermittently? Does it fail only for certain SQL statements or will any statement do?

    Finally, how did you install ME 4.0? Did you upgrade an existing eclipse installation or did you install Eclipse and ME to a new location? If you used an existing eclipse installation, please restart it with a -clean switch.
    If you could answer all the relavent questions in Posting Guidelines, it would help.

    Best,
    Brian.

    #244818 Reply

    jroberts
    Member

    I believe I am experiancing the same thing he is trying to explain.

    if you have a bunch of statements:

    
     
    --this is a comment
    Insert into SomeTable values(1);
    Insert into SomeTable values(2);
    Insert into SomeTable values(3);
    
    

    Running this code from the editor will only insert values 2 and 3. it doesnt matter if you highlight all the statements(including the comment) or just click the run button. It appears that the editor will always skip running the statement directly after a comment. It also doesn’t matter if you have a blank line after the comment.

    I am using Myeclipse 4.1 M1 on Gentoo linux with mysql 4.1.14

    #244822 Reply

    Riyad Kalla
    Member

    jroberts,
    This was filed as a bug and we are looking into it right now.

    #244831 Reply

    Brian Fernandes
    Moderator

    j,

    We identified and fixed this issue and it will be available in the next release which is due next week.

    There are still some issues that remain to be addressed with single line comments, and we are actively cracking down on them.

    Best,
    Brian.

Viewing 14 posts - 1 through 14 (of 14 total)
Reply To: SQL Editor – SQL Comments top processing

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