How about the non-functional diffs ?
J. Laurindo Chiappa, June 25, 2018 - 11:51 am UTC
June 26, 2018 - 3:07 am UTC
I'm pretty sure SQL Dev can't do that, and its a much harder job that it might seem.
Take the simple example of case-insensitivity
declare xxx varchar2(10) := 'Hello';
declare XXX varchar2(10) := 'Hello';
and equivalent, but
declare "xxx" varchar2(10) := 'Hello';
declare XXX varchar2(10) := 'Hello';
are not. Neither is:
declare xxx varchar2(10) := 'Hello';
declare xxx varchar2(10) := 'hello';
Similarly...
declare xxx varchar(10) := 'Hello';
declare xxx varchar2(10) := 'Hello';
are equivalent ... but should we highlight it as a difference?
I'm not saying it's not doable - I'm just saying it is not the same as simply setting the "ignore case" flag and things will be all rosy.
Yes, difficulties...
J. Laurindo Chiappa, June 26, 2018 - 1:02 pm UTC
Quoted strings diffs must be considered differences, but Yes, it´s not a simple logic...
SQL DEVELOPER have some internal facilities/resources to do it, for sure : for example, if I set in the code formatting options Identifiers case and Keywords case to UPPER (menu Tools, item Preferences, then inside Code Editor option Format) I will get the desired effect , ie, change my text :
declare
xxx varchar2(10) := 'Hello';
begin
XXX := 'ABC';
END;
DECLARE
XXX VARCHAR2(10) := 'hello';
Begin
xxx := 'xyz';
END;
to :
DECLARE
XXX VARCHAR(10) := 'Hello';
BEGIN
XXX := 'ABC';
END;
DECLARE
XXX VARCHAR2(10) := 'hello';
BEGIN
XXX := 'xyz';
END;
"escaping"/disconsidering the quoted strings as desired... But I was totally unable to use this features inside Code Comparision, and other necessities (such as remove extra whitespaces and linebreaks) were not found (by me) in the Code Format and/or Code Comparision options : due to this I opted for 'manual' procedures, such as extract the code via DBMS_METADATA and manipulate it with regexp, string functions and alike...
If really the task can´t be done inside SQL DEVELOPER, I will need to write something by myself, I think... But let me say thank you for confirming it...
Regards,
Chiappa