{"action":"created","issue":{"url":"https://api.github.com/repos/Pegase745/sqlalchemy-datatables/issues/31","labels_url":"https://api.github.com/repos/Pegase745/sqlalchemy-datatables/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/Pegase745/sqlalchemy-datatables/issues/31/comments","events_url":"https://api.github.com/repos/Pegase745/sqlalchemy-datatables/issues/31/events","html_url":"https://github.com/Pegase745/sqlalchemy-datatables/issues/31","id":121425722,"number":31,"title":"sqlalchemy.exc.DatabaseError: (cx_Oracle.DatabaseError) ORA-00906: missing left parenthesis","user":{"login":"okyere","id":7908765,"avatar_url":"https://avatars.githubusercontent.com/u/7908765?v=3","gravatar_id":"","url":"https://api.github.com/users/okyere","html_url":"https://github.com/okyere","followers_url":"https://api.github.com/users/okyere/followers","following_url":"https://api.github.com/users/okyere/following{/other_user}","gists_url":"https://api.github.com/users/okyere/gists{/gist_id}","starred_url":"https://api.github.com/users/okyere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okyere/subscriptions","organizations_url":"https://api.github.com/users/okyere/orgs","repos_url":"https://api.github.com/users/okyere/repos","events_url":"https://api.github.com/users/okyere/events{/privacy}","received_events_url":"https://api.github.com/users/okyere/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-10T08:02:35Z","updated_at":"2015-12-10T08:32:30Z","closed_at":null,"body":"Thanks for your package. I'm using it with flask and I'm getting the message in the title with this setup / configuration.\r\n\r\nThis is my flask view function:\r\n########################################\r\nfrom sqlalchemy.orm import mapper\r\n\r\n@theapp.route('/preview')\r\ndef preview():\r\n\r\n    columns = []\r\n    columns.append(ColumnDT('part_no'))\r\n    columns.append(ColumnDT('part_nm'))\r\n    columns.append(ColumnDT('material_spec'))\r\n    columns.append(ColumnDT('thickness'))\r\n\r\n    m = db.MetaData()\r\n    ff = db.Table('fabs_features', m, autoload = True, autoload_with = db.engine)\r\n\r\n    class Fabsfeatures(object):\r\n        def __init__(self, part_no, part_nm, material_spec, thickness):\r\n            self.part_no = part_no\r\n            self.part_nm = part_nm\r\n            self.material_spec = material_spec\r\n            self.thickness = thickness\r\n\r\n    mapper(Fabsfeatures, ff)\r\n\r\n    qry = db.session.query(Fabsfeatures)\r\n\r\n    rowTable = DataTables(request.args, Fabsfeatures, qry, columns)\r\n    return jsonify(rowTable.output_result())\r\n########################################\r\n\r\nindex.html\r\n###################################\r\n{% extends \"base.html\" %}\r\n\r\n{% block styles %}\r\n<link rel=\"stylesheet\" href=\"{{url_for('.static', filename='jquery.dataTables.min.css')}}\">\r\n{{super()}}\r\n{% endblock %}\r\n\r\n{% block scripts %}\r\n  {{super()}}\r\n  <script src=\"{{url_for('.static', filename='jquery.dataTables.min.js')}}\"> </script>\r\n  <script type=\"text/javascript\">\r\n        $(document).ready(function() {\r\n          $('#previewTable').DataTable( {\r\n          \"processing\": true,\r\n          \"serverSide\": true,\r\n          \"ajax\": \"{{ url_for('preview') }}\"\r\n          });\r\n      });\r\n  </script>\r\n{% endblock %}\r\n\r\n{% block content %}\r\n<div class=\"container\">\r\n    <h3>Index Page</h3>\r\n    <table id=\"previewTable\" class=\"display\" cellspacing=\"0\" width=\"50%\">\r\n\r\n      <thead>\r\n                <tr>\r\n                    <th>part_no</th>\r\n                    <th>part_nm</th>\r\n                    <th>material_spec</th>\r\n                    <th>thickness</th>\r\n                </tr>\r\n      </thead>\r\n      <tbody>\r\n      </tbody>\r\n\r\n    </table>\r\n\r\n</div>\r\n{% endblock %}\r\n###################################\r\n\r\nWith this setup, the ajax request fails with a 500 response. In the response body, the stack trace is:\r\n\r\n<!--\r\nTraceback (most recent call last):\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\flask\\app.py\", line 1836, in __call__\r\n    return self.wsgi_app(environ, start_response)\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\flask\\app.py\", line 1820, in wsgi_app\r\n    response = self.make_response(self.handle_exception(e))\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\flask\\app.py\", line 1403, in handle_exception\r\n    reraise(exc_type, exc_value, tb)\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\flask\\_compat.py\", line 33, in reraise\r\n    raise value\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\flask\\app.py\", line 1817, in wsgi_app\r\n    response = self.full_dispatch_request()\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\flask\\app.py\", line 1477, in full_dispatch_request\r\n    rv = self.handle_user_exception(e)\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\flask\\app.py\", line 1381, in handle_user_exception\r\n    reraise(exc_type, exc_value, tb)\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\flask\\_compat.py\", line 33, in reraise\r\n    raise value\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\flask\\app.py\", line 1475, in full_dispatch_request\r\n    rv = self.dispatch_request()\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\flask\\app.py\", line 1461, in dispatch_request\r\n    return self.view_functions[rule.endpoint](**req.view_args)\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\app\\views.py\", line 51, in preview\r\n    rowTable = DataTables(request.args, Fabsfeatures, qry, columns)\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\datatables\\__init__.py\", line 101, in __init__\r\n    self.run()\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\datatables\\__init__.py\", line 152, in run\r\n    self.filtering()\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\datatables\\__init__.py\", line 265, in filtering\r\n    self.cardinality_filtered = self.query.count()\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\sqlalchemy\\orm\\query.py\", line 2790, in count\r\n    return self.from_self(col).scalar()\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\sqlalchemy\\orm\\query.py\", line 2559, in scalar\r\n    ret = self.one()\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\sqlalchemy\\orm\\query.py\", line 2528, in one\r\n    ret = list(self)\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\sqlalchemy\\orm\\query.py\", line 2571, in __iter__\r\n    return self._execute_and_instances(context)\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\sqlalchemy\\orm\\query.py\", line 2586, in _execute_and_instances\r\n    result = conn.execute(querycontext.statement, self._params)\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\sqlalchemy\\engine\\base.py\", line 914, in execute\r\n    return meth(self, multiparams, params)\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\sqlalchemy\\sql\\elements.py\", line 323, in _execute_on_connection\r\n    return connection._execute_clauseelement(self, multiparams, params)\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\sqlalchemy\\engine\\base.py\", line 1010, in _execute_clauseelement\r\n    compiled_sql, distilled_params\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\sqlalchemy\\engine\\base.py\", line 1146, in _execute_context\r\n    context)\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\sqlalchemy\\engine\\base.py\", line 1341, in _handle_dbapi_exception\r\n    exc_info\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\sqlalchemy\\util\\compat.py\", line 188, in raise_from_cause\r\n    reraise(type(exception), exception, tb=exc_tb, cause=exc_value)\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\sqlalchemy\\util\\compat.py\", line 181, in reraise\r\n    raise value.with_traceback(tb)\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\sqlalchemy\\engine\\base.py\", line 1139, in _execute_context\r\n    context)\r\n  File \"C:\\Users\\okyernb\\pythonprojects\\datatables\\env\\lib\\site-packages\\sqlalchemy\\engine\\default.py\", line 450, in do_execute\r\n    cursor.execute(statement, parameters)\r\nsqlalchemy.exc.DatabaseError: (cx_Oracle.DatabaseError) ORA-00906: missing left parenthesis\r\n [SQL: 'SELECT count(*) AS count_1 \\nFROM (SELECT fabs_features.id AS fabs_features_id, fabs_features.part_no AS fabs_features_part_no, fabs_features.part_nm AS fabs_features_part_nm, fabs_features.material_spec AS fabs_features_material_s_1, fabs_features.thickness AS fabs_features_thickness \\nFROM fabs_features \\nWHERE lower(CAST(fabs_features.part_no AS VARCHAR2)) LIKE lower(:param_1) AND lower(CAST(fabs_features.part_no AS VARCHAR2)) LIKE lower(:param_1) AND lower(CAST(fabs_features.part_nm AS VARCHAR2)) LIKE lower(:param_2) AND lower(CAST(fabs_features.part_no AS VARCHAR2)) LIKE lower(:param_1) AND lower(CAST(fabs_features.part_nm AS VARCHAR2)) LIKE lower(:param_2) AND lower(CAST(fabs_features.material_spec AS VARCHAR2)) LIKE lower(:param_3) AND lower(CAST(fabs_features.part_no AS VARCHAR2)) LIKE lower(:param_1) AND lower(CAST(fabs_features.part_nm AS VARCHAR2)) LIKE lower(:param_2) AND lower(CAST(fabs_features.material_spec AS VARCHAR2)) LIKE lower(:param_3) AND lower(CAST(fabs_features.thickness AS VARCHAR2)) LIKE lower(:param_4)) anon_1'] [parameters: {'param_3': '%%', 'param_1': '%%', 'param_2': '%%', 'param_4': '%%'}]\r\n-->\r\n\r\nI've tried to mimic the flask example in the documentation but still this is what I get. Am I doing something wrong or this is a bug in the library? Thank you."},"comment":{"url":"https://api.github.com/repos/Pegase745/sqlalchemy-datatables/issues/comments/163533036","html_url":"https://github.com/Pegase745/sqlalchemy-datatables/issues/31#issuecomment-163533036","issue_url":"https://api.github.com/repos/Pegase745/sqlalchemy-datatables/issues/31","id":163533036,"user":{"login":"Pegase745","id":1678801,"avatar_url":"https://avatars.githubusercontent.com/u/1678801?v=3","gravatar_id":"","url":"https://api.github.com/users/Pegase745","html_url":"https://github.com/Pegase745","followers_url":"https://api.github.com/users/Pegase745/followers","following_url":"https://api.github.com/users/Pegase745/following{/other_user}","gists_url":"https://api.github.com/users/Pegase745/gists{/gist_id}","starred_url":"https://api.github.com/users/Pegase745/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pegase745/subscriptions","organizations_url":"https://api.github.com/users/Pegase745/orgs","repos_url":"https://api.github.com/users/Pegase745/repos","events_url":"https://api.github.com/users/Pegase745/events{/privacy}","received_events_url":"https://api.github.com/users/Pegase745/received_events","type":"User","site_admin":false},"created_at":"2015-12-10T08:32:30Z","updated_at":"2015-12-10T08:32:30Z","body":"ORA-00906 suggests that you have a problem in your database model. But you're on autoload. Could you print the datatabse sql query please ?"}}