Error in publish of extension

Error in publish of extension

  

I am trying to connect MySQL database in my application. For this I have added one MySQL database in integration studio. But when am trying to publish the extension its giving me below error :


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:1940581c-94e8-4feb-b216-137def882f2a
Error Number:8152,State:13,Class:16


Please help to understand and fix the error. 

Thank you.

Hi Vikas,

My first guess is you changed the definition of an attribute to a smaller length to what it was, as the top error message in you stack trace is:

String or binary data would be truncated.
The statement has been terminated.

Regards,

Daniel

Daniël Kuhlmann wrote:

Hi Vikas,

My first guess is you changed the definition of an attribute to a smaller length to what it was, as the top error message in you stack trace is:

String or binary data would be truncated.
The statement has been terminated.

Regards,

Daniel

Hi Daniel,

I didn't change anything in the database. Am just importing this MySQL database, there were two fields with datatype 'year', changed them to "text" with length 50. Except this there is not any change in database. What could be reason for it. Please suggest.


Hi, you contradict yourself by writing you didn't change anything, and writing you changed two fields with datetype year to text(50). I don't have experience with MySQL. But I bet your change has to do with the error.

I assume the year datatype in MysSQL is some kind of numeric data type, my first bet would be to change it to integer not text(50).

Daniël Kuhlmann wrote:

Hi, you contradict yourself by writing you didn't change anything, and writing you changed two fields with datetype year to text(50). I don't have experience with MySQL. But I bet your change has to do with the error.

I assume the year datatype in MysSQL is some kind of numeric data type, my first bet would be to change it to integer not text(50).

Hi,

I tried to change it with integer, still error is same. Change in year datatype required, because without it Outsystem not allowing me to import tables.


Maybe a stupid question, but you need that column in your outsystems app, if you exclude it do you still have the problem.

There is a document in outsystems with mapping of database types to outsystems types

https://success.outsystems.com/Documentation/10/Reference/OutSystems_Language/Extensibility_and_Integration/Mapping_External_DB_Data_Types_to_OutSystems_Data_Types

At the bottom you see that OutSystems is not able to map the year data type. Sorry about that.

Maybe you can use a different data type in your MySQL table, one that is compatible with OutSystems?

Think this is as far as I can help, maybe someone else on the forum knows more about this.

Regards

Daniel

Daniël Kuhlmann wrote:

Maybe a stupid question, but you need that column in your outsystems app, if you exclude it do you still have the problem.

There is a document in outsystems with mapping of database types to outsystems types

https://success.outsystems.com/Documentation/10/Reference/OutSystems_Language/Extensibility_and_Integration/Mapping_External_DB_Data_Types_to_OutSystems_Data_Types

At the bottom you see that OutSystems is not able to map the year data type. Sorry about that.

Maybe you can use a different data type in your MySQL table, one that is compatible with OutSystems?

Think this is as far as I can help, maybe someone else on the forum knows more about this.

Regards

Daniel

Hi,

I think this is not the error reason. I have deleted year column from both places still error is same.


Hi am sorry to read you still have an issue, i am out of suggestions. Maybe someone else can help you.

Or if you can open a support ticket on outsystems.com/support.


Daniël Kuhlmann wrote:

Hi am sorry to read you still have an issue, i am out of suggestions. Maybe someone else can help you.

Or if you can open a support ticket on outsystems.com/support.


Hi Daniel,

Thanks for time. This issue at time of publish only , don't know why. Let me explore it more. 


Hi Vikas,


Earlier i also got the same issue, You just need to change the data type. Suppose in your existing Database data type is different which is not supported by outsystems so change the datatype i.e. String to text, Number to integer like that. Hope this will help you.


-Hitesh