Skip to main content
Question

FME_SQL_DELIMITER won't work:

  • September 25, 2018
  • 7 replies
  • 69 views

Forum|alt.badge.img

The next query results in an error (ORA-00900: Invalid SQL-statement.)

FME_SQL_DELIMITER /

begin

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';
end;
/
commit;
/
What am I doing wrong?Thanks in advance.
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

7 replies

oscard
Influencer
Forum|alt.badge.img+22
  • Influencer
  • 344 replies
  • September 25, 2018

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


Forum|alt.badge.img
  • Author
  • 10 replies
  • September 25, 2018

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'.

oscard
Influencer
Forum|alt.badge.img+22
  • Influencer
  • 344 replies
  • September 25, 2018

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

 

 


nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2940 replies
  • September 25, 2018

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.

 


Forum|alt.badge.img
  • Author
  • 10 replies
  • September 25, 2018
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?

 

 


oscard
Influencer
Forum|alt.badge.img+22
  • Influencer
  • 344 replies
  • September 25, 2018
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.

 

 


nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2940 replies
  • September 25, 2018
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.