On Thursday, December 08, 2011 03:24:44 PM Paul McNett wrote:
> On 12/8/11 2:18 PM, Rand Batchelder wrote:
> > I am using the appwizard with MS SQL.
> >
> > I would like to build an app from a View, but the appwizard only lists
> > available tables. Is this doable ?
>
> Sure, we just need to fix up dabo/db/dbMsSQL.py, function getTables() to use
> SQL to include the views. The current code is:
>
> 92 dbName = self.database
> 93
> 94 sql = """
> 95 select table_name
> 96 from INFORMATION_SCHEMA.TABLES
> 97 where table_catalog = '%(db)s'
> 98 and table_type = 'BASE TABLE'
> 99 order by table_name """
> 100
> 101 cursor.execute(sql % {'db':dbName})
> 102
> 103 rs = cursor.getDataSet()
> 104 tables = [x["table_name"] for x in rs]
> 105 tables = tuple(tables)
> 106
> 107 return tables
>
> I don't know enough about MSSQL to do it, but we probably need a UNION
> between INFORMATION_SCHEMA.VIEWS and INFORMATION_SCHEMA.TABLES or perhaps
> it is just changing the where clause to include table_type like '%VIEW%'.
>
> > Also, can I copy and paste from the query results Grid on the Browse tab
> > ?
> No, but that would be a cool enhancement.
>
> Paul
The dbPostgres.py already returns views and I did just make two queries.
Johnf
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/1675261.4mPdouPslr@linux-12