title: cx_Oracle.DatabaseError: ORA-01489: result of string concatenation is too long
body: <p>So I am getting this error below from cx_oracle.</p>
  <pre><code>Traceback (most recent call last):
    File &quot;C:\ariel_deltas\excel.py&quot;, line 493, in generate_excel_file
      df = get_datframe_from_sql_with_binds(sql_lu_status, cursor_analytics, {&quot;v0&quot;: current_snapshot_id})
    File &quot;C:\ariel_deltas\dataframes.py&quot;, line 52, in get_datframe_from_sql_with_binds
      rs, col_names = get_data_with_binds(sql,cursor, bind_vars)
    File &quot;C:\ariel_deltas\data.py&quot;, line 129, in get_data_with_binds
      rs = cursor.fetchall()
  cx_Oracle.DatabaseError: ORA-01489: result of string concatenation is too long
  Error occured creating Excel file
  Traceback (most recent call last):
    File &quot;C:\ariel_deltas\excel.py&quot;, line 493, in generate_excel_file
      df = get_datframe_from_sql_with_binds(sql_lu_status, cursor_analytics, {&quot;v0&quot;: current_snapshot_id})
    File &quot;C:\ariel_deltas\dataframes.py&quot;, line 52, in get_datframe_from_sql_with_binds
      rs, col_names = get_data_with_binds(sql,cursor, bind_vars)
    File &quot;C:\ariel_deltas\data.py&quot;, line 129, in get_data_with_binds
      rs = cursor.fetchall()
  cx_Oracle.DatabaseError: ORA-01489: result of string concatenation is too long
  </code></pre>
  <p>My query is as below:</p>
  <pre><code> SELECT
      
                  a.snapshot_date,
                  a.change_type,
      
                  a.lu_number,
                  a.lu_title,
                  a.date_type,
                  a.date_before,
                  a.date_after,
                  a.value_before,
                  a.value_after,
                  a.lu_status_remarks as status_remarks,
                  a.lu_category,            
                  a.scrn_no,
                  a.lu_description,
                  a.lu_remarks,     
                  
                  
                  listagg(b.preferred_trade_name, ';;;') within group (order by b.preferred_trade_name) as products,
                  listagg(c.country_display_label,';;;') within group (order by c.country_display_label) as countries,
                  listagg(d.registration_uid,';;;') within group (order by d.registration_uid) as registrations,
                  listagg(g.application_stage,';;;') within group (order by g.application_stage) as application_stage,
                  listagg(h.application_type,';;;') within group (order by h.application_type) as application_type,
                  listagg(e.internal_ref_no,';;;') within group (order by e.internal_ref_no) as study_code,
                  listagg(f.registration_name_details,';;;') within group (order by f.registration_name_details) as registration_name_details
                  
      
      
              FROM
                  python_event_stream a, 
                  V_PYTHON_LU_DISTINCT_PRODUCTS   b,
                  V_PYTHON_LU_DISTINCT_COUNTRIES  c,
                  V_PYTHON_LU_DISTINCT_REG        d,
                  V_PYTHON_LU_DISTINCT_STUDY_CODE e,
                  V_PYTHON_LU_DISTINCT_REG_NAME_DET   f,
                  V_PYTHON_LU_DISTINCT_REG_NAME_APP_STAGE g,
                  V_PYTHON_LU_DISTINCT_REG_NAME_APP_TYPE  h
                   where 
                   a.snapshot_id_new = b.snapshot_id_new and a.variation_request_id = b.variation_request_id
                   and
                   a.snapshot_id_new = c.snapshot_id_new and a.variation_request_id = c.variation_request_id
                   and
                   a.snapshot_id_new = d.snapshot_id_new and a.variation_request_id = d.variation_request_id
                   and
                   a.snapshot_id_new = e.snapshot_id_new and a.variation_request_id = e.variation_request_id
                   and
                   a.snapshot_id_new = f.snapshot_id_new and a.variation_request_id = f.variation_request_id
                   and
                   a.snapshot_id_new = g.snapshot_id_new and a.variation_request_id = g.variation_request_id
                   and
                   a.snapshot_id_new = h.snapshot_id_new and a.variation_request_id = h.variation_request_id
                   
                  and a.snapshot_id_new = :v0 AND a.TABLE_NAME = 'FACT_LOCAL_UPDATE_STATUS'
                  AND 1 = 1 AND 1 = 1 AND 1 = 1 AND 1 = 1            
      
                  GROUP BY
      
      
                  a.snapshot_date,
                  a.change_type,
      
                  a.date_type,
                  a.date_before,
                  a.date_after,
                  a.value_before,
                  a.value_after,
                  a.lu_status_remarks,
                  a.lu_category,   
                  a.scrn_no,         
                  a.lu_number,
                  a.lu_title,
                  a.lu_description,
                  a.lu_remarks
                 
                  order by lu_number
      
  </code></pre>
  <p>The query runs fine in Oracle.  When I export it out to Excel, the longest result of the listagg output is 1021 characters.  So I am not sure what the problem is.</p>
  <p>I am creating a pandas dataframe, by sending the SQL into a function and returning the dataframe.</p>
  <p>I cant convert to a clob, because then openpyxl doesn't know what to do with it.</p>