Skip to main content
Solved

How to insert large payload to Orcale Database table

  • June 30, 2021
  • 5 replies
  • 288 views

Hi Folks,

we are trying to save json request/response data into oracle database using SQLExecutor and getting following error

java.sql.SQLSyntaxErrorException: ORA-01704: string literal too long

 

Request that we are trying to save is more than 6000 characters. Appreciate your suggestions ?

Best answer by david_r

Oracle Database column type is CLOB. for Writer i am using insert statement using SQLExecutor. oracle database is 19C.

When using an SQLExecutor, the CLOB is actually transmitted as a string literal, which is why you're running into this Oracle limitation. Remember that the SQLExecutor simply transmits the entire SQL statement as a string to Oracle, there is very little or no parsing being done by FME.

If possible, I would look into using either a FeatureWriter or a DatabaseUpdater to insert the actual CLOB value, those should be much more intelligent in how they handle LOB datatypes.

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.

5 replies

david_r
Celebrity
  • 8392 replies
  • June 30, 2021

What is the Oracle datatype of the field you're writing to? How is the writer data type for the same field configured?

 


  • Author
  • 3 replies
  • June 30, 2021

Oracle Database column type is CLOB. for Writer i am using insert statement using SQLExecutor. oracle database is 19C.


david_r
Celebrity
  • 8392 replies
  • Best Answer
  • June 30, 2021

Oracle Database column type is CLOB. for Writer i am using insert statement using SQLExecutor. oracle database is 19C.

When using an SQLExecutor, the CLOB is actually transmitted as a string literal, which is why you're running into this Oracle limitation. Remember that the SQLExecutor simply transmits the entire SQL statement as a string to Oracle, there is very little or no parsing being done by FME.

If possible, I would look into using either a FeatureWriter or a DatabaseUpdater to insert the actual CLOB value, those should be much more intelligent in how they handle LOB datatypes.


  • Author
  • 3 replies
  • June 30, 2021

Thanks David, DatabaseUpdater as able to save the CLOB data. Appreciate your help.

 


I had a similar problem some years ago. Solved using cx_Oracle (Python).