Skip to main content

I'd like to delete an element from my table in my Oracle database.

 

I already saw the post

https://knowledge.safe.com/questions/5205/delete-f...

But it doesn't work.

This is my sql query :

FME_SQL_DELIMITER ;

 

DELETE FROM G_ADT_AGRI.EXPLOITATION WHERE SIRET = 37969607300012

I tried without the FME_SQL_DELIMITER, with the semicolon, with the number between quotes, but it doesn't work anyway.

Please, give me some more ideas.

Thanks

Some obvious questions:

  • Are there actually features with SIRET = 37969607300012?
  • Do you have the proper rights on the database?
  • What happens if you do this directly in Oracle?

If you only have one statement in the SQLExecutor, you should not include the FME_SQL_DELIMITER and make sure to not have a semicolon at the end of your statement.

So your SQL should look like this:

DELETE FROM G_ADT_AGRI.EXPLOITATION WHERE SIRET = 37969607300012

However, make sure to check the data type of the SIRET field. If it's a string you should surround the value with single quotation marks:

DELETE FROM G_ADT_AGRI.EXPLOITATION WHERE SIRET = '37969607300012'

Also, as @redgeographics mentions, copy the statement into SQLDeveloper/Toad or similar and see what happens.


Some obvious questions:

  • Are there actually features with SIRET = 37969607300012?
  • Do you have the proper rights on the database?
  • What happens if you do this directly in Oracle?

It exists. I have the rights. In Oracke, it doesn't work either.

But if I I try this query :

FME_SQL_DELIMITER ;

 

DELETE FROM G_ADT_AGRI.EXPLOITATION WHERE OBJECTID = 650;

It works. Objectid is a number and Siret is a varchar.

 

If I try to put quotes between the siret number, it doesn't work. The soft run without find a solution.

If you only have one statement in the SQLExecutor, you should not include the FME_SQL_DELIMITER and make sure to not have a semicolon at the end of your statement.

So your SQL should look like this:

DELETE FROM G_ADT_AGRI.EXPLOITATION WHERE SIRET = 37969607300012

However, make sure to check the data type of the SIRET field. If it's a string you should surround the value with single quotation marks:

DELETE FROM G_ADT_AGRI.EXPLOITATION WHERE SIRET = '37969607300012'

Also, as @redgeographics mentions, copy the statement into SQLDeveloper/Toad or similar and see what happens.

As I said, if I do that, the process run without finding a solution or even an end to it script.


For an unknown reason, the table I was selected was locked. So I have to disconnect and connect to the database to unlocked the table.

 

I'll post further information when I have it.

Reply