SQL errro when importing entities from MySQL in integration studio

SQL errro when importing entities from MySQL in integration studio

  

Hello,

In Outsystem integration studio, I am creating a .Net extension and trying to import table (entities) from external MySQL database. In case of some entities its showing error and unable to publish the entity.

Below are the error which am facing :

An error occurred while publishing the Extension: System.Data.SqlClient.SqlException (0x80131904): String or binary data would be truncated.
The statement has been terminated.
  at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
  at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
  at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
  at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption)
  at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
  at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
  at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
  at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
  at OutSystems.HubEdition.Extensibility.Data.ExecutionService.BaseExecutionService.ExecuteNonQuery(IDbCommand cmd)
  at OutSystems.Internal.Db.Command.ExecuteNonQuery(String description, Boolean isApplication, Boolean skipLog, Boolean applyTransformationsToParameters)
  at OutSystems.HubEdition.ServerCommon.Database.DBCommon.CreateEntityAttr(Transaction tran, Int32 entityId, String name, String description, ObjectKey ssKey, String type, Int32 length, Int32 decimals, Boolean mandatory, Boolean autoNumber, String defaultValue, Int32 order, String originalType, String databaseName)
  at OutSystems.HubEdition.DeploymentController.Extensions.XIFPublisher.PublishExtension(ExtensionCaches extensionCaches, OutSystemsCompilerWrapper outSystemsCompilerWrapper, Int32 extensionVersionId, Int32 developerId, Boolean switchPublishedVersion, ICompilerContext context, Boolean fromSolutionPublish, String& extensionName, HEMessageArrayList& messages)
ClientConnectionId:aa8d3334-5ea1-4024-a1c8-b3ef3c1f368d
Error Number:8152,State:13,Class:16



Kindly suggest, what may be reason of error. I have checked by changing different data types in database. 


I have found the root cause of issue. Actually in MySQL database, Enum are string type like value is "startup", "sme" etc. When we limited this value to one character only like "s", "m". It works fine. Now my problem is how to import this kind of Enum in extension. Please suggest.

Thank you,


Hi Vikas,

The error message you get, "String or binary data would be truncated", means that you try to store a text (or binary) in the database that is larger than the maximum reserved space for it. It seems there is a table that you try to put one of the "enums" in them (in OutSystems, these would be "Static Entities"), but there's less space than the length of the texts.