According to
http://docs.sqlalchemy.org/en/rel_1_0/core/connections.html#registering-new-dialects,
a dialect registered as "db2.pyodbc" should be specified in the URL as
"db2+pyodbc://". Does that make any difference?

On Fri, Feb 19, 2016 at 4:20 PM, Alex Hall <ah...@autodist.com> wrote:

> Thanks. I tried both, and triedother variations including or excluding
> the module name as a prefix (ibm_db_sa.db2.pyodbc://). In most cases,
> I get:
> sqlalchemy.exc.ArgumentError: could not parse RFC1738 URL from string
> [my connection string]".
>
> If I don't get that, it's because I used a name that complains about
> there being no attribute dbms_ver or server.version, depending on the
> string.
>
> They don't make it easy, do they?
>
> On 2/19/16, Simon King <si...@simonking.org.uk> wrote:
> > URI prefixes are defined in the setup.py for the ibm_db_sa package:
> >
> > https://github.com/ibmdb/python-ibmdbsa/blob/master/ibm_db_sa/setup.py
> >
> > I would guess that you want to end up with the DB2Dialect_pyodbc class,
> > which means you should use db2.pyodbc:// or ibm_db_sa.pyodbc://
> >
> > Simon
> >
> >
> > On Fri, Feb 19, 2016 at 3:33 PM, Alex Hall <ah...@autodist.com> wrote:
> >
> >> Thanks, that looks like what I'm looking for. I assume specifying
> >> "ibm_db_sa://" for the string will let SA use the proper dialect?
> >>
> >> I'm now getting "pyodbc.Connection object has no attribute
> >> server_info", in case anyone happens to know what that's about. I'm
> >> getting nightmarish flashbacks to my "has no attribute" error last
> >> week for the same object. But at least this is a different one; I'll
> >> count it as a good thing!
> >>
> >> On 2/19/16, Simon King <si...@simonking.org.uk> wrote:
> >> > On Fri, Feb 19, 2016 at 2:38 PM, Alex Hall <ah...@autodist.com>
> wrote:
> >> >
> >> >> As the subject says, I am connected to our iSeries through straight
> >> >> pyodbc. That seems to run perfectly. Now, is there a way to use SA
> >> >> with that connection? When I use "ibm_db_sa+pyodbc://..." I get the
> >> >> exact same error I was getting when using ibm_db directly. Using
> >> >> pyodbc, I can specify the driver to be used, and I'm pretty sure
> >> >> that's the key.
> >> >>
> >> >> Can I either use my pyodbc connection with SA and ibm_db_sa for the
> >> >> dialect, or specify the driver to SA directly? Thanks!
> >> >>
> >> >>
> >> > You can pass a "creator" argument to create_engine if you want to
> >> > create
> >> > the connection yourself:
> >> >
> >> >
> >>
> http://docs.sqlalchemy.org/en/rel_1_0/core/engines.html#custom-dbapi-connect-arguments
> >> >
> >> >
> >>
> http://docs.sqlalchemy.org/en/rel_1_0/core/engines.html#sqlalchemy.create_engine.params.creator
> >> >
> >> > Hope that helps,
> >> >
> >> > Simon
> >> >
> >> > --
> >> > You received this message because you are subscribed to the Google
> >> > Groups
> >> > "sqlalchemy" group.
> >> > To unsubscribe from this group and stop receiving emails from it, send
> >> > an
> >> > email to sqlalchemy+unsubscr...@googlegroups.com.
> >> > To post to this group, send email to sqlalchemy@googlegroups.com.
> >> > Visit this group at https://groups.google.com/group/sqlalchemy.
> >> > For more options, visit https://groups.google.com/d/optout.
> >> >
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "sqlalchemy" group.
> >> To unsubscribe from this group and stop receiving emails from it, send
> an
> >> email to sqlalchemy+unsubscr...@googlegroups.com.
> >> To post to this group, send email to sqlalchemy@googlegroups.com.
> >> Visit this group at https://groups.google.com/group/sqlalchemy.
> >> For more options, visit https://groups.google.com/d/optout.
> >>
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "sqlalchemy" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to sqlalchemy+unsubscr...@googlegroups.com.
> > To post to this group, send email to sqlalchemy@googlegroups.com.
> > Visit this group at https://groups.google.com/group/sqlalchemy.
> > For more options, visit https://groups.google.com/d/optout.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to