× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On Fri, Jul 8, 2016 at 12:28 PM, Kevin Adler <kadler@xxxxxxxxxx> wrote:
Simplest is

ibm_db_dbi.[p]connect("DATABASE=*LOCAL")

That would be simple enough, but it doesn't work on Litmis Spaces:

*** begin quote ***
Traceback (most recent call last):
File "/QOpenSys/QIBM/ProdData/OPS/Python3.4/lib/python3.4/site-packages/ibm_db-2.0.5.1-py3.4-os400-powerpc.egg/ibm_db_dbi.py",
line 585, in connect
ibm_db.set_option(conn, {SQL_ATTR_CURRENT_SCHEMA : user}, 1)
Exception: Supplied connection object Parameter is invalid

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/QOpenSys/QIBM/ProdData/OPS/Python3.4/lib/python3.4/site-packages/ibm_db-2.0.5.1-py3.4-os400-powerpc.egg/ibm_db_dbi.py",
line 587, in connect
raise _get_exception(inst)
ibm_db_dbi.Error: ibm_db_dbi::Error: Supplied connection object
Parameter is invalid
*** end quote ***

ibm_db_dbi.connect(dsn=None, database='*LOCAL', user=None, password=None)
# connect has a bug where you have to specify dsn=None currently

*** begin quote ***

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/QOpenSys/QIBM/ProdData/OPS/Python3.4/lib/python3.4/site-packages/ibm_db-2.0.5.1-py3.4-os400-powerpc.egg/ibm_db_dbi.py",
line 547, in connect
raise InterfaceError("connect expects a not None dsn value")
ibm_db_dbi.InterfaceError: ibm_db_dbi::InterfaceError: connect expects
a not None dsn value

*** end quote ***

ibm_db_dbi.pconnect(database='*LOCAL', user=None, password=None)

*** begin quote ***

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: pconnect() missing 1 required positional argument: 'dsn'

*** end quote ***

One of these days, I'll get around to adding a default for dsn on
connect() and setting user and password defaults to None instead of empty
strings (Pull requests welcome). Then you could do:

ibm_db_dbi.connect(database='*LOCAL')

if you wanted.

That kind of stuff is pretty simple. I could probably manage some pull
requests, once I'm able to establish access to an environment in which
I can test my own mods.

John Y.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.