Paste from Host Language truncates last line
|
Joined: Feb 2006
Posts: 619 Sao Paulo, Brazil
Member
|
OP
Member
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
|
Joined: Aug 1999
Posts: 22,218
Member
|
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
|
Joined: Feb 2006
Posts: 619 Sao Paulo, Brazil
Member
|
OP
Member
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
|
Joined: Feb 2006
Posts: 619 Sao Paulo, Brazil
Member
|
OP
Member
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
|
Joined: Aug 1999
Posts: 22,218
Member
|
Member
Joined: Aug 1999
Posts: 22,218 |
Marco Kalter Allround Automations
|
|
|
Re: Paste from Host Language truncates last line
|
Joined: Feb 2006
Posts: 619 Sao Paulo, Brazil
Member
|
OP
Member
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
|
Joined: Feb 2006
Posts: 619 Sao Paulo, Brazil
Member
|
OP
Member
Joined: Feb 2006
Posts: 619 Sao Paulo, Brazil |
Hi! This is still not working. 1. Run 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 "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 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
|
Joined: Aug 1999
Posts: 22,218
Member
|
Member
Joined: Aug 1999
Posts: 22,218 |
Marco Kalter Allround Automations
|
|
|
|
|