[ http://tracker.firebirdsql.org/browse/DNET-861?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jiri Cincura reopened DNET-861: ------------------------------- Upload here. No need to create another ticket. > FbConnection.GetSchema getting column information does not bring the > column_size on varchar columns > --------------------------------------------------------------------------------------------------- > > Key: DNET-861 > URL: http://tracker.firebirdsql.org/browse/DNET-861 > Project: .NET Data provider > Issue Type: Bug > Components: ADO.NET Provider > Affects Versions: 6.3.0.0, 6.4.0.0 > Environment: Visual Studio 2017 > ASP.NET Core > NET Standard libraries > Firebird 2.5 > Reporter: Fabricio Araujo > Assignee: Jiri Cincura > Attachments: FbConn_BugViews.zip > > > I have my own way to generate SQL to use with Dapper (Dapper.Contrib does not > fit well > in what I'm doing) and I need to get column information to do so. > When I'm working with database tables directly, all works wonders when I use > this call: > DataTable dtb = conn.GetSchema("COLUMNS", new string[] { null, null, > ParamTableName }); > When I use a view, things gets weird. Views (is not a trivial view, it has a > few joins) with varchar columns comes with COLUMN_TYPE correct but > COLUMN_SIZE comes NULL. > I traced the executed SQL of GetSchema but while it does not bring the type > of the column (only the reference to the domain) it DOES BRING > the COLUMN_SIZE correctly > The other columns comes correctly (all those are INTEGER columns though). > Create the following view on the provided employee.fdb: > CREATE OR ALTER VIEW PHONE_LIST_EXAMPLE( > EMP_NO, > FIRST_NAME, > LAST_NAME, > PHONE_EXT, > HIRE_DATE, > DEPT_NO, > JOB_CODE, > JOB_GRADE, > JOB_COUNTRY, > SALARY, > FULL_NAME, > PHONE_NO) > AS > WITH CtePhoneList as ( > SELECT > E.Emp_No, > E.First_Name, > E.Last_Name, > E.Phone_Ext, > E.Hire_Date, > E.Dept_No, > E.Job_Code, > E.Job_Grade, > E.Job_Country, > E.Salary, > E.Full_Name , > d.Phone_No > FROM > Employee E > inner join Department d > on e.Dept_No = d.Dept_No > ) > Select > Emp_No, > First_Name, > Last_Name, > Phone_Ext, > Hire_Date, > Dept_No, > Job_Code, > Job_Grade, > Job_Country, > Salary, > Full_Name , > Phone_No > from > CtePhoneList; > And build the provided winforms application to get the column info from that > view. If you try on the original phone list view, all column will come ok. > If you run the application on THAT view you'll see that varchar columns will > come without column size. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://tracker.firebirdsql.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira _______________________________________________ Firebird-net-provider mailing list Firebird-net-provider@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/firebird-net-provider