keboola / db-extractor-mssql

MIT License
1 stars 2 forks source link

Wrong encoding while using Advanced queries #96

Closed padak closed 5 years ago

padak commented 5 years ago

I'm having one DB table, which is working smoothly in automatic mode and resulting in error:

Application error: Cannot upload file 'in.c-keboola-ex-db-mssql-zendesk4472.conparset_1.csv' to table 'in.c-keboola-ex-db-mssql-zendesk4472.conparset_1' in Storage API: Load error: odbc_execute(): SQL error: Invalid UTF8 detected in string '0x000x000x000x00E/0xB7'
File 'exp-180/130/files/2018/12/07/17103771.in.c_keboola_ex_db_mssql_zendesk4472.conparset_1.csv.gz', line 2, character 114
Row 1, column ""__temp_csvimpo

when using advanced query. Query is "just" col selection:

select 
CpsId as CPS_ID,
CpsConId as CPS_CON_ID,
CpsCpaId as CPS_CPA_ID,
CpsCpvId as CPS_CPV_ID,
CpsMeasure as CPS_MEASURE,
CpsTag as CPS_TAG,
CpsC as CPS_C,
CpsCBy as CPS_C_BY,
CpsCByCode as CPS_C_BY_CODE,
CpsU as CPS_U,
CpsUBy as CPS_U_BY,
CpsUByCode as CPS_U_BY_CODE,
CpsTagI as CPS_TAG_I,
CpsTagD as CPS_TAG_D,
CpsESrcId as CPS_E_SRC_ID,
CpsColor as CPS_COLOR,
CpsDateEnd as CPS_DATE_END,
CpsYSrtId as CPS_Y_SRT_ID,
CpsSrcId2 as CPS_SRC_ID2,
CpsTS as CPS_TS
from dbo.ConParSet WITH(nolock)
--where CpsC > CONVERT(char(10), GetDate()-90,126);
--where CpsId=5;
padak commented 5 years ago

@pivnicek Jakmile se tam přidá WHERE, tak se to jebne:

Dobrý den,

teď jsem to zreplikoval na tabulce COM_SHIP_NOTE. Full load proběhl v pořádku přes PDO, 
po přidání where podmínky where CsnId=29637, která vytáhla jeden záznam, load spadl na 
téže chybě, jakou popisuju. Extrakce z DB proběhla přes BCP.
padak commented 5 years ago

https://keboola.zendesk.com/agent/tickets/9544