Start a new topic

How to strip comments while executing through command line

[This topic is migrated from our old forums. The original author name has been removed]

Using DBVisualizer 9.2.3 on Windows 7 with Java 1.7. When I run scripts through the GUI, it strips the comments, While when I run the same comments through command line, it is not stripping the comments. In addition if I have a code like: /* select * from tab1; */ select * from tab2; and the script is being run on Vertica (that has /* */ as block of comments), it gives an error for 'Unterminated /* comment' as it tries to execute when it reads the first ';'. I would like to run scripts from command line by stripping comments as per the settings set in the GUI. Is there a way? Ahmer

[This reply is migrated from our old forums.]

Re: How to strip comments while executing through command line
Hi Ahmer, We will change the command line so that it uses the setting for comment stripping from the GUI by default and also add a new option so that it can be overridden for the command line. Regarding the problem with a semicolon in the comment causing a problem, please upgrade to the latest version of DbVisualizer (9.2.3) since this has been fixed. Best Regards, Hans
[This reply is migrated from our old forums. The original author name has been removed]

Re: How to strip comments while executing through command line
Hi Hans, Thank you for your reply. I am running version 9.2.3 and am still getting the error. The About tab shows: Product: DbVisualizer Pro 9.2.3 [Build #2415] OS: Windows 7 OS Version: 6.1 OS Arch: amd64 Java Version: 1.7.0_76 Java VM: Java HotSpot(TM) 64-Bit Server VM Java Vendor: Oracle Corporation Java Home: c:\program files\dbvisualizer\jre DbVis Home: C:\Program Files\DbVisualizer User Home: C:\Users\asiddiqui PrefsDir: C:\Users\----\.dbvis BindDir: C:\Users\----\.dbvis\[0] *SQL*: /* select * from tab1; */ select * from tab2; *Error:* 13:07:05 [/* - 0 row(s), 0.000 secs] [Error Code: 5305, SQL State: 42601] [Vertica][VJDBC](5305) ERROR: Unterminated /* comment at or near "/* select * from tab1" ... Stopped because of errors The only difference from the default settings is that I have set /--- as start of a comment block and ---/ as the end. Vertica uses /* +direct */ as a directive to the database for a direct insert and using the default block comments along with striping of comments, the directives would not have gone to the database. Best regards Ahmer
[This reply is migrated from our old forums.]

Re: How to strip comments while executing through command line
Hi Ahmer, If you have set the block comment delimiters to /--- and ---/, DbVisualizer will not stripp off the comments regardless of the Strip Comments When Executing setting. So in your example the comment is sent to the database and the error message you get comes from the database. Best Regards, Hans
[This reply is migrated from our old forums. The original author name has been removed]

Re: How to strip comments while executing through command line
Hi Hans, Thank you. I guess for my scenario I will have to wait till the feature of stripping is available from command line. Any idea of when it would be available? Best regards Ahmer Edited by: Ahmer Siddiqui on Mar 5, 2015 3:00 AM
[This reply is migrated from our old forums.]

Re: How to strip comments while executing through command line
Hi Ahmer, We are preparing 9.2.4 right now so very soon. Best Regards, Hans
[This reply is migrated from our old forums.]

Re: How to strip comments while executing through command line
Ahmer, This is now fixed in the just released 9.2.4 version. http://www.dbvis.com/download/ Regards Roger
[This reply is migrated from our old forums. The original author name has been removed]

Re: How to strip comments while executing through command line
Excellent guys. I will give it a go. Thank you for such a quick turnaround on this. Best regards Ahmer