FME_SQL_DELIMITER is used to indicate the character that is going to separate one SQL sentence from another.
Usually is ";".
I'm not sure what you are doing with the '/' character.
More info here: https://knowledge.safe.com/articles/516/splitting-sql-statements-using-the-fme-sql-delimit.html
Hi Oscard,
Thank you for your answer.
I need the SQL Executor to update several columns in Oracle based on a function (diakriet_cip). First I tried this:
FME_SQL_DELIMITER ;
update tbx.ext_compare_person
set gesnam_d = tbx.diakriet_cip(gesnam_d,sourcekey,'GNAAM')
, gesvor = tbx.diakriet_cip(gesvor,sourcekey,'VNAAM')
, gesnam_d_p = tbx.diakriet_cip(gesnam_d_partner,sourcekey,'GNAAM_P')
where organisatiecode = 'ABDC'
and applicatiecode = 'ABC';
commit;
This results in the same error 'ORA-00900: Invalid SQL-statement'.
Hi Oscard,
Thank you for your answer.
I need the SQL Executor to update several columns in Oracle based on a function (diakriet_cip). First I tried this:
FME_SQL_DELIMITER ;
update tbx.ext_compare_person
set gesnam_d = tbx.diakriet_cip(gesnam_d,sourcekey,'GNAAM')
, gesvor = tbx.diakriet_cip(gesvor,sourcekey,'VNAAM')
, gesnam_d_p = tbx.diakriet_cip(gesnam_d_partner,sourcekey,'GNAAM_P')
where organisatiecode = 'ABDC'
and applicatiecode = 'ABC';
commit;
This results in the same error 'ORA-00900: Invalid SQL-statement'.
And this?
FME_SQL_DELIMITER /
update tbx.ext_compare_person
set gesnam_d = tbx.diakriet_cip(gesnam_d,sourcekey,'GNAAM'),
gesvor = tbx.diakriet_cip(gesvor,sourcekey,'VNAAM'),
gesnam_d_p = tbx.diakriet_cip(gesnam_d_partner,sourcekey,'GNAAM_P')
where organisatiecode = 'ABDC'
and applicatiecode = 'ABC';
commit;
/
Source:
https://knowledge.safe.com/questions/66481/sqlexecutor-atomic-transaction-by-commit.html
Hi Oscard,
Thank you for your answer.
I need the SQL Executor to update several columns in Oracle based on a function (diakriet_cip). First I tried this:
FME_SQL_DELIMITER ;
update tbx.ext_compare_person
set gesnam_d = tbx.diakriet_cip(gesnam_d,sourcekey,'GNAAM')
, gesvor = tbx.diakriet_cip(gesvor,sourcekey,'VNAAM')
, gesnam_d_p = tbx.diakriet_cip(gesnam_d_partner,sourcekey,'GNAAM_P')
where organisatiecode = 'ABDC'
and applicatiecode = 'ABC';
commit;
This results in the same error 'ORA-00900: Invalid SQL-statement'.
You won't need the "commit;" part using the SQLExecutor as it is autocommitting.
You won't need the "commit;" part using the SQLExecutor as it is autocommitting.
Hi Niels, thank you. This worked! Is there a way to show (e.g. in the log) how many rows were updated?
You won't need the "commit;" part using the SQLExecutor as it is autocommitting.
I suspected that much. I am checking the docs, but I can't find any mention about the autocommit. It would be nice if there were a mention about it.
Hi Niels, thank you. This worked! Is there a way to show (e.g. in the log) how many rows were updated?
Good question, I can't get it to work either. Maybe @SteveAtSafe can shine a light on this? The code works but as no records are returned no feature leaves the Result port so i is lost... :-)
FME_SQL_DELIMITER /
DECLARE
i number := 0;
BEGIN
update TABLE1
set COLUMN1 = 'testvalue';
i := sql%rowcount;
END;
/
A workaround is to create a table RESULT with a column RESULT and add one empty record. Then update the value i to table RESULT column RESULT and then add another SQLExecutor to read table RESULT column RESULT.
FME_SQL_DELIMITER /
DECLARE
i number := 0;
BEGIN
update TABLE1
set COLUMN1 = 'testvalue';
i := sql%rowcount;
update RESULT set RESULT = (i);
END;
/
It works but it feels not right.