FillSchema - varchar length

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
marty
Posts: 4
Joined: Mon 18 Apr 2011 13:41

FillSchema - varchar length

Post by marty » Fri 02 Dec 2011 10:01

We use code generation for stored procedures.
We use OracleDataAdaptor.FillSchema so we can work out the datatypes.
This works fine- but for varchar/string types the MaxLength of the datatable column is always -1.

The code generation doesn't know the underlying tables so it can't query All_columns directly. In most cases the stored procedures are simple selects over 1 table or simple joins, returning a one cursor.

Microsoft.Data.OracleClient does the same - it is always MaxLength = -1 -, but ODP (2.112.2.0) gives us the correct length from the underlying table.

All other metadata- datatype, precision, scale, nullability - are fine, but not maxlength. Can the length be made available?

Code: Select all

            var resultSet = new DataSet();
            using (var con = new OracleConnection(connectionString))
            {
                con.Open();
                using (var command = new OracleCommand(storedProcedure, con))
                {
                    command.CommandType = CommandType.StoredProcedure;

                    using (var adapter = new OracleDataAdapter(command))
                    {
                        adapter.FillSchema(resultSet, SchemaType.Source);
                    }
                }
            }
Accessing the metadata:

Code: Select all

foreach (DataTable table in resultSet.Tables)
            {
                foreach (DataColumn column in table.Columns)
                {
                    Console.WriteLine(column.ColumnName + " " + column.DataType.Name + " " + column.MaxLength);
                }
            }

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

Post by Pinturiccio » Fri 02 Dec 2011 13:51

We will consider the possibility to add these features in future.

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

Post by Pinturiccio » Fri 23 Dec 2011 09:11

We have fixed the bug with the '-1' value of the MaxLength property for the columns with the string or varchar type.
The new build of dotConnect for Oracle 6.60.268 is available for download now!
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=22977

fulvion
Posts: 18
Joined: Fri 06 Oct 2006 09:47

Re: FillSchema - varchar length

Post by fulvion » Thu 08 Aug 2013 10:04

Recently we tried to upgrade the ora direct library of one of our old project from version 3.20.7 to version 7.0.25 (the last version our subscription allowed to download).
However we're experiencing the above problem with maxlength always returning '-1'.

was it solved in version 6.60.268 and reintroduced in version 7.0.25?

all we do is calling the OracleDataAdapter->FillSchema method. All the infos seem correct but maxlength one.

any advice?
thanks
fulvio

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

Re: FillSchema - varchar length

Post by Pinturiccio » Mon 12 Aug 2013 11:52

We have reproduced the issue. We will investigate it and notify you about the results as soon as possible.

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

Re: FillSchema - varchar length

Post by Pinturiccio » Wed 28 Aug 2013 10:05

We have fixed the bug with the '-1' value of the MaxLength property for columns with the string or varchar type, which are created by OracleDataAdapter. We will post here when the corresponding build of dotConnect for Oracle is available for download.

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

Re: FillSchema - varchar length

Post by Pinturiccio » Fri 06 Sep 2013 08:43

The new build of dotConnect for Oracle 7.9.322 is available for download now!
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?t=27875

Post Reply