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

char0 can repalce in the processing of to_csv? #621

Open
wonb168 opened this issue May 26, 2022 · 1 comment
Open

char0 can repalce in the processing of to_csv? #621

wonb168 opened this issue May 26, 2022 · 1 comment

Comments

@wonb168
Copy link

wonb168 commented May 26, 2022

sqlserver column contain char(0), if direct to csv, will contain a special char and can't load into postgres db, and todb is also can't,
can replace char(0) in the function fromdb() or in tocsv()?
thanks!

@juarezr
Copy link
Member

juarezr commented May 26, 2022

HI @wonb168 ,

The behavior of petl is not handling the data retrieved from the DBApi cursor. It relies on the DBApi driver or the SQLAlchemy to do the job. Also, it doesn't specialize the handling towards any specific driver or database.

Maybe it's possible to investigate if:

  • there is an option for controlling the presence of char(0), the C string terminator, in the driver or SQLAlchemy.
  • the same behavior happens with PostgreSQL
  • the column datatype requires this in SQLServer or the program ingesting the data for this column is doing this.
  • or if you can write a transformation function in the petl code for removing this issue as a temporary solution.

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

2 participants