Replicated and make a change to a space in the code.
Note: I took the space before the CREATE and space "temp2 ( " on the table creation code.
CREATE TABLE temp2 (
RE_COMPL_DATE DATE,
RE_COMPL_RSN VARCHAR2(3 BYTE)
);
############
merge into temp2
using (
select 'AA' type_code,
to_date('12/01/9999') event_date
from dual
) src
on ( 1 = 1 )
when matched then update
set temp2.re_compl_date = src.event_date,
temp2.re_compl_rsn = src.type_code;
The modified code runs successfully and does not produce the same error as the original code. But looks like the culprit is related to the "Tab/Indent" encoded characters. This is also why seeing modifications work in some cases and not in others, based on your changed spacing.
In Notepad++, using the original code the tab-indent.
..../..../.. set temp2.re_compl_date = src.event_date,
.../.. temp2.re_compl_rsn = src.type_code;
If the tab indents are replaced with spaces characters, the code works perfectly in Toad 13.1. However, if more Tab-indenting is added, then the error thrown by Toad cuts off even more characters from the end of the SQL script. Characters cutoff from the end of the script seem to range between 2 and 4 characters additional missing characters, PER each tab-indent added.
Toad 12.11 does not show any problems with parsing the tab-indent encoded characters. In contrast, Toad 13.1 appears to not be able to parse the encoded tab-indent characters correctly.
This issue will be fixed in a future version of the product. Debug ID TOR-3315