usr_getconlabqty_amc_new is indeed returning row from db when checked in the backend. please elucidate.
127.0.0.1.2020-10-14.10-26-27.939fd264-ebf8-4e08-aa76-2ca0d84a5703
web2py™ | Version 2.14.6-stable+timestamp.2016.05.10.00.21.47 |
---|---|
Python | Python 2.7.5: D:\Python\python.exe (prefix: D:\Python) |
1. | Traceback (most recent call last): |
<type 'exceptions.TypeError'>('NoneType' object is not iterable)
File D:\web2py\gluon\packages\dal\pydal\base.py in executesql at line 1028 code arguments variables
(self=<DAL uri="mssql2:******@172.16.164.60\SQL16S7INS1/ocms_nlc">, query='exec usr_getconlabqty_amc_new @amcid=?', placeholders=['1910'], as_dict=True, fields=None, colnames=None, as_ordered_dict=False)
1023. | # Non-DAL legacy db query, converts cursor results to dict. |
fields | None |
---|---|
colnames | None |
columns | None |
f | undefined |
def schII():
if not URL.verify(request, hmac_key=KEY): raise HTTP(403)
amcid = request.vars.amcid
rowsamcdet = db(db.amc_details.amc_id == amcid).select(db.amc_details.amcno)
if not rowsamcdet:
session.flash = "No jobs to make provn"
redirect(URL('new_contract'))
amcnod = db(db.amc_master.id == amcid).select(db.amc_master.amcno).first()
x = db(db.cont_overheads.amc_id == amcid).select(db.cont_overheads.id)
for i in x:
record = i['id']
#rows = db(db.cont_overheads.id == record).select()
fields = ['phhskn','phhskd','phhsk',
'phskn','phskd','phsk',
'phsskn','phsskd','phssk',
'phuskn','phuskd','phusk',
'alwhskn','alwhskd','alwhsk',
'alwskn','alwskd','alwsk',
'alwsskn','alwsskd','alwssk',
'alwuskn','alwuskd','alwusk',
'tax','insurance','sac','bonus',
'supchr','fringes']
form = SQLFORM(db.cont_overheads,record,keepvalues=True,fields=fields)
if form.process(session=None, formname='frmschII',dbio=False,onvalidation=schII_validation).accepted:
form.vars.amc_id = amcid
form.vars.update_uid = session.uname
form.vars.amcno = amcnod['amcno']
form.record.update_record(**dict(form.vars))
db.executesql("exec update_load_schII_amt_awg @amcid = ?",placeholders=([form.vars.amc_id]))
session.flash = 'Overheads updated.'
redirect(URL('new_contract'))
elif form.errors:
print form.errors
response.flash = 'form has errors'
else:
response.flash = 'please fill the form'
# Note: no form instance is passed to the view
## record passed to set the id value in view.
rows = db(db.cont_overheads.id == record).select()
rowsconlab = db.executesql("exec usr_getconlabqty_amc_new @amcid=?",placeholders=([amcid]),as_dict=True)
rowsrate = get_amc_rate(amcid)
return dict(record=record,rowsconlab=rowsconlab,rows=rows,rowsrate=rowsrate)
EXEC is not a SQL statement.
-- Com os melhores cumprimentos, Carlos Correia ========================= MEMÓRIA PERSISTENTE GSM: 917 157 146 (Signal, WhatsApp) e-mail: ge...@memoriapersistente.pt URL: http://www.memoriapersistente.pt XMPP (Jabber): car...@memoriapersistente.pt GnuPG: wwwkeys.eu.pgp.net
I get this error for a particular amcid = 1910, for others it is working ok. What might be the problem. The sp
usr_getconlabqty_amc_new is indeed returning row from db when checked in the backend. please elucidate.
Dear Jim S
I found the error to be in the database in one of the tables. When I corrected the form worked nicely. It was all a programming error on my part. Thank you so much for your valuable time and effort in helping me out. Web2py rocks.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/IVY_TyXGsjE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/e311ffea-aa0c-45a2-962e-3423fcfe938ao%40googlegroups.com.