maybe this SQL generated by the system for an existing table may help:

--  Generazione SQL
--  Versione:                   V5R3M0 040528
--  Generata su:                25/02/09 11:01:10
--  Database relazionale:       S657238C
--  Opzioni standard:           DB2 UDB iSeries

CREATE TABLE ANS0301F.B061F0 (
--  SQL150B   10   REUSEDLT(*NO) nella tabella B061F0 in ANS0301F
ignorata.
--  SQL1509   10   Nome formato B061F00 per B061F0 in ANS0301F
ignorato.
        B06102 CHAR(2) CCSID 280 NOT NULL DEFAULT '' ,
        B06103 CHAR(30) CCSID 280 NOT NULL DEFAULT '' ,
        B0610A CHAR(10) CCSID 280 NOT NULL DEFAULT '' ,
        B06104 DECIMAL(7, 0) NOT NULL DEFAULT 0 ,
        B06105 CHAR(1) CCSID 280 NOT NULL DEFAULT '' ,
        B06106 CHAR(1) CCSID 280 NOT NULL DEFAULT '' ,
        B06107 CHAR(1) CCSID 280 NOT NULL DEFAULT '' ) ;

LABEL ON TABLE ANS0301F.B061F0
        IS 'Tabelle tipi pagamento' ;

LABEL ON COLUMN ANS0301F.B061F0
( B06102 IS 'Tipo pagam.automat.' ,
        B06103 IS 'Ds tabella' ,
        B06104 IS 'Contatore I/E' ,
        B06105 IS 'Annullo tabella "/A ' ,
        B06106 IS 'Tipo pagam. (T/R/B)' ,
        B06107 IS 'Cessione (S/N)' ) ;

LABEL ON COLUMN ANS0301F.B061F0
( B06102 TEXT IS 'Tipo pagamento automatico' ,
        B06103 TEXT IS 'Descrizione tabella' ,
        B0610A TEXT IS 'Campo filler' ,
        B06104 TEXT IS 'Contatore I/E' ,
        B06105 TEXT IS 'Annullo tabella  "/A' ,
        B06106 TEXT IS 'Tipo pagamento (T/R/B)' ,
        B06107 TEXT IS 'Cessione (S/N)' ) ;


On 24 Feb, 23:54, mdipierro <mdipie...@cs.depaul.edu> wrote:
> guess not. leave it as it was.
>
> One of the execute in create table was failing. Perhaps it did not
> like the trailing ; or traling \n. Or perhaps the query was wrong.
> Can you help debug which one was failing?
>
> Massimo
>
> On Feb 24, 4:37 pm, DenesL <denes1...@yahoo.ca> wrote:
>
> > On Feb 24, 4:44 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > > Can you try change line 785 from
>
> > > self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
>
> > > to
>
> > > self._execute = lambda a: self._cursor.execute(a[:-1])
>
> > In my sql.py the line number is 789, changed as instructed.
>
> > > Any better?
>
> > >>> db=SQLDB('db2:DSN=dot8;UID=test;PWD=db2py')
> > >>> db.define_table('tt',
>
> > ...   SQLField('int','integer'),
> > ...   SQLField('str','string'))
> > <SQLSTable {'ALL': <gluon.sql.SQLALL object at 0x01928790>, 'str':
> > <gluon.sql.SQ
> > LField object at 0x01928690>, '_referenced_by': [], 'fields': ['id',
> > 'int', 'str
> > '], '_db': <SQLStorage {'_connection': <pyodbc.Connection object at
> > 0x019287A0>,
> >  '_lastsql': 'CREATE TABLE tt(\n\tid ROWID NOT NULL,\n\tint INT,\n
> > \tstr VARCHAR(
> > 32)\n);', '_dbname': 'db2', '_execute': <function <lambda> at
> > 0x0192F530>, 'tt':
> >  <SQLSTable {...}>, '_pools': 0, '_folder': 'applications\\test\
> > \databases', '_u
> > ri': 'db2:DSN=dot8;UID=test;PWD=db2py', 'tables': ['tt'],
> > '_translator': {'upper
> > ': 'UPPER(%(field)s)', 'reference': 'INT, FOREIGN KEY (%(field_name)s)
> > REFERENCE
> > S %(foreign_key)s (id) ON DELETE %(on_delete_action)s', 'text':
> > 'CLOB', 'random'
> > : 'RAND()', 'datetime': 'TIMESTAMP', 'substring': 'SUBSTR(%(field)s,%
> > (pos)s,%(le
> > ngth)s)', 'boolean': 'CHAR(1)', 'extract': 'EXTRACT(%(name)s FROM %
> > (field)s)', '
> > id': 'ROWID NOT NULL', 'is null': 'IS NULL', 'is not null': 'IS NOT
> > NULL', 'blob
> > ': 'IMAGE', 'notnull': 'NOT NULL DEFAULT %(default)s', 'string':
> > 'VARCHAR(%(leng
> > th)s)', 'date': 'DATE', 'integer': 'INT', 'password': 'VARCHAR(%
> > (length)s)', 'lo
> > wer': 'LOWER(%(field)s)', 'left join': 'LEFT OUTER JOIN', 'double':
> > 'DOUBLE', 'u
> > pload': 'VARCHAR(128)', 'time': 'TIME'}, '_cursor': <pyodbc.Cursor
> > object at 0x0
> > 192D6E8>}>, '_dbt': 'applications\\test\\databases\
> > \a574356351ae1b28d83f975bec5a
> > 0c18_tt.table', 'int': <gluon.sql.SQLField object at 0x01928870>,
> > '_tablename':
> > 'tt', '_logfilename': 'applications\\test\\databases\\sql.log', 'id':
> > <gluon.sql
> > .SQLField object at 0x019287D0>}>>>> db.tt.insert(int=1,str='hello')
>
> > Traceback (most recent call last):
> >   File "<console>", line 1, in <module>
> >   File "C:\web2py\trunk\gluon\sql.py", line 1303, in insert
> >     self._db._execute(query)
> >   File "C:\web2py\trunk\gluon\sql.py", line 790, in <lambda>
> >     self._execute = lambda a: self._cursor.execute(a[:-1])
> > Error: ('HY000', '[HY000] [IBM][iSeries Access ODBC Driver][DB2 UDB]
> > SQL7008 - TT
> >  in QGPL not valid for operation. (-7008) (SQLExecDirectW)')
--~--~---------~--~----~------------~-------~--~----~
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