Skip to content

tt-script generate wrong DataType for Oracle LONG #1940

Closed
@ldi0pathic

Description

Same problem as in #1927

How To Fix IT:

The tt-script generates the following model:

[Column("DATA",            DbType="LONG",          DataType=DataType.Text,    Length=0),    Nullable]
public string Data { get; set; } // LONG

when i use following settings in my tt-script:

GenerateDataTypes   = true;		
GenerateLengthProperty   = true;		
GeneratePrecisionProperty   = true;		
GenerateScaleProperty   = true;		
GenerateDbTypes   = true;		

when i change the DataType im model manuell to

DataType=DataType.Long

the insert work without problems

Environment details

linq2db version: 2.9.2
Database Server: Oracle 12.1.0
Database Provider: Oracle.ManagedDataAccess.Core 2.19.31
Operating system: Windows 10
.NET Framework: .NET Core 2.2

Activity

MaceWindu

MaceWindu commented on Oct 18, 2019

@MaceWindu
Contributor

As workaround you can add extra code to tt file to enumerate columns and update DataType property based on DbType value.

MaceWindu

MaceWindu commented on Oct 18, 2019

@MaceWindu
Contributor

Something like this should help:

foreach (var t in Tables.Values)
	foreach (var c in t.Columns.Values)
		if (c.DbType == "LONG")
			c.DataType=DataType.Long;
added this to the 2.9.3 milestone on Oct 18, 2019
ldi0pathic

ldi0pathic commented on Oct 18, 2019

@ldi0pathic
Author
foreach (var t in Tables.Values)
   foreach (var c in t.Columns.Values)
   	if (c.ColumnType== "LONG")
   		c.DataType = "DataType.Long";

works for me

self-assigned this
on Oct 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    tt-script generate wrong DataType for Oracle LONG · Issue #1940 · linq2db/linq2db