Hello Carlo -
(I refer to the latest trunk, which is close enough if you are using 1.55.2
or 3):

gluon/sql.py:

line 64:  try: import pyodbc  #  right now, this is for MSSQL support;

we'll expand, fix the message which now says "no MSSQL driver"  ;-)

You'll note that around line 645 (__init__),  there's a test for self.uri ==
'mssql://' or 'mssql2://';

We'll make a similar section for db2 to match the connection syntax
required;

For each sql funciton in the table, if there is special behavior for DB2 we
add that.

You'll get an idea when you look at SQL_DIALECTS (starting around line 90) -
maybe you can help with making this list of what the types would be in DB2.


Regards,
Yarko

On Sun, Feb 22, 2009 at 3:45 PM, carlo <syseng...@gmail.com> wrote:

>
> Yarko and Massimo, both of you are right of course: I did not use any
> DAL or ORM before web2py and sometimes I feel lost without my
> traditional sql statements. To say it all, I would not be perfectly
> persuaded that we need a DAL in place of a traditional SQL if I had
> not seen what additional advantages you have (validation ecc) with
> web2py through DAL.
>
> What I really meant to say (but I did not realize that before Yarko
> post !) is that I would like to have DAL-DB2 support through an odbc
> driver and not through a native db2 python driver. I do not know if
> what I just said is nonsense and I have not browsed sql.py yet but my
> thought is:
>
> I suppose DAL is a layer built over a particular database python API:
> sqlite=pysqlite, mysql=mysqldb ecc
>
> If this is true, why not have DAL support for an ODBC API like pyodbc?
> This way you can have a basic support for several RDBMS in one shot.
> By the way this could be an easy way to connect to MS Access databases
> which are very popular in Windows.
>
> Any way I am available to test any web2py to DB2 support both through
> pyodbc or pydb2. Let me know and thank you
>
> carlo
>
> On 22 Feb, 21:57, Yarko Tymciurak <yark...@gmail.com> wrote:
> > yes - there are two things you are talking about here, Carlo -
> > How do I connect to the DB server so it will listen to me?  That you have
> > answered with pyodbc.connect();
> >
> > And what will you say to it? --- Simply, with web2py your choices are
> > literally two, but practically one:
> >
> > - you can write all the DB2 SQL commands yourself directly from within
> > web2py:
> >
> > db.executesql('my commands');
> >
> > This is OK if you are doing one or two special tests to see if you're on
> > DB2, and issue special commands,
> > but if you write an app this way you will not have all the web2py
> behaviors
> > (e.g. form generation, validation); in other words you will make too much
> > work for yourself.
> >
> > The DAL description for a DB is not that complex, and offers you many
> > advantages.  Massimo (I think) would write the basics for you, if you
> will
> > test.   I think this is what you want / need.  It's not too much work.
> >
> > Have a look at gluon/sql.py:  SQL_DIALECTS  to see what we're talking
> about.
> >   Not too bad, really.
> >
> > I think you do want this.  Once you have it you will be happy.
> >
> > Regards,
> > Yarko
> >
> > On Sun, Feb 22, 2009 at 2:20 PM, mdipierro <mdipie...@cs.depaul.edu>
> wrote:
> >
> > > Even if you use odbc, don't you you still need to generate SQL
> > > statements in the DB2 SQL dialects?
> >
> > > Massimo
> >
> > > On Feb 22, 2:01 pm, carlo <syseng...@gmail.com> wrote:
> > > > massimo, I do not need native db2 support I always had access via
> odbc
> > > > ( I like pyodbc ), I was just wondering how I can have a connection
> > > > through a DSN (very common in windows environment) instead of using
> > > > the usual connection string. I found something in one thread here but
> > > > nothing official in the book.
> > > > As I said in my app I had:
> >
> > > > db400=pyodbc.connect("DSN=myAS400;UID=myUID;PWD=myPWD")
> >
> > > > I need a DAL equivalent.
> >
> > > > Said that, if you need to test a new web2py db2 support, I am
> > > > available as I have a vpn to my client's AS400 .
> >
> > > > carlo
> >
> > > > On 22 Feb, 17:34, mdipierro <mdipie...@cs.depaul.edu> wrote:
> >
> > > > > We do not have DB2 support but if you are available to run some
> tests
> > > > > we can have that in a couple of days.
> > > > > I will email you a new sql.py for you to test later today.
> >
> > > > > Massimo
> >
> > > > > On Feb 22, 9:47 am, carlo <syseng...@gmail.com> wrote:
> >
> > > > > > I am going to port an application developed in Karrigell to
> web2py:
> > > > > > RDBMS was DB2  on as400.
> >
> > > > > > In my actual version I connected through DSN and pyodbc this way:
> >
> > > > > > db400=pyodbc.connect("DSN=myAS400;UID=myUID;PWD=myPWD")
> >
> > > > > > How can I get a DSN connection through SQLDB? thank you
> >
> > > > > > carlo
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to