How to Comment a portion of the statement in single line query

How to comment a portion of the statement in single line query.

For example : select * from PRODUCT where branch=‘10’ and reference=‘GF’;

If I want to comment Branch=‘10’ , please let me know any other way apart from using /**/ in toad for oracle V10.5.1.3

place “–” chars in the line where the rest will be assign as commnet. i.e. your case (best option)

select * from PRODUCT

where 1=1

– and branch=‘10’

and reference=‘GF’

;

so now you can change (comment) second or third or even together …

Brg

Damir

It would be very nice to have a comment function in Toad as in some other tools:

  • Comment a block of code with /**/

  • uncomment such a block by placing the cursor in that blcok and choosing “uncomment”

The current function to comment a block of lines by adding – in front of a line is not usefull for blocks with a bulk of lines because I only uncomment that block by marking it manually and then choose uncomment.

So an improvement for this is welcome ;-))

Regards,

Dirk

could you show example of your words?

:slight_smile:

Hello Damir,

following (not high sophisticated ;-))) example:

vA := vB;

/* vX := vB;

vC := vD;*/

vX := vA + vB;

To comment out this block of code for testing using Toad:

I mark the 3 lines and choose “Refactor/Comment Block”

This results in:

– vA := vB;

– /* vX := vB;

– vC := vD;*/

– vX := vA + vB;

If I now want to undo my commenting I:

  • have to keep in mind what I commented out

  • have to mark the section manually

  • choose “Refactor/Uncomment Block”

I would prefere the following way and this wouls solve the problem of Harihar too:

Mark the block to be commented out and choose “Refactor/Comment Block”

which results in:

/*vA := vB;

* vX := vB;

vC := vD;*\

vX := vA + vB;*/

(be aware of replacement / by \ because multiline comment within multiline comment is not allowed)

To uncomment the block I:

only place the cursor within the block!!! and choose "“Refactor/Uncomment Block”

Now Toad:

  • does a backward search to find the beginning and a forward search to find the end of the commented block

  • replaces * by /*

  • replaces *\ by */

  • removes the beginning “/" and closing "/”

This would allow to to comment/uncomment a BIG block of code much more comfortable than the current solution. Maybe by adding a new optin named “Refactor/Comment Block by /**/”

Thanks in advance,

Dirk

I ask everyone here to confirm that before your “not high sophisticated ;-))) example:” anyone has clear view what you are saying. beside look at mine comment and see that no one else has involved.

:slight_smile:

Now is all clear.

I think this is a bug so guys from development team will put that on some future fix list. But as I’m not part of that team, have to wait for clarification from them directly.

Brg

Damir

Suggest you add this request to the idea pond for votes. I am not sure you can call a missing user preferred mode of operation a bug - it’s more likely an enhancement request. Such ER’s are best put on idea pond where other users can vote so dev can see the proper priority to assign - and hence when to schedule.

The link...
http://www.toadworld.com/products/toad-for-oracle/i/default.aspx

Searching for it via Google still returns our old, read-only IdeaPond.

On 04/14/2014 08:08 AM, Bert Scalzo wrote:

RE: How to Comment a portion of the statement in single line query

Reply by Bert Scalzo
Suggest you add this request to the idea pond for votes. I am not sure you can call a missing user preferred mode of operation a bug - it's more likely an enhancement request. Such ER's are best put on idea pond where other users can vote so dev can see
the proper priority to assign - and hence when to schedule.

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or
Unsubscribe from Toad for Oracle - General
notifications altogether.

Toad for Oracle - Discussion Forum

Flag
this post as spam/abuse.