Citms.EntityFrameworkCore.Oracle icon indicating copy to clipboard operation
Citms.EntityFrameworkCore.Oracle copied to clipboard

clob

Open Lamby123 opened this issue 7 years ago • 2 comments

It seems as though CLOB data types in oracle cannot be mapped into C#. Could you please confirm?

Lamby123 avatar Mar 18 '19 13:03 Lamby123

(First of all, thank you, @CrazyJson, soo much for this project ) What I did was this:

class EmailQueueMapping : IEntityTypeConfiguration<EmailQueue>
    {
        public void Configure(EntityTypeBuilder<EmailQueue> builder)
        {
            builder.Property(x => x.Content).HasColumnType("CLOB");
        }
    }

And it does create the column with type CLOB and saves records. What I have found however is that I still get a conversion issue when trying to save strings of length 40000. This is the error I get:

ORA-01460: unimplemented or unreasonable conversion requested

It seems like the code is still treating the string as an NVARCHAR or something

Garwin4j avatar Mar 22 '19 15:03 Garwin4j

in C# . byet[] map to oracle Blob
when you saving larger data it' throw this ORA-01460 someone post : https://github.com/aspnet/EntityFrameworkCore/issues/14190#event-2096047684

but it doesn't work for me.

and i try to add ((OracleParameter)parameter).OracleDbType = OracleDbType.Blob; Microsoft.EntityFrameworkCore.Oracle.Storage.Internal.OracleByteArrayTypeMapping

        protected override void ConfigureParameter(DbParameter parameter)
        {
            var value = parameter.Value;
            var length = (value as byte[])?.Length;
            parameter.Size
                = value == null
                  || value == DBNull.Value
                  || length != null
                  && length <= _maxSpecificSize
                    ? _maxSpecificSize
                    : parameter.Size;
           ((OracleParameter)parameter).OracleDbType = OracleDbType.Blob;
        }


it works correctly

iamshen avatar May 16 '19 07:05 iamshen