Skip to main content
Question

SQL Executor Update Statement issue

  • September 13, 2019
  • 2 replies
  • 116 views

Forum|alt.badge.img+1

Hi, I am trying to run an SQLExecutor transformer with the following SQL:

FME_SQL_DELIMITER ;
UPDATE "PROJECTS"
SET "TBL_REFRESHDATE" = '16-JAN-2020',    
    "TBL_REFRESHUSER" = @Value(REFRESHUSER);
COMMIT;

When I run this I get the following error message

|ERROR |An error occurred while accessing a table result for feature type `'; message was `Execution of statement `UPDATE "PROJECTS"

 

SET "TBL_REFRESHDATE" = '16-JAN-2020',

 

    "TBL_REFRESHUSER" = TEST' did not succeed; error was `ORA-00904: "TEST": invalid identifier'. 

Where TEST is the value which is currently in the TBL_REFRESHUSER column in the table, not the value which I am trying to populate the column with (ie: 'test_user').

However, when I run the following SQL, replacing @Value(REFRESHUSER) with a hard coded string of 'test_user', the script works:

FME_SQL_DELIMITER ;
UPDATE "PROJECTS"
SET "TBL_REFRESHDATE" = '16-JAN-2020',
    "TBL_REFRESHUSER" = 'test_user';
COMMIT;

What do I need to do to get the attribute values to be read properly inside the SQLExecutor?  The REFRESHUSER attribute is definitely a string so I don't know why it is not being read in.

I am using FME Desktop 2019.1

Thanks,

 

2 replies

david_r
Celebrity
  • September 13, 2019

You need to put single quotes around your string, FME won't do it for you. Example:

"TBL_REFRESHUSER" = '@Value(REFRESHUSER)'

Forum|alt.badge.img+1
  • Author
  • September 13, 2019
david_r wrote:

You need to put single quotes around your string, FME won't do it for you. Example:

"TBL_REFRESHUSER" = '@Value(REFRESHUSER)'

Thanks that's perfect!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings