Re: [web2py] Accessing MySQL data without define tables

2019-02-12 Thread Jon Subscripted
Thanks Ben, I'll try what you suggest. Regards, Jon. On Tue, Feb 12, 2019 at 2:17 PM Ben Duncan wrote: > Here is the TOP of what I use. > You will need the migrate commands in your connections tring > > > --

Re: [web2py] Accessing MySQL data without define tables

2019-02-12 Thread Ben Duncan
Here is the TOP of what I use. You will need the migrate commands in your connections tring -- import os, sys, string, copy, time import getopt from types

Re: [web2py] Accessing MySQL data without define tables

2019-02-12 Thread Jon Subscripted
Hi, BTW I was checking "sql.log" file just in case I had unintentionally messed up redefining the fen field twice and saw that every execution of the script in my previous email led to a CREATE TABLE (see below). There's more than one (one per each test I performed with the script). Is this normal

Re: [web2py] Accessing MySQL data without define tables

2019-02-12 Thread Jon Subscripted
Thanks Ben, I did what you suggested and somehow I think I moved on. Still I got a weird error: InternalError: (1060, u"Duplicate column name 'fen__tmp'") import sys sys.path.append(r'C:\Users\Jon\Downloads\web2py_src\web2py\gluon') from gluon import DAL,Field from gluon import * dbpath = r'C:

Re: [web2py] Accessing MySQL data without define tables

2019-02-11 Thread Ben Duncan
No , all you need is the db.define for the table you are going to access, unless there is foreign keyes involved. Then include the PARENT table if these are child tables. *Ben Duncan* DBA / Chief Software Architect Mississippi State Supreme Court Electronic Filing Division On Mon, Feb 11, 2019 a

Re: [web2py] Accessing MySQL data without define tables

2019-02-11 Thread Jon Subscripted
Thanks Ben, Should I include just the define_table for that very table (there are more, but will not be accessed)? Regards, Jon. On Mon, Feb 11, 2019 at 4:26 PM Ben Duncan wrote: > If this script is being run OUTSIDE the web2py environment then you will > need to include the define inside the py

Re: [web2py] Accessing MySQL data without define tables

2019-02-11 Thread Ben Duncan
If this script is being run OUTSIDE the web2py environment then you will need to include the define inside the python program itself. *Ben Duncan* DBA / Chief Software Architect Mississippi State Supreme Court Electronic Filing Division On Mon, Feb 11, 2019 at 9:01 AM Jon Subscripted wrote: >

Re: [web2py] Accessing MySQL data without define tables

2019-02-11 Thread Jon Subscripted
Thanks Ben, Honestly I do not know if I understood what you suggest, sorry... it's actually my fault as I'm still trying to learn web2py (reading the manual, etc.). My web2py-app is actually working, but I still have lost of data to load in the DB. Most of the data to populate de DB is created out

Re: [web2py] Accessing MySQL data without define tables

2019-02-11 Thread Ben Duncan
Oh yeah. One thing I missed explaining is that I spend the end of last year creating a python library that would take file layouts I've gleaned from a 4GL, old cobol systems and an Informix database, and some Oracle Financials. I've create a "layout template" that the library will generate the cre

Re: [web2py] Accessing MySQL data without define tables

2019-02-11 Thread Ben Duncan
I'm not sure what your statement means, however i will give it my best shot to explain> I'm new to web2py myself. Her goes: In my models folder i have several different sub folders: ar, ap ,gl ...etc... Each has the definition. For example under ar there is the dbf_arfiles_dal.py which starts lik

Re: [web2py] Accessing MySQL data without define tables

2019-02-09 Thread Jon Subscripted
Hi Ben, Inside my app folder I do have the table defined, but not in my script (accessing the db outside web2py). I thought that the folder path reference solved this (*). Should i add the define table in my script? Thanks and regards, Jon. (*) I guess that’s why .table files are kept even when

Re: [web2py] Accessing MySQL data without define tables

2019-02-08 Thread Ben Duncan
Did you set up the db_define table for the database in models. For example, the accounting package I am working on for our Supreme Court has and external postgres database. >From the DDL, I've created, for example, the "ship to code" file (we reuse for something else) -