I am trying to use SQLExecutor to either insert or update a record in a table stored in Oracle - please see sql below. It gave me the following error. any ideas why?
declare
counts int;
begin
select count(*) into counts FROM employee where emp_id = '@Value(empid)';
case
when counts = 0 then INSERT INTO employee VALUES ('@Value(empid)','@Value(firstname)');
when counts = 1 then UPDATE employee SET firstname = '@Value(firstname)' WHERE emp_id = '@Value(empid)';
end case;
end;
An error occurred while accessing a table result for feature type `'; message was `Execution of statement '
......
did not succeed; error was `ORA-06550: line 7, column 14:
PL/SQL: ORA-00933: SQL command not properly ended
ORA-06550: line 6, column 30:
PL/SQL: SQL Statement ignored
ORA-06550: line 9, column 4:
PLS-00103: Encountered the symbol ";" when expecting one of the following: