我有一个DATA类型为date的列,另一个表也有数据类型date。
我使用insert语句插入tab1,如:
insert into tab1
(Select date_from,col1,col2
from tab2,tab3
where tab2.date_from =tab3.date_from
and tab2.val='DES');
现在这是投掷
SQL Error: ORA-01858: a non-numeric character was found where a numeric was expected
01858. 00000 - "a non-numeric character was found where a numeric was expected"
*Cause: The input data to be converted using a date format model was
incorrect. The input data did not contain a number where a number was
required by the format model.
*Action: Fix the input data or the date format model to make sure the
elements match in number and type. Then retry the operation.
使用以下内容时:
merge
INTO hr.TAB1 trg
using (
select * from( select distinct T1.rowid as RID, T2.CODE1, T2.SOURCE_SYSTEM_OWNER, T2.DATE_fROM ,
ROW_NUMBER() over (partition BY NAME order by t2.CODE1) rn
from HR.TAB1 T1
join XX_ORG T2
on UPPER(T1.NAME) = UPPER(T2.NAME)
where uppeR(T1.name) = upper(T2.NAME))
where rn=1
-- and t1.ORGANIZATION_NAME='TMI Operations, M1'
) src
ON (trg.rowid = src.rid)
when matched then update
set TRG.CODE1 = SRC.CODE1,
trg.DATE_fROM= =SRC.DATE_fROM;
Gtting
Error report:
SQL Error: ORA-30926: unable to get a stable set of rows in the source tables
30926. 00000 - "unable to get a stable set of rows in the source tables"
*Cause: A stable set of rows could not be got because of large dml
activity or a non-deterministic where clause.
答案 0 :(得分:1)
只需删除括号?
insert into tab1
Select tab3.date_from,col1,col2
from tab2
join tab3 on tab2.date_from =tab3.date_from
where tab2.val='DES'
修改强>:
您可能需要指定插入的列。像
这样的东西insert into tab1 (c1, c2, c3)
Select ...