Page 1 of 1

FillSchema - varchar length

Posted: Fri 02 Dec 2011 10:01
by marty
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);
                }
            }

Posted: Fri 02 Dec 2011 13:51
by Pinturiccio
We will consider the possibility to add these features in future.

Posted: Fri 23 Dec 2011 09:11
by Pinturiccio
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

Re: FillSchema - varchar length

Posted: Thu 08 Aug 2013 10:04
by fulvion
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

Re: FillSchema - varchar length

Posted: Mon 12 Aug 2013 11:52
by Pinturiccio
We have reproduced the issue. We will investigate it and notify you about the results as soon as possible.

Re: FillSchema - varchar length

Posted: Wed 28 Aug 2013 10:05
by Pinturiccio
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.

Re: FillSchema - varchar length

Posted: Fri 06 Sep 2013 08:43
by Pinturiccio
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