Skip to main content
Question

Sql Oracle remove element lag


Forum|alt.badge.img

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

5 replies

redgeographics
Celebrity
Forum|alt.badge.img+50

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?

david_r
Celebrity
  • July 21, 2016

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.


Forum|alt.badge.img
  • Author
  • July 21, 2016
redgeographics wrote:

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.

Forum|alt.badge.img
  • Author
  • July 21, 2016
david_r wrote:

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.


Forum|alt.badge.img
  • Author
  • July 21, 2016

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


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