Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nzpy throws error when using python datetime type as placeholder #35

Closed
shabbir10july opened this issue Jan 15, 2021 · 0 comments
Closed

Comments

@shabbir10july
Copy link
Contributor

Nzpy throws error when using python datetime type as placeholder . For e.g:

import nzpy
from datetime import ( datetime as Datetime)

conn = nzpy.connect(user="admin", password="password",host='localhost', port=5480, database="db1", securityLevel=0,logLevel=0, logOptions=nzpy.LogOptions.Logfile)

    with conn.cursor() as cursor:
        v = Datetime(2001, 2, 3, 4, 5, 6, 170000)
        cursor.execute("select ? as f1",(v,))
        for i in cursor.fetchall():
            print(i)

Traceback (most recent call last):
  File "run4.py", line 11, in <module>
    cursor.execute("select ? as f1",(v,))
  File "/usr/local/lib/python3.6/site-packages/nzpy-1.0-py3.6.egg/nzpy/core.py", line 850, in execute
    self._c.execute(self, operation, args)
  File "/usr/local/lib/python3.6/site-packages/nzpy-1.0-py3.6.egg/nzpy/core.py", line 1827, in execute
    raise ProgrammingError(self.error)
nzpy.core.ProgrammingError: ERROR:  'select 2001-02-03 04:05:06.170000 as f1'
error                      ^ found "04" (at char 19) expecting a keyword


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant