[egenix-users] mxODBC - How do I "set schema"?

Bob Gibson bgibson at us.ibm.com
Mon Jan 31 22:32:12 CET 2005





Hi:

  I'm working with mxODBC, and have successfully connected to my database.
This is the good news.  :-)

  When I try to "set schema" though, I get a -1 return value.  What,
exactly, does this mean?  What am I doing wrong?

----------------------------------------------------------------------
C:\Programs\Python\Python2Derby>python
ActivePython 2.4 Build 243 (ActiveState Corp.) based on
Python 2.4 (#60, Nov 30 2004, 09:34:21) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import mx.ODBC as ODBC
>>> DB = ODBC.Windows
>>> db = DB.DriverConnect( 'DSN=Derby;UID=IMA;PWD=Lumberjack;DBALIAS=sq4mm'
)
>>> cursor = db.cursor()
>>> cursor.execute( "select count(*) from sys.systables" )
>>> for field in cursor.description :
...   print field
...
('1', 4, None, None, 10, 0, 0)
>>> data = cursor.fetchall()
>>> for row in data :
...   print row
...
(58,)
>>> cursor.execute( "set schema school" )
-1
>>>
----------------------------------------------------------------------

  By the way, I know that the schema name is correct.  I created the
database, the tables, and all the schema names.

  Here's a sample DB2CLP session that shows the same command executing
successfully.

----------------------------------------------------------------------
db2 => connect to sq4mm user Ima using Lumberjack

   Database Connection Information

 Database server        = Apache Derby CSS10000
 SQL authorization ID   = IMA
 Local database alias   = SQ4MM

db2 => select count(*) from sys.systables

1
-----------
         58

  1 record(s) selected.

db2 => set schema school
DB20000I  The SQL command completed successfully.
db2 =>
----------------------------------------------------------------------


Thanks in advance
Bob

Ps 37:16  It is better to be godly and have little than to be evil and
possess much.-------------- next part --------------
An HTML attachment was scrubbed...
URL: /mailman-archives/egenix-users/attachments/20050131/ad27ead9/attachment-0139.htm


More information about the egenix-users mailing list