Skip to main content
Solved

How to insert large payload to Orcale Database table


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

tanveerafzal wrote:

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.

View original
Did this help you find an answer to your question?

5 replies

david_r
Evangelist
  • 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?

 


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


david_r
Evangelist
  • Best Answer
  • June 30, 2021
tanveerafzal wrote:

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.


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


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