From s_david_rose at hotmail.com Wed Mar 8 15:45:04 2006 From: s_david_rose at hotmail.com (S. D. Rose) Date: Wed, 8 Mar 2006 09:45:04 -0500 Subject: [DB-SIG] DB / Python rights determination question. Message-ID: Hello All. I'm building an application in wxPython. I'd like to load some global variables for the workers' PCs from a MySQL db already being used to hold the data. I want to persist a list of web addressees, a percentage rate, and a few other options needed. Since I'm using MySQL as a db already, I don't see the point of saving these on one station as a config file, and pushing out to all PCs, rather, they can query the GlobalConfigs table upon startup, and have a truly central configuration. I'd like to have some rights associated with the setting and modifying of these fields. My questions are: 1) How can I determine if a field requires a certain 'rights' level prior to actually trying to do the db update / insert / delete, so I can either enable / disable the SET button? 2) Provided that the logged-in user does NOT have these rights, can I have a temporary login as a manager to set/reset the field, then revert back to the logged-in user to continue with the transaction (think a manager in a grocery store going up to the register to use their 'Manager's Key' to over-ride a function that the store doesn't want just any clerk to do at any time ...) I'm so new to MySQL that this could be really easy and obvious, but I'm task-based right now, as opposed to being able to learn in the path that presents itself to me now. I really appreciate any help this NG can offer!!!! Thanks! -Dave Stamford, CT USA From farcepest at gmail.com Wed Mar 8 19:13:25 2006 From: farcepest at gmail.com (Andy Dustman) Date: Wed, 8 Mar 2006 13:13:25 -0500 Subject: [DB-SIG] DB / Python rights determination question. In-Reply-To: References: Message-ID: <9826f3800603081013g1a556c9cp8d83017e1e3141d0@mail.gmail.com> On 3/8/06, S. D. Rose wrote: > Hello All. I'm building an application in wxPython. I'd like to load some > global variables for the workers' PCs from a MySQL db already being used to > hold the data. I want to persist a list of web addressees, a percentage > rate, and a few other options needed. Since I'm using MySQL as a db > already, I don't see the point of saving these on one station as a config > file, and pushing out to all PCs, rather, they can query the GlobalConfigs > table upon startup, and have a truly central configuration. > > I'd like to have some rights associated with the setting and modifying of > these fields. My questions are: > > 1) How can I determine if a field requires a certain 'rights' level prior > to actually trying to do the db update / insert / delete, so I can either > enable / disable the SET button? > 2) Provided that the logged-in user does NOT have these rights, can I have > a temporary login as a manager to set/reset the field, then revert back to > the logged-in user to continue with the transaction (think a manager in a > grocery store going up to the register to use their 'Manager's Key' to > over-ride a function that the store doesn't want just any clerk to do at any > time ...) > > I'm so new to MySQL that this could be really easy and obvious, but I'm > task-based right now, as opposed to being able to learn in the path that > presents itself to me now. > > I really appreciate any help this NG can offer!!!! > Thanks! I suppose you could use SHOW GRANTS. http://dev.mysql.com/doc/refman/5.0/en/show-grants.html It would require doing some parsing of the output, though, and it sounds like you may be doing grants on individual columns. Stored procedures might not be a bad idea either for fine-grained access control. http://dev.mysql.com/doc/refman/5.0/en/stored-procedures.html O'Reilly has a book coming out soon on MySQL Stored Procedures which I think is pretty good (I was asked to review the Python stuff but have no financial interest in it). http://www.oreilly.com/catalog/mysqlspp/ -- The Pythonic Principle: Python works the way it does because if it didn't, it wouldn't be Python. From manaslu at inbox.com Thu Mar 9 08:01:40 2006 From: manaslu at inbox.com (manaslu manaslu) Date: Wed, 8 Mar 2006 23:01:40 -0800 Subject: [DB-SIG] MySQLdb for Python2.4 and mysql5 on windows? Message-ID: <11B656BC80A.0000127Cmanaslu@inbox.com> hi, i need to connect mysql5 from python, but do not find any MYSQLdb version for windows. Please help. Thanks, manaslu From mailinglists at onlinehome.de Thu Mar 9 12:34:43 2006 From: mailinglists at onlinehome.de (Uwe Grauer) Date: Thu, 09 Mar 2006 12:34:43 +0100 Subject: [DB-SIG] MySQLdb for Python2.4 and mysql5 on windows? In-Reply-To: <11B656BC80A.0000127Cmanaslu@inbox.com> References: <11B656BC80A.0000127Cmanaslu@inbox.com> Message-ID: <441012D3.4010009@onlinehome.de> manaslu manaslu wrote: > hi, > i need to connect mysql5 from python, but do not find any MYSQLdb version for windows. > Please help. > > Thanks, > manaslu > _______________________________________________ > DB-SIG maillist - DB-SIG at python.org > http://mail.python.org/mailman/listinfo/db-sig > You will fine it under: http://sourceforge.net/projects/mysql-python Uwe From farcepest at gmail.com Thu Mar 9 14:53:45 2006 From: farcepest at gmail.com (Andy Dustman) Date: Thu, 9 Mar 2006 08:53:45 -0500 Subject: [DB-SIG] MySQLdb for Python2.4 and mysql5 on windows? In-Reply-To: <441012D3.4010009@onlinehome.de> References: <11B656BC80A.0000127Cmanaslu@inbox.com> <441012D3.4010009@onlinehome.de> Message-ID: <9826f3800603090553v1daa6eb9m223ca15dfe6a4f36@mail.gmail.com> On 3/9/06, Uwe Grauer wrote: > manaslu manaslu wrote: > > hi, > > i need to connect mysql5 from python, but do not find any MYSQLdb version for windows. > > Please help. > > You will fine it under: > http://sourceforge.net/projects/mysql-python Yes but there is no Windows version linked against MySQL-5.0. All the Windows builds are user-contributed, and so until someone contributes one, you're out of luck. MySQL-python.exe-1.2.0.win32-py2.4.zip is for Python-2.4 and MySQL-4.1.9. If someone wants to contribute one, let me know off-list. -- The Pythonic Principle: Python works the way it does because if it didn't, it wouldn't be Python. From s_david_rose at hotmail.com Tue Mar 14 17:46:08 2006 From: s_david_rose at hotmail.com (S. D. Rose) Date: Tue, 14 Mar 2006 11:46:08 -0500 Subject: [DB-SIG] Question about multi-user access via MySQLdb Message-ID: Hello all. I have a python program which reads configs from a MySQL database. There are 2 user accounts, USER and MANAGER. There are 2 catalogs, DATA and CONFIG. I thought I was real savvy -- I created two connections to the database, a cursor = conn.cursor() and a privCursor = privConn.cursor(), where conn.cursor() is connected with USER and privConn.cursor() is connected with MANAGER, thus when a config. change is required, a login box pops up, I login with MANAGER, do the change, then close the login box. I thought that would allow me to then view-only at any time, and modify with a password. My problem is that after I modify the config fields of the CONFIG catalog with MANAGER, then scan them with USER (So I can re-populate my combo-box with updated info) I always get the old data from a .fetchall(). I've done a .commit() after my: .execute(""" DELETE FROM configuredcameras""") .commit() .executemany(""" INSERT INTO configuredcameras (IPaddress) VALUES (%s) """, (self.cameraList_combo_box.GetStrings() ) .commit() I've also done a time.sleep(1) just to make sure I wasn't querying the database too quickly, but still I get the old data. however, if I close the program and re-start, I get the data upon initializing the program. Also, using the Graphical Query tool from the MySQL site right after I do this DELETE / INSERT INTO, I see the data in the table. I just don't get it! Ahh, but if I create a 'new' connection to the database as 'USER', I can see the data right after inserting it. Can I 'Refresh' the USER connection I made to the database BEFORE I had logged into the database as MANAGER? Or, do I have to close the MANAGER connection and re-connect via USER? Any help is greatly appreciated!! Dave From s_david_rose at hotmail.com Tue Mar 14 21:09:57 2006 From: s_david_rose at hotmail.com (S. D. Rose) Date: Tue, 14 Mar 2006 15:09:57 -0500 Subject: [DB-SIG] Question about multi-user access via MySQLdb References: Message-ID: I've found the .change_user() function on the connection, that seems to work fine. -Dave "S. D. Rose" wrote in message news:dv6s4e$nba$1 at sea.gmane.org... > Hello all. > I have a python program which reads configs from a MySQL database. There > are 2 user accounts, USER and MANAGER. There are 2 catalogs, DATA and > CONFIG. > > I thought I was real savvy -- I created two connections to the database, a > cursor = conn.cursor() and a privCursor = privConn.cursor(), where > conn.cursor() is connected with USER and privConn.cursor() is connected with > MANAGER, thus when a config. change is required, a login box pops up, I > login with MANAGER, do the change, then close the login box. I thought that > would allow me to then view-only at any time, and modify with a password. > > My problem is that after I modify the config fields of the CONFIG catalog > with MANAGER, then scan them with USER (So I can re-populate my combo-box > with updated info) I always get the old data from a .fetchall(). I've done > a .commit() after my: > .execute(""" DELETE FROM configuredcameras""") > .commit() > .executemany(""" INSERT INTO configuredcameras (IPaddress) VALUES (%s) """, > (self.cameraList_combo_box.GetStrings() ) > .commit() > > I've also done a time.sleep(1) just to make sure I wasn't querying the > database too quickly, but still I get the old data. however, if I close the > program and re-start, I get the data upon initializing the program. > > Also, using the Graphical Query tool from the MySQL site right after I do > this DELETE / INSERT INTO, I see the data in the table. > > I just don't get it! > > Ahh, but if I create a 'new' connection to the database as 'USER', I can see > the data right after inserting it. > Can I 'Refresh' the USER connection I made to the database BEFORE I had > logged into the database as MANAGER? Or, do I have to close the MANAGER > connection and re-connect via USER? > > Any help is greatly appreciated!! > Dave > > > > _______________________________________________ > DB-SIG maillist - DB-SIG at python.org > http://mail.python.org/mailman/listinfo/db-sig > From mkleehammer at gmail.com Sun Mar 19 00:53:53 2006 From: mkleehammer at gmail.com (Michael Kleehammer) Date: Sat, 18 Mar 2006 17:53:53 -0600 Subject: [DB-SIG] pyodbc 2.x released Message-ID: pyodbc 2.0.x has just been released on http://pyodbc.sourceforge.net. This is a new DB API module for ODBC designed for Python 2.3+ and ODBC 3+. Some notable items: * It is free for commercial use (MIT license). * It implements the DB API 2 interface. * It uses only Python native data types like datetime (therefore 2.3+ is required). * It has some useful convenience features like access to rows by name (e.g. row.user_id). The documentation page has not been uploaded yet, but there is an overview on the main page. Plus, since it implements the DB API, you have a general idea of how it works already. You can also examine the doc strings after installing. import pyodbc help(pyodbc) It does not yet expose much ODBC-specific functionality, but we are open to suggestions. The pyodbc team. From jekabs.andrusaitis at tietoenator.com Mon Mar 20 13:16:22 2006 From: jekabs.andrusaitis at tietoenator.com (Jekabs Andrushaitis) Date: Mon, 20 Mar 2006 14:16:22 +0200 Subject: [DB-SIG] Question about multi-user access via MySQLdb In-Reply-To: References: Message-ID: <441E9D16.8080100@tietoenator.com> Hello, did you do the commit on the other connection (USER one) as well? According to my understanding on typical transaction separation you should do commits on BOTH connections after modifying data in one of them if you want to see the new data in other. Basically with transactional databases you will see the data as it was first time you select it from calling session (or the way you modified it from calling session), while other sessions are completely isolated and their data wont get to you even if they perform a commit. Jekabs S. D. Rose wrote: > I've found the .change_user() function on the connection, that seems to work > fine. > > -Dave > "S. D. Rose" wrote in message > news:dv6s4e$nba$1 at sea.gmane.org... > >> Hello all. >> I have a python program which reads configs from a MySQL database. >> > There > >> are 2 user accounts, USER and MANAGER. There are 2 catalogs, DATA and >> CONFIG. >> >> I thought I was real savvy -- I created two connections to the database, >> > a > >> cursor = conn.cursor() and a privCursor = privConn.cursor(), where >> conn.cursor() is connected with USER and privConn.cursor() is connected >> > with > >> MANAGER, thus when a config. change is required, a login box pops up, I >> login with MANAGER, do the change, then close the login box. I thought >> > that > >> would allow me to then view-only at any time, and modify with a password. >> >> My problem is that after I modify the config fields of the CONFIG >> > catalog > >> with MANAGER, then scan them with USER (So I can re-populate my combo-box >> with updated info) I always get the old data from a .fetchall(). I've >> > done > >> a .commit() after my: >> .execute(""" DELETE FROM configuredcameras""") >> .commit() >> .executemany(""" INSERT INTO configuredcameras (IPaddress) VALUES (%s) >> > """, > >> (self.cameraList_combo_box.GetStrings() ) >> .commit() >> >> I've also done a time.sleep(1) just to make sure I wasn't querying the >> database too quickly, but still I get the old data. however, if I close >> > the > >> program and re-start, I get the data upon initializing the program. >> >> Also, using the Graphical Query tool from the MySQL site right after I do >> this DELETE / INSERT INTO, I see the data in the table. >> >> I just don't get it! >> >> Ahh, but if I create a 'new' connection to the database as 'USER', I can >> > see > >> the data right after inserting it. >> Can I 'Refresh' the USER connection I made to the database BEFORE I had >> logged into the database as MANAGER? Or, do I have to close the MANAGER >> connection and re-connect via USER? >> >> Any help is greatly appreciated!! >> Dave >> >> >> >> _______________________________________________ >> DB-SIG maillist - DB-SIG at python.org >> http://mail.python.org/mailman/listinfo/db-sig >> >> > > > > _______________________________________________ > DB-SIG maillist - DB-SIG at python.org > http://mail.python.org/mailman/listinfo/db-sig > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/db-sig/attachments/20060320/1a5466d7/attachment.html From MReddy at Bear.com Tue Mar 21 16:07:35 2006 From: MReddy at Bear.com (Reddy, Murali (Exchange)) Date: Tue, 21 Mar 2006 10:07:35 -0500 Subject: [DB-SIG] need help in putting TAB INDENT in SQL generated File Message-ID: Hello, I am trying to generate a TAB Indent text file by running SQL query in python script. Should I put TABS between SQL statement ? If some body knows can you send me sample scripts Regards Murali -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/db-sig/attachments/20060321/47c1963d/attachment.html -------------- next part -------------- *********************************************************************** Bear Stearns is not responsible for any recommendation, solicitation, offer or agreement or any information about any transaction, customer account or account activity contained in this communication. *********************************************************************** From sanxiyn at gmail.com Thu Mar 23 11:20:03 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Thu, 23 Mar 2006 19:20:03 +0900 Subject: [DB-SIG] Python DB-API wrapper for ADO.NET for IronPython In-Reply-To: <5b0248170603230032n7747cf9fp@mail.gmail.com> References: <5b0248170603230032n7747cf9fp@mail.gmail.com> Message-ID: <5b0248170603230220s41fb05act@mail.gmail.com> 2006/3/23, Sanghyeon Seo : > I took a stub at writing Python DB-API (PEP 249) wrapper for ADO.NET > to be used with IronPython. Currently I am testing this with MySQL > Connector/Net and is trying to be compatible with MySQLdb module. I now added connect() wrapper compatible with psycopg module, using Npgsql .NET data provider: http://sparcs.kaist.ac.kr/~tinuviel/fepy/lib/dbapi.py For Npgsql, visit: http://freshmeat.net/projects/npgsql/ I also made an example you can run with both Python and IronPython: http://sparcs.kaist.ac.kr/~tinuviel/fepy/example/database_access.py Enjoy! Seo Sanghyeon From sanxiyn at gmail.com Thu Mar 23 09:32:03 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Thu, 23 Mar 2006 17:32:03 +0900 Subject: [DB-SIG] Python DB-API wrapper for ADO.NET for IronPython Message-ID: <5b0248170603230032n7747cf9fp@mail.gmail.com> Hello, I took a stub at writing Python DB-API (PEP 249) wrapper for ADO.NET to be used with IronPython. Currently I am testing this with MySQL Connector/Net and is trying to be compatible with MySQLdb module. You can download MySQL Connector/Net from: http://www.mysql.com/products/connector/net/ Unzip the download and copy MySql.Data.dll to the same directory as your script. Other files are not needed. Wrapper itself is here: http://sparcs.kaist.ac.kr/~tinuviel/fepy/lib/dbapi.py Currently implemented are connect() module level function, cursor() and close() on connection class, and execute() and fetchall() on cursor class. That's all. I would appreciate your comments. Thanks! Seo Sanghyeon From sanxiyn at gmail.com Fri Mar 24 07:01:36 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Fri, 24 Mar 2006 15:01:36 +0900 Subject: [DB-SIG] Python DB-API wrapper for ADO.NET for IronPython In-Reply-To: <5b0248170603230032n7747cf9fp@mail.gmail.com> References: <5b0248170603230032n7747cf9fp@mail.gmail.com> Message-ID: <5b0248170603232201l1d62c247t@mail.gmail.com> 2006/3/23, Sanghyeon Seo : > I took a stub at writing Python DB-API (PEP 249) wrapper for ADO.NET > to be used with IronPython. Currently I am testing this with MySQL > Connector/Net and is trying to be compatible with MySQLdb module. I now added connect() wrapper for pysqlite 1 using Mono ADO.NET provider for SQLite: http://www.mono-project.com/SQLite Module and examle updated: http://sparcs.kaist.ac.kr/~tinuviel/fepy/lib/dbapi.py http://sparcs.kaist.ac.kr/~tinuviel/fepy/example/database_access.py Seo Sanghyeon From carsten at uniqsys.com Sun Mar 26 09:04:26 2006 From: carsten at uniqsys.com (Carsten Haese) Date: Sun, 26 Mar 2006 02:04:26 -0500 Subject: [DB-SIG] [ANN] InformixDB-2.2 released Message-ID: <20060326065819.M62918@uniqsys.com> I am pleased to announce a new release of InformixDB, the DB-API 2.0 module for connecting to IBM Informix database engines. Changes since version 2.1: - Support for BOOLEAN columns - DECIMAL and MONEY columns can be fetched as decimal.Decimal instances if the decimal module is available - autocommit mode for connections - Bug fixes: * Output buffer allocation used pointer/int casts that don't work on most 64 bit platforms. * Selecting TEXT/BYTE column from an empty set of rows caused segmentation fault under certain circumstances. * datetime values with trailing double-zeroes were fetched incorrectly. Downloads and info at http://informixdb.sourceforge.net. Best regards, Carsten Haese From boglio07 at bogliolobartolomeo.191.it Mon Mar 27 23:44:15 2006 From: boglio07 at bogliolobartolomeo.191.it (meo bogliolo) Date: Mon, 27 Mar 2006 23:44:15 +0200 Subject: [DB-SIG] PEP-249 Italian translation Message-ID: I'm translating the PEP-249 for the Italian Python site (http://www.python.it) and I noticed a couple of points I'd like to understand. The interface specification list of section contains "DBI Helper Objects" (line 25), while I think they were requested only on the version 1.0. Maybe the reference can be omitted. I think that Line 690: exposed on the Connection objects are attributes (in addition should be: exposed on the Connection objects as attributes (in addition Looking forward from hearing from You meo -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.385 / Virus Database: 268.3.2/294 - Release Date: 27/03/2006 From mal at egenix.com Tue Mar 28 17:46:52 2006 From: mal at egenix.com (M.-A. Lemburg) Date: Tue, 28 Mar 2006 17:46:52 +0200 Subject: [DB-SIG] PEP-249 Italian translation In-Reply-To: References: Message-ID: <44295A6C.5000801@egenix.com> meo bogliolo wrote: > I'm translating the PEP-249 for the Italian Python site > (http://www.python.it) > and I noticed a couple of points I'd like to understand. > > The interface specification list of section contains "DBI Helper Objects" > (line 25), > while I think they were requested only on the version 1.0. > Maybe the reference can be omitted. > > I think that Line 690: > exposed on the Connection objects are attributes (in addition > should be: > exposed on the Connection objects as attributes (in addition > > Looking forward from hearing from You Thanks. I've corrected those in SVN. Not sure how long it will take for the site to get updated - I believe this is an automatic process now. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Mar 28 2006) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From ccurvey at gmail.com Fri Mar 31 18:08:28 2006 From: ccurvey at gmail.com (Chris Curvey) Date: Fri, 31 Mar 2006 11:08:28 -0500 Subject: [DB-SIG] pyodbc and decimal datatypes Message-ID: <25ef693e0603310808m118de6f0g736e8bf5c5f4de5a@mail.gmail.com> I hope I have the right list for this question... According to the homepage for pyodbc, pyodbc supports decimal data types, but when I try to copy a row from one table to another, I'm getting: pyodbc.NotSupportedError: ('Python type Decimal not supported. param=26', 'HY097') the code looks like: srcCursor.execute("select * from foo") for row in srcCursor: targetCursor.execute("insert into bar ( ?, ?, ?, ....", row) (Where bar is an empty copy of foo). Using pyodbc 2.0.16 with python 2.4.1 on Windows XP -- Nervous passengers are advised to wear a blindfold. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/db-sig/attachments/20060331/4a14f60c/attachment.html