IUREDCap/redcap-etl

SQL for view is too long

aarenson opened this issue · 2 comments

REDCap-ETL version 0.7.1
Starting processing.
Found 162 fields in REDCap.
Found 0 unmapped fields in REDCap.
Created table 'branch1root'
Created table 'branch1survey'; Lookup table created
Created table 'branch1medication_repeating_instruments'
Created table 'branch1meds_on_one_instrument'
Created table 'branch1test_negative_mean_calc'
Created table 'branch1iu_only'
MySQL error in query "CREATE OR REPLACE VIEW branch1for_testing_and_demonstration_purposes_only_nacho_label_view AS SELECT branch1for_testing_and_demonstration_purposes_only_nacho_id, branch1root_id, participant_id, redcap_event_name, nachos, treat, CASE treating WHEN '1' THEN 'Asthma' WHEN '2' THEN 'Cancer' WHEN '3' THEN 'Other' END as treating, othercondition, CASE last WHEN '1' THEN 'I am currently eating nachos.' WHEN '2' THEN 'I ate nachos earlier today.' WHEN '3' THEN 'I ate nachos this week.' WHEN '4' THEN 'I ate nachos in the last month.' WHEN '5' THEN 'I ate nachos in the last year.' WHEN '6' THEN 'I ate nachos more than a year ago.' END as last, traveled, miles, now, strong, CASE ingredients___1 WHEN 1 THEN 'Chips' ELSE 0 END as ingredients___1, CASE ingredients___2 WHEN 1 THEN 'Yellow cheese' ELSE 0 END as ingredients___2, CASE ingredients___3 WHEN 1 THEN 'Orange cheese' ELSE 0 END as ingredients___3, CASE ingredients___4 WHEN 1 THEN 'White cheese' ELSE 0 END as ingredients___4, CASE ingredients___5 WHEN 1 THEN 'Meat' ELSE 0 END as ingredients___5, CASE ingredients___6 WHEN 1 THEN 'Beans' ELSE 0 END as ingredients___6, CASE ingredients___7 WHEN 1 THEN 'Tomatoes' ELSE 0 END as ingredients___7, CASE ingredients___8 WHEN 1 THEN 'Peppers' ELSE 0 END as ingredients___8, CASE cheese WHEN '1' THEN '1 Don't like' WHEN '2' THEN '2' WHEN '3' THEN '3 Neutral' WHEN '4' THEN '4' WHEN '5' THEN '5 Love it' END as cheese, CASE crunch WHEN '1' THEN '1 Don't like' WHEN '2' THEN '2' WHEN '3' THEN '3 Neutral' WHEN '4' THEN '4' WHEN '5' THEN '5 Love it' END as crunch, CASE bean WHEN '1' THEN '1 Don't like' WHEN '2' THEN '2' WHEN '3' THEN '3 Neutral' WHEN '4' THEN '4' WHEN '5' THEN '5 Love it' END as bean, CASE guacamole WHEN '1' THEN '1 Don't like' WHEN '2' THEN '2' WHEN '3' THEN '3 Neutral' WHEN '4' THEN '4' WHEN '5' THEN '5 Love it' END as guacamole, CASE jalapeno WHEN '1' THEN '1 Don't like' WHEN '2' THEN '2' WHEN '3' THEN '3 Neutral' WHEN '4' THEN '4' WHEN '5' THEN '5 Love it' END as jalapeno, CASE meat WHEN '1' THEN '1 Don't like' WHEN '2' THEN '2' WHEN '3' THEN '3 Neutral' WHEN '4' THEN '4' WHEN '5' THEN '5 Love it' END as meat, life FROM branch1for_testing_and_demonstration_purposes_only_nacho" [1059]: Identifier name 'branch1for_testing_and_demonstration_purposes_only_nacho_label_view' is too long
Processing failed.

Generated on branch1 using REDCap-ETL external module and embedded server.

MySQL has limits on the length of table, database and column names:

https://dev.mysql.com/doc/refman/8.0/en/identifiers.html

In this case, you entered data that caused a MySQL error, and you got an appropriate MySQL error message.