pyodbc: export_objects returns nothing for schema

Moderator: NorbertKrupa

dbmsuser7
Intermediate
Intermediate
Posts: 71
Joined: Tue Jan 28, 2014 3:03 am

Re: pyodbc: export_objects returns nothing for schema

Post by dbmsuser7 » Wed Feb 26, 2014 5:17 pm

sKwa wrote,
and what if schema is bigger than 65000 chars in v6 for example?
For what it's worth, I did the dump directly in vsql, and it's about 82,000 chars. Does that explain why pyodbc can't do it?

id10t
GURU
GURU
Posts: 732
Joined: Mon Apr 16, 2012 2:44 pm

Re: pyodbc: export_objects returns nothing for schema

Post by id10t » Wed Feb 26, 2014 8:03 pm

Hi!

[DELETED]
Last edited by id10t on Fri May 08, 2015 4:33 pm, edited 1 time in total.

id10t
GURU
GURU
Posts: 732
Joined: Mon Apr 16, 2012 2:44 pm

Re: pyodbc: export_objects returns nothing for schema

Post by id10t » Wed Feb 26, 2014 9:58 pm

Hi!

[DELETED]
Last edited by id10t on Fri May 08, 2015 4:33 pm, edited 1 time in total.

dbmsuser7
Intermediate
Intermediate
Posts: 71
Joined: Tue Jan 28, 2014 3:03 am

Re: pyodbc: export_objects returns nothing for schema

Post by dbmsuser7 » Wed Feb 26, 2014 10:10 pm

Thanks, sKwa!

Yes, my workaround also involved using vsql directly. I didn't want to do it that way, because we already have a nice set of wrappers set up for pyodbc, but the vsql solution (which we've used for some other stuff) isn't too ugly or anything.

Best wishes,

S

id10t
GURU
GURU
Posts: 732
Joined: Mon Apr 16, 2012 2:44 pm

Re: pyodbc: export_objects returns nothing for schema

Post by id10t » Wed Feb 26, 2014 10:24 pm

Hi!

[DELETED]
Last edited by id10t on Fri May 08, 2015 4:31 pm, edited 1 time in total.

dbmsuser7
Intermediate
Intermediate
Posts: 71
Joined: Tue Jan 28, 2014 3:03 am

Re: pyodbc: export_objects returns nothing for schema

Post by dbmsuser7 » Wed Feb 26, 2014 10:47 pm

Yeah, we have a small codebase where we use tricks like that. Though then there's issues like connecting to the host in the cluster where the stuff was dumped. So what's easiest and reliable seems to depend on the context. (Specifically, the host from which we run all the python stuff has vsql and pyodbc, but it's not the Vertica cluster.)

For me the vsql method was appealing because I just pulled some code that had already been written, and tweaked it to capture standard out.

...adding on edit: I wonder if it would be possible to create a table that consists of a single column belonging to a really large text datatype, then INSERT INTO that table by SELECTing the EXPORT_OBJECTS(), and then retrieve that using pyodbc. Meaning, I'm guessing the problem is that maybe the data type of the result from EXPORT_OBJECTS() isn't really specified in advance, and pyodbc picks something large but not large enough...
Last edited by dbmsuser7 on Wed Feb 26, 2014 11:41 pm, edited 1 time in total.

NorbertKrupa
GURU
GURU
Posts: 527
Joined: Tue Oct 22, 2013 9:36 pm
Location: Chicago, IL
Contact:

Re: pyodbc: export_objects returns nothing for schema

Post by NorbertKrupa » Wed Feb 26, 2014 11:07 pm

What's the use case here? Perhaps there's another way to go about your problem.
Checkout vertica.tips for more Vertica resources.

Post Reply

Return to “Python”