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

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
#SANTALYTICS

The highly anticipated Alteryx Community tradition is back! We hope you'll join us!

Learn More
We will be upgrading the Gallery to our 2019.4 release this Saturday, December 7th beginning at 9:00am MT. We expect the outage to take last approx. 2.5 hours.
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!

Highlighted
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