Print Thread
Feature request - copy with variable/constant to literal replacement
#61301 03/23/20 01:25 PM
Joined: Jul 2013
Posts: 8
A
Member
OP Offline
Member
A
Joined: Jul 2013
Posts: 8
It would be a pretty neat feature to be able to copy some big cursor which is using variables and constants from other packages with those replaced as literals.

We often end up spending a huge amount of time hovering above some variables to get the current variables and replace all of them by hand when we are trying to transfer a cursor from a package into a SQL window to find out what condition or join eliminated a certain row.

Re: Feature request - copy with variable/constant to literal replacement
aLpenbog #61312 03/24/20 08:56 AM
Joined: Aug 1999
Posts: 22,206
Member
Offline
Member
Joined: Aug 1999
Posts: 22,206
Are you referring to code running in the debugger in combination with the variable values at that point of execution?


Marco Kalter
Allround Automations
Re: Feature request - copy with variable/constant to literal replacement
Marco Kalter #61313 03/24/20 11:54 AM
Joined: Jul 2013
Posts: 8
A
Member
OP Offline
Member
A
Joined: Jul 2013
Posts: 8
Exactly.

Last edited by aLpenbog; 03/24/20 11:54 AM.
Re: Feature request - copy with variable/constant to literal replacement
aLpenbog #61314 03/24/20 04:07 PM
Joined: Aug 1999
Posts: 22,206
Member
Offline
Member
Joined: Aug 1999
Posts: 22,206
Okay. One more question: would this be restricted to single DML statements (select, update, insert, delete)?

I have added this to the list of enhancement requests.


Marco Kalter
Allround Automations
Re: Feature request - copy with variable/constant to literal replacement
Marco Kalter #61316 03/25/20 06:53 AM
Joined: Jun 2017
Posts: 43
Dresden, Germany
J
Member
Offline
Member
J
Joined: Jun 2017
Posts: 43
Dresden, Germany
This would be a great simplification! Please put it on top of the list.

Re: Feature request - copy with variable/constant to literal replacement
Marco Kalter #61318 03/25/20 05:45 PM
Joined: Jul 2013
Posts: 8
A
Member
OP Offline
Member
A
Joined: Jul 2013
Posts: 8
[quote=Marco Kalter]Okay. One more question: would this be restricted to single DML statements (select, update, insert, delete)?[/quote]

For me personally, yes. Most of the time it's transferring a big cursor to a sql window and replacing variables and package constants in order to execute that query and modify join/where conditions to find out why an expected row got filtered out or in order to use the explain plan window etc. Or even to check if the result looks right when modifying those cursors inside the pl/sql routines.

So basically it's just a fast transfer from pl/sql to running those DMLs in a sql window. That is like 95% what I would need a feature like this for.

But I guess it could be useful for concatenated strings too, especially in the context of dynamic sql, even with merged single quotes, which were used to escape those etc. But most of the time those are smaller statements which don't take that much time to replace by hand.

Last edited by aLpenbog; 03/25/20 05:46 PM.
Re: Feature request - copy with variable/constant to literal replacement
aLpenbog #61380 04/03/20 12:26 PM
Joined: Oct 2003
Posts: 38
Netherlands
Member
Offline
Member
Joined: Oct 2003
Posts: 38
Netherlands
[quote=aLpenbog]
So basically it's just a fast transfer from pl/sql to running those DMLs in a sql window. That is like 95% what I would need a feature like this for.[/quote]

Yes, that would be a really nice feature. It is something I also do a lot. When I am debugging code, often I copy SQL containing constants and variables to an SQL window. Substituting them with literals, especially when these are current values in the debug window would be really neat!

A tip for the time being: You can add a colon : before all variables so you get the parameter popup when you execute the SQL window.


SQL> alter ego rebuild;
Re: Feature request - copy with variable/constant to literal replacement
Rob van Rijen #61418 04/08/20 05:15 PM
Joined: Jan 2015
Posts: 89
Cambridge, UK
C
cct Offline
Member
Offline
Member
C
Joined: Jan 2015
Posts: 89
Cambridge, UK
I also do it when writing code - particularly to tune SQL - I still use an Oracle 8 database frown

Normally I just replace variables etc with literals, but that is also a pain.

Something that catered for this woudl be nice, even if it is similar to substitution variables

Chris


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.153s Queries: 15 (0.076s) Memory: 2.5265 MB (Peak: 3.0380 MB) Data Comp: Off Server Time: 2024-04-28 21:23:01 UTC
Valid HTML 5 and Valid CSS