Paste from Host Language truncates last line

Gustavo

Member³
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:
"LINE 1
"
"LINE 2
"
"LINE 3
"
... 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
 
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.
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).

Adding an END; is a lot less work then removing the trash, but it would be great to have it working as expected.
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?
 
you only have access to the dba_source view (and not to dba_objects)
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.

Can you provide a complete text that does not paste correctly for you?
The following one works fine (run the query, copy the text column and "Paste from host language" to a program window):
select * from dba_source where name = 'DBMS_OUTPUT' and type = 'PACKAGE';
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):
select * from dba_source where owner = 'SYS' and type = 'TRIGGER';

Regards,
Gustavo
 
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;
 
Back
Top