Print Thread
Paste from Host Language truncates last line
#54689 11/30/16 06:27 PM
Joined: Feb 2006
Posts: 619
Sao Paulo, Brazil
G
Gustavo Offline OP
Member
OP Offline
Member
G
Joined: Feb 2006
Posts: 619
Sao Paulo, Brazil
Whenever I want to edit source code I type the program name somewhere, then I right-click on it and choose Edit. In some environments, though, it won't always work. The second option is querying dba_source, copying the TEXT column and pasting it to a Program Window. The problem is that it pastes like:[quote]"LINE 1
"
"LINE 2
"
"LINE 3
"[/quote]... and so on.

In order to have the correct text and get syntax highlight back, I have to remove the double-quotes and extra lines.
I've just given a try to Paste from Host Language. I noticed it won't add junk to the copied content, but it doesn't include the last line when pasting. Adding an END; is a lot less work then removing the trash, but it would be great to have it working as expected.

Regards,
Gustavo


There are 10 types of people: those who know binary and those who don't.
Re: Paste from Host Language truncates last line
Gustavo #54700 12/01/16 10:00 AM
Joined: Aug 1999
Posts: 22,218
Member
Offline
Member
Joined: Aug 1999
Posts: 22,218
[quote]Whenever I want to edit source code I type the program name somewhere, then I right-click on it and choose Edit. In some environments, though, it won't always work.[/quote]
What exactly goes wrong? If you can query the code you should be able to edit the program unit as always. The only exception I can think of is that the object is only available to your Oracle user in the dba_objects and dba_source views, and that you only have access to the dba_source view (and not to dba_objects).

[quote]Adding an END; is a lot less work then removing the trash, but it would be great to have it working as expected.[/quote]
I copied the text above and did a "Paste from host language". It perfectly adds the 3 lines. Can you provide a complete text that does not paste correctly for you?


Marco Kalter
Allround Automations
Re: Paste from Host Language truncates last line
Marco Kalter #54706 12/01/16 11:28 AM
Joined: Feb 2006
Posts: 619
Sao Paulo, Brazil
G
Gustavo Offline OP
Member
OP Offline
Member
G
Joined: Feb 2006
Posts: 619
Sao Paulo, Brazil
[quote]you only have access to the dba_source view (and not to dba_objects)[/quote]I can query both views. But sometimes when I type the program name and right-click on it, the object-wise options (edit, view, edit spec and body, view spec and body, drop, describe) don't show in the popup menu.
When I say "sometimes", it is not random. In some customers it always works. In others, it never works.


[quote]Can you provide a complete text that does not paste correctly for you?[/quote]
The following one works fine (run the query, copy the text column and "Paste from host language" to a program window):[quote]select * from dba_source where name = 'DBMS_OUTPUT' and type = 'PACKAGE';[/quote]
While if I do the same thing with this one, the last line is not pasted (an empty 14th line is included, with no text):[quote]select * from dba_source where owner = 'SYS' and type = 'TRIGGER';[/quote]

Regards,
Gustavo


There are 10 types of people: those who know binary and those who don't.
Re: Paste from Host Language truncates last line
Gustavo #54778 12/02/16 12:52 PM
Joined: Feb 2006
Posts: 619
Sao Paulo, Brazil
G
Gustavo Offline OP
Member
OP Offline
Member
G
Joined: Feb 2006
Posts: 619
Sao Paulo, Brazil
Hi, Marco!

Have you been able to reproduce the issue?

Regards,
Gustavo


There are 10 types of people: those who know binary and those who don't.
Re: Paste from Host Language truncates last line
Gustavo #54811 12/05/16 09:53 AM
Joined: Aug 1999
Posts: 22,218
Member
Offline
Member
Joined: Aug 1999
Posts: 22,218
No, not yet.


Marco Kalter
Allround Automations
Re: Paste from Host Language truncates last line
Marco Kalter #54977 12/12/16 05:45 PM
Joined: Feb 2006
Posts: 619
Sao Paulo, Brazil
G
Gustavo Offline OP
Member
OP Offline
Member
G
Joined: Feb 2006
Posts: 619
Sao Paulo, Brazil
I can only reproduce the issue when extracting code from Triggers.


There are 10 types of people: those who know binary and those who don't.
Re: Paste from Host Language truncates last line
Gustavo #56431 05/10/17 05:58 PM
Joined: Feb 2006
Posts: 619
Sao Paulo, Brazil
G
Gustavo Offline OP
Member
OP Offline
Member
G
Joined: Feb 2006
Posts: 619
Sao Paulo, Brazil
Hi!

This is still not working.

1. Run
Code
select * from dba_source where owner = 'SYS' and type = 'TRIGGER'
and    name = 'CDC_CREATE_CTABLE_BEFORE'
order by line;
Can be any trigger.

2. Copy the TEXT column

3. Standard Paste result
Code
"TRIGGER sys.cdc_create_ctable_before
"
"  BEFORE
"
"    CREATE ON DATABASE
"
"    BEGIN
"
"      /* NOP UNLESS A TABLE OBJECT */
"
"      IF dictionary_obj_type = 'TABLE'
"
"      THEN
"
"        sys.dbms_cdc_ipublish.change_table_trigger(dictionary_obj_owner,dictionary_obj_name,'LOCK');
"
"      END IF;
"
      END;
4. Special Paste result
Code
TRIGGER sys.cdc_create_ctable_before
  BEFORE
    CREATE ON DATABASE
    BEGIN
      /* NOP UNLESS A TABLE OBJECT */
      IF dictionary_obj_type = 'TABLE'
      THEN
        sys.dbms_cdc_ipublish.change_table_trigger(dictionary_obj_owner,dictionary_obj_name,'LOCK');
      END IF;


There are 10 types of people: those who know binary and those who don't.
Re: Paste from Host Language truncates last line
Gustavo #56434 05/11/17 08:28 AM
Joined: Aug 1999
Posts: 22,218
Member
Offline
Member
Joined: Aug 1999
Posts: 22,218
We'll fix it.


Marco Kalter
Allround Automations

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.041s Queries: 14 (0.010s) Memory: 2.5306 MB (Peak: 3.0394 MB) Data Comp: Off Server Time: 2024-05-15 02:50:31 UTC
Valid HTML 5 and Valid CSS