All,
I’m on Toad 12.9.0.27. I’m building an insert-from-select statement, so I block the select statement without the preceding insert, then hit F9 and get an ORA-00903 error.
However, when I run the complete statement (including the insert) no error appears.
It looks like (somehow) Toad is passing a mangled query text to Oracle.
For the sake of completeness, I’m pasting the query below. You’ll have to modify to tables defined on your local system.
Abe
insert into iib_krg.localpart_log
select /+choose/
localtimestamp as timestamp
, dbms_transaction.local_transaction_id as transaction_id
, ‘U’ as change_type
, ‘U’ as logical_change_type
, ‘7’ as status
, lp.partno as partno /* supply correct value when row not found */
, lp.compno as compno /* supply correct value when row not found */
, lp.class5 /* old */
, lp.class5 /* new */
, lp.killdate /* old */
, lp.killdate /* new */
, ‘Fake update with data retrieved from OMS’ as message
, -1 as sessionid
from ehda.a_localpart lp inner join utl_krg.active_headquarters_vw hq on hq.compno = lp.compno – select only rows for headquarters
where coalesce(lp.killdate, current_date + 1) > current_date
and not exists
(select 1
from iib_krg.localpart_log ld
where ld.partno = lp.partno
and ld.compno = lp.compno);