johnf wrote:
> On Friday 13 February 2009 10:48:10 am Ricardo Aráoz wrote:
>
>>>>> import pymssql
>>>>> pymssql.__version__
>>>>>
>> '0.8.0'
>>
>>
>>>>> conn = pymssql.connect(user='usr', password='pass', host='Host',
>>>>>
>> database='DBase')
>>
>>
>>>>> crsr = conn.cursor()
>>>>> dbName = u'tgestion'
>>>>> dbName
>>>>>
>> u'tgestion'
>>
>>
>>>>> crsr.execute("select table_name"
>>>>>
>> ... " from INFORMATION_SCHEMA.TABLES"
>> ... " where table_catalog = %(db)s"
>> ... " and table_type = 'BASE TABLE'"
>> ... " order by table_name",
>> ... {'db':dbName} )
>>
>
> Please use the below code (from a command prompt) and tell me/ provide me
> with
> the output. BTW please confirm that your host name is 'Host'. If not use
> the IP address of where database server is (localhost, 192.168.1.230).
>
> import pymssql
>
> conn = pymssql.connect(user='usr',
> password='pass',host='Host',database='DBase')
> print conn
> crsr = conn.cursor()
> print crsr
> crsr.execute("select table_name from INFORMATION_SCHEMA.TABLES where
> table_catalog ='DBase' and table_type = 'BASE TABLE' order by table_name" )
> mytables =cur.fetchall()
> for tables in mytables:
> print tables
>
I'll run it on monday. But it will surely work all right. If you take a
look at my previous mail you'll see that :
crsr.execute("select table_name from INFORMATION_SCHEMA.TABLES where
table_catalog ='%(db)s' and table_type = 'BASE TABLE' order by table_name" %
{'db':dbName})
worked ok today and this is practically the same than what you are asking me to
do.
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
_______________________________________________
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/[email protected]