I am trying to insert the values of a select query which need to go into a column, into another table along with couple other columns something like below. Data types for the columns.
col1-number, col2-number, col3-varchar, col4-date, col5-char(1),col6-char(1)
insert into table1 (col1, col2, col3, col4, col5, col6, col7)
select ( uid, 22, 'HTML', sysdate,'null','null','N')
from ( select query here)
but when I run the above query I am getting an error - ORA-01858: a non-numeric character was found where a numeric was expected near line 2 of the above query. Can anyone please point me what is wrong with this or if there is a better way to do it. thank you!
CREATE TABLEstatement fortable1. Unrelated, but: the parentheses around the column list in theselectpart are totally useless.col1is a date, and the subquery you haven't shown is returning a string which can't be implicitly converted to a date. You've changed and hidden so much though it's hard to tell what you're really doing. You have too many parentheses at the moment, for a start, which would cause ORA-00907 with what you've shown. It would be much easier if you showed your actual query and the table definition.col4is ofCHARtype :)