I'm trying to insert a row by selecting some datas from another table.
insert into spb (id_barang,nama_barang,qty,lokasi_tujuan,lokasi_asal,waktu)
values
((select stg.id_barang,stg.nama_barang,calculate_req_stok(display.max_stok,display.stok,display.pcs_in_ctn,display.id_barang),display.lokasi,stg.lokasi
from display
inner join stg
on display.nama_barang = stg.nama_barang
where stg.stok >= calculate_req_stok(display.max_stok,display.stok,display.pcs_in_ctn,display.id_barang) * display.pcs_in_ctn),current_time_ms);
It shows this error : ORA-00947: not enough values. I don't know what causes this even though I inserted enough values
Wrong syntax; remove
values
and move the last value to be inserted (current_time_ms
) intoselect
's column list: