community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Announcement | We'll be doing maintenance between 9am-11am MT on Saturday, January 25th, which may impact your experience. Thanks for your patience as we work on improving the community!
SOLVED

Write Data In-DB passing field names as string

Atom

Hello,

 

I'm using the Write Data In-DB tool with "Append Existing" creation method and it's generating the query:

 

INSERT INTO `target_table` WITH `Tool3_da47` AS (Select test_db.source_table.* From test_db.source_table) SELECT "string_col", "integer_col", "timestamp_col", "boolean_col" FROM `Tool3_da47` AS `a`

 

Which errors out with

 

Error: Write Data In-DB (17): Error running PreSQL on "NoTable": [Simba][ImpalaODBC] (110) Error while executing a query in Impala: [HY000] : AnalysisException: Target table 'test_db.source_table' is incompatible with SELECT / PARTITION expressions. Expression ''integer_col'' (type: STRING) is not compatible with column 'integer_col' (type: INT)

 

It looks like the query is attempting to pass the column name as a string to the integer field.  For tables that only have string fiends, every row is populated with "string_col" rather than the correct value.

 

How do I modify the query so the fields don't have double quotes around "string_col", "integer_col", etc?

 

Thanks!

Alteryx
Alteryx

Hi @tehc0w

 

To change the Table/Field Name SQL style, in the Connect In-DB tool, click on the arrow then Manage Connection. Select the Data Source you're using and change the Table/Field Name SQL style to None. Do the same for both Read and Write. 

 

1.png

 

2.png

 

Fadi Bassil,
Manager - Sales Engineering, RoEMEA
Atom

Hi @FadiB

 

That works.  Thanks!

 

Quick observation: when I go back into the Manage In-DB Connections screen, the SQL style still shows Quoted even though the query generated now uses ` instead of "

Labels