exasol / pyexasol

Exasol Python driver with low overhead, fast HTTP transport and compression
MIT License
72 stars 39 forks source link

Import Parameters #48

Closed kamal-1 closed 4 years ago

kamal-1 commented 4 years ago

I am trying to use the import_from_iterable functionality but getting an error for the timestamp format. Is there a way to specify the timestamp format similar when using import_from_iterable function? I tried searching through the docs but didn't find any example for that.

littleK0i commented 4 years ago

In theory, you may run queries altering session parameters prior to IMPORT:

ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD'; -- set format
ALTER SESSION SET NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF6'; -- set format

, but it's not recommended.

The good idea is to update the code of your "iterable" or wrap it into another "iterable" and change text format to valid timestamp value which can be parsed by default Exasol format.

kamal-1 commented 4 years ago

Thanks for the response @wildraid. I'll update the iterable to have timestamp represented in correct format. One request - Can you please let me know all the attributes of the dictionary import_params?

littleK0i commented 4 years ago

Full list is documented here: https://github.com/badoo/pyexasol/blob/master/docs/HTTP_TRANSPORT.md#parameters

It roughly follows native parameter names for IMPORT / EXPORT.

kamal-1 commented 4 years ago

Thanks!