Hi All,
I got this import solution:
Bulk Insert from webapp
Trying to get sequence number and field id in from trigger before insert.
The excel csv file contains three fields:
DATE, PROGRAM, COST
The table structure is:
CREATE TABLE "MYDB"."ME_TEST"
("ME_ID" NUMBER,
"ME_DATE" DATE NOT NULL ENABLE,
"UNIT_PROGRAM_ID" NUMBER,
"COST" NUMBER);
Need to create the sequence for ME_ID field and find the program_id from PROGRAM table and store the program_id in this table using the trigger
create or replace trigger getAllKeys
before insert
on ME_TEST
for each row
declare
v_program_id numeric;
begin
if :new.ME_ID is null then
select Sq_Me_Id.Nextval into :new.ME_ID
from dual;
end if;
select unit_program_id into v_program_id
from unit_program
where unit_program_name = XXX ;
:new.unit_program_id = v_program_id;
end ;
How can I pass the excel PROGRAM field value to the XXX in the where statement?
Thanks,
Johnny
Using Oracle Database 12c Enterprise Edition Release 12.1.0.2.0