Re: [dabo-users] AppWizard Request

Author: Paul McNett

Posted: 2011-12-08 at 18:24:44

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

_______________________________________________

Post Messages to: Dabo-users@leafe.com

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/4EE1473C.7080209@ulmcnett.com

©2011 Paul McNett