Are Oracle Database 12c Release 2 long identifiers supported?

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
jesuslpm
Posts: 5
Joined: Wed 13 Dec 2017 11:13

Are Oracle Database 12c Release 2 long identifiers supported?

Post by jesuslpm » Thu 25 Jan 2018 14:11

The following code shows you that when the table name is more than 30 characters long, GetShemaTable fails:

Code: Select all

using Devart.Data.Oracle;
using System.Data;

namespace DevartBug
{
    class Program
    {
        static void Main(string[] args)
        {
            using (var cn = OpenConnection())
            using (var createTableCmd = new OracleCommand("CREATE TABLE this_table_is_more_than_30_characters_long(id NUMBER(9) NOT NULL)", cn))
            using (var selectCmd = new OracleCommand("SELECT * FROM this_table_is_more_than_30_characters_long", cn))
            {
                TryDropTable(cn);
                createTableCmd.ExecuteNonQuery();
                using (var reader = selectCmd.ExecuteReader(CommandBehavior.SchemaOnly | CommandBehavior.KeyInfo))
                {
                    // this line fails with Devart.Data.Oracle.OracleException
                    // 'ORA-06502: PL/SQL: numeric or value error: character string buffer too small ORA - 06512: at line 3'
                    var schema = reader.GetSchemaTable();
                }
            }
        }

        static OracleConnection OpenConnection()
        {
            var cn = new OracleConnection("Direct=true;Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=my_host)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=my_service_name)));User ID=my_user_id;Password=my_password");
            cn.Open();
            return cn;
        }

        static void TryDropTable(OracleConnection cn)
        {
            try
            {
                using (var cmd = new OracleCommand("DROP TABLE this_table_is_more_than_30_characters_long", cn))
                {
                    cmd.ExecuteNonQuery();
                }
            }
            catch { }
        }
    }
}

Pinturiccio
Devart Team
Posts: 2192
Joined: Wed 02 Nov 2011 09:44

Re: Are Oracle Database 12c Release 2 long identifiers supported?

Post by Pinturiccio » Thu 01 Feb 2018 12:31

We have reproduced the issue. We will investigate it and post here about the results as soon as possible.

Pinturiccio
Devart Team
Posts: 2192
Joined: Wed 02 Nov 2011 09:44

Re: Are Oracle Database 12c Release 2 long identifiers supported?

Post by Pinturiccio » Wed 14 Feb 2018 14:57

We have fixed the bug with the error in the OracleDataReader.GetSchemaTable method when table name in Oracle 12c Release 2 is longer than 30 characters. We will post here when the corresponding build of dotConnect for Oracle is available for download.

Pinturiccio
Devart Team
Posts: 2192
Joined: Wed 02 Nov 2011 09:44

Re: Are Oracle Database 12c Release 2 long identifiers supported?

Post by Pinturiccio » Thu 15 Feb 2018 15:35

New build of dotConnect for Oracle 9.5.454 is available for download.
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Customer Portal (for users with valid subscription only). We have also updated our NuGet package: https://www.nuget.org/packages/Devart.Data.Oracle/
For more information, please refer to viewtopic.php?t=36602.

Post Reply