× 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.



OK as you can tell I’m on Python learning roll this week.

In all the documented examples I have seen so far, I saw the following format for the connect method with no parms passed:

#----------------------------------------------------------------------
#Small program run in PASE with no DB parms passed to connect method. Failure.
#----------------------------------------------------------------------
import ibm_db_dbi as dbi
conn = dbi.connect()

When I do this I get an error that says:

ibm_db_dbi.Error: ibm_db_dbi::Error: Supplied connection object Parameter is invalid


If I add the database connection info it works:

#----------------------------------------------------------------------
#Small program run in PASE with database name with or without credentials passed. Works.
#----------------------------------------------------------------------
import ibm_db_dbi as dbi
database = "DATABASE=*LOCAL"
conn = dbi.connect(database)

So it works with passing the database. Good !!

Q: Should the connect() work without passing any info for a database connection when running natively in PASE or do I always need to pass DB info and optionally credentials ?

I’m wondering if all the slide deck samples I saw were created and run on a PC or has something changed for Python 3 and DB2. Or has the database info getting passed always been needed, but examples being provided by others are bad ?

Using - ibm_db_dbi version 2.0.5.4

FWIW - I found the answer for passing the database info online here at midrange after digging.

Just trying for some clarity as I document my samples for other. To connect() with database info or not ? 😊

Thanks

Regards,

[http://static.helpsystems.com/hs/email/templates/signatures-final/images/hs-logo2.png]

Richard Schoen
Director of Document Management

e. richard.schoen@xxxxxxxxxxxxxxx<mailto:richard.schoen@xxxxxxxxxxxxxxx>
p. 952.486.6802
w. helpsystems.com<http://www.helpsystems.com/>
[cid:image002.jpg@01D1A545.4C2BF250]<http://www.linkedin.com/in/richardschoen>[cid:image003.jpg@01D1A545.4C2BF250]<http://www.twitter.com/richardschoen>





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.