title: Firebird can't save to blob column because string literal too big
body: <p>I have a table that save various input from users. In one column we write a giant json string produced a step by step wizard. This column is defined as a blob sub_type 1 with the utf-8 charset.  </p>
  
  <p>Now I when I want to save the last step I get this error:</p>
  
  <blockquote>
    <p>String literal with 16538 characters exceeds the maximum length of 16383 characters for the UTF8 character set </p>
  </blockquote>
  
  <p>This happens online with my Rails server and also with my db admin tool (DBeaver).</p>
  
  <p>According to <a href="http://firebird.1100200.n4.nabble.com/Maximum-length-of-string-literals-td4640262.html" rel="nofollow noreferrer">this Link</a> there is a max length of a string literal. How do I save a string longer than this limit in a blob field?</p>
  
  <p>This would be the statement:</p>
  
  <pre><code>UPDATE "TABLE_WITH_JSON_STRING_FIELD" SET
      "JSON_FIELD" = '{"allgemeine_fragen":{"vorname":"John","nachname":"Smith","geburtstag":"01.01.1900","telefon":"0049 123 456 789 0","email":"test@tst.com","anzahl_kinder":"","beruf":"","groesse_cm":"","groesse_ft_in":"","gewicht_kg":"","gewicht_lb":"","bmi":"","kur":[{"jahr":"Jul 2015","klinikname":"test","ort":"baden baden"},{"jahr":"May 2013","klinikname":"test 2","ort":"test 2"}],"hobbies":"","im_ruhestand":"0"},"familienanamnese":{"vater_sonstiges":"","vater_anderes_karzinom":"","brueder_sonstiges":"","brueder_anderes_karzinom":"","sonstige_verwandte_sonstiges":"","sonstige_verwandte_anderes_karzinom":"","mutter_sonstiges":"","mutter_anderes_karzinom":"","schwestern_sonstiges":"","schwestern_anderes_karzinom":"","vater_schlaganfall":"0","vater_herzinfarkt":"0","vater_koronare_herzerkrankung":"0","vater_diabetes":"0","vater_bluthochdruck":"0","vater_darmerkrankungen":"0","vater_adipositas_fettleibigkeit":"0","vater_erhoehte_fettwerte":"0","vater_psych_erkrankung":"0","vater_alzheimer_demenz":"0","vater_thrombose_lungenembolie":"0","vater_osteoporose":"0","vater_blasenkarzinom":"0","vater_lungenkarzinom":"0","vater_dickdarmkarzinom":"0","vater_melanom":"0","vater_prostatakarzinom":"0","vater_hodenkarzinom":"0","brueder_schlaganfall":"0","brueder_herzinfarkt":"0","brueder_koronare_herzerkrankung":"0","brueder_diabetes":"0","brueder_bluthochdruck":"0","brueder_darmerkrankungen":"0","brueder_adipositas_fettleibigkeit":"0","brueder_erhoehte_fettwerte":"0","brueder_psych_erkrankung":"0","brueder_alzheimer_demenz":"0","brueder_thrombose_lungenembolie":"0","brueder_osteoporose":"0","brueder_blasenkarzinom":"0","brueder_lungenkarzinom":"0","brueder_dickdarmkarzinom":"0","brueder_melanom":"0","brueder_prostatakarzinom":"0","brueder_hodenkarzinom":"0","sonstige_verwandte_schlaganfall":"0","sonstige_verwandte_herzinfarkt":"0","sonstige_verwandte_koronare_herzerkrankung":"0","sonstige_verwandte_diabetes":"0","sonstige_verwandte_bluthochdruck":"0","sonstige_verwandte_darmerkrankungen":"0","sonstige_verwandte_adipositas_fettleibigkeit":"0","sonstige_verwandte_erhoehte_fettwerte":"0","sonstige_verwandte_psych_erkrankung":"0","sonstige_verwandte_alzheimer_demenz":"0","sonstige_verwandte_thrombose_lungenembolie":"0","sonstige_verwandte_osteoporose":"0","sonstige_verwandte_blasenkarzinom":"0","sonstige_verwandte_lungenkarzinom":"0","sonstige_verwandte_dickdarmkarzinom":"0","sonstige_verwandte_melanom":"0","sonstige_verwandte_prostatakarzinom":"0","sonstige_verwandte_hodenkarzinom":"0","sonstige_verwandte_mammakarzinom":"0","sonstige_verwandte_ovarialkarzinom":"0","sonstige_verwandte_zervixkarzinom":"0","mutter_schlaganfall":"0","mutter_herzinfarkt":"0","mutter_koronare_herzerkrankung":"0","mutter_diabetes":"0","mutter_bluthochdruck":"0","mutter_darmerkrankungen":"0","mutter_adipositas_fettleibigkeit":"0","mutter_erhoehte_fettwerte":"0","mutter_psych_erkrankung":"0","mutter_alzheimer_demenz":"0","mutter_thrombose_lungenembolie":"0","mutter_osteoporose":"0","mutter_blasenkarzinom":"0","mutter_lungenkarzinom":"0","mutter_dickdarmkarzinom":"0","mutter_melanom":"0","mutter_mammakarzinom":"0","mutter_ovarialkarzinom":"0","mutter_zervixkarzinom":"0","schwestern_schlaganfall":"0","schwestern_herzinfarkt":"0","schwestern_koronare_herzerkrankung":"0","schwestern_diabetes":"0","schwestern_bluthochdruck":"0","schwestern_darmerkrankungen":"0","schwestern_adipositas_fettleibigkeit":"0","schwestern_erhoehte_fettwerte":"0","schwestern_psych_erkrankung":"0","schwestern_alzheimer_demenz":"0","schwestern_thrombose_lungenembolie":"0","schwestern_osteoporose":"0","schwestern_blasenkarzinom":"0","schwestern_lungenkarzinom":"0","schwestern_dickdarmkarzinom":"0","schwestern_melanom":"0","schwestern_mammakarzinom":"0","schwestern_ovarialkarzinom":"0","schwestern_zervixkarzinom":"0"},"medikamente_supplemente":{"medikament":[{"name":"","dosierung":"","morgens":"","mittags":"","abends":"","nachts":"","beibedarf":"","seitwann":""}],"supplement":[{"name":"","dosierung":"","morgens":"","mittags":"","abends":"","nachts":"","beibedarf":"","seitwann":""}]},"allergien_unvertraeglichkeiten":{"unvertraeglichkeiten_nahrung_sonstige":"","umweltallergene_sonstige":"","medikamentenallergie":"","unvertraeglichkeiten_sonstige":"","medikamentenallergie_ja":"0"},"ernaehrungsanamnese":{"trinkverhalten_alkohol_name":"","trinkverhalten_trinken_sonstiges_name":"","ernaehrungsprofil_fruehstueck_was":"","ernaehrungsprofil_mittagessen_was":"","ernaehrungsprofil_abendessen_was":"","ernaehrungsprofil_zwischenmahlzeiten_was":"","ernaehrungsanamnese_bemerkungen":"","rauchverhalten_rauchen_beginn":"","rauchverhalten_rauchen_ende":"","rauchverhalten_rauchen_zigaretten_tag":"","rauchverhalten_rauchen_packyears":"","sucht_sonstiges":"","rauchverhalten_rauchen_zigaretten":"0","rauchverhalten_rauchen_e_zigarette":"0","rauchverhalten_rauchen_pfeife":"0","rauchverhalten_rauchen_zigarre":"0","rauchverhalten_rauchen_shisha":"0","sucht_alkohol":"0","sucht_medikamente":"0","sucht_drogen":"0","ernaehrungsberatung_gewuenscht":null},"darmgesundheit":{"darm_diagnosen_sonstiges":"","stuhlgang_rhythmus_pro_tag":"","stuhlgang_rhythmus_pro_woche":"","darm_beschwerden_symptome_sonstige":"","darmgesundheit_bemerkungen":"","gastroskopie_jahr":"","gastroskopie_wiederholung_geplant":"","gastroskopie_befund":"","koloskopie_jahr":"","koloskopie_wiederholung_geplant":"","koloskopie_befund":"","kapselendoskopie_jahr":"","kapselendoskopie_wiederholung_geplant":"","kapselendoskopie_befund":"","sonographie_abdomens_jahr":"","sonographie_abdomens_wiederholung_geplant":"","sonographie_abdomens_befund":"","darmgesundheit_op_therapie":[{"jahr":"","klinik":"","behandlung":""}],"helicobacter":"0","reflux":"0","refluxoesophagitis":"0","gastritis":"0","morbus_crohn":"0","colitis_ulcerosa":"0","diverticulitis":"0","haemorrhoiden":"0","koloskopie_gewuenscht":null,"gastroskopie_gewuenscht":null,"kapselendoskopie_gewuenscht":null,"sonographie_abdomens_gewuenscht":null},"herzkreislaufmedizin":{"hypotonie_seit":"","bluthochdruck_seit":"","herzinfarkt_wann":"","herzinfarkt_wo":"","herzinfarkt_befund":"","herzkreislauf_diagnosen_sonstiges":"","herzkreislauf_weitere_beschwerden_symptome":"","herzkreislaufmedizin_bemerkungen":"","kardiocheck_wann":"","blutdruck":[{"datum":"","morgens":"","mittags":"","abends":""}],"kardio_ct_wann":"","kardio_ct_wo":"","kardio_ct_befund":"","herzkreislauf_sonstige_diagnostik":"","bypass_operation_wann":"","bypass_operation_wo":"","bypass_operation_befund":"","klappen_operation_wann":"","klappen_operation_wo":"","klappen_operation_befund":"","herzkatheter_wann":"","herzkatheter_wo":"","herzkatheter_befund":"","herzkreislauf_op_therapie":[{"jahr":"","klinik":"","behandlung":""}],"hypotonie":"0","bluthochdruck":"0","koronare_herzkrankheit":"0","herzinsuffizienz":"0","synkope":"0","trombose_lungenembolie":"0","vorhofflimmern":"0","herzrhythmusstoerungen":"0","pavk":"0","herzinfarkt":"0","beschwerde_herzstolpern_rhythmusstoerungen":"0","beschwerde_luftnot_bei_belastung":"0","luftnot_in_ruhe":"0","beschwerde_angina_pectoris":"0","schwindel":"0","geschwollene_beine":"0","kardiocheck":"0","kardio_ct":"0","bypass_operation":"0","klappen_operation":"0","herzkatheter":"0","stent":"0","herzschrittmacher":"0","kardio_check_gewuenscht":null},"stoffwechsel":{"stoffwechsel_beschwerden_symptome":"","stoffwechsel_bemerkungen":"","sono_schilddrüse_jahr":"","sono_schilddrüse_wiederholung_geplant":"","sono_schilddrüse_befund":"","stoffwechsel_diagnostik":"","stoffwechsel_op_therapie":[{"jahr":"","ort":"","befund":""}],"diabetes_typ_1":"0","diabetes_typ_2":"0","schilddruesenueberfunktion":"0","schilddruesenunterfunktion":"0","erhoehte_blutfette":"0","hypercholesterinaemie":"0","hypertriglyceridaemie":"0","fettleber":"0","sono_schilddruese_gewuenscht":null},"augenheilkunde":{"augenheilkunde_beschwerden_symptome":"","augenheilkunde_bemerkungen":"","augenheilkunde_diagnostik":"","augenheilkunde_op_therapie":[{"jahr":"","ort":"","befund":""}],"diabetische_retinopathie":"0","hypertensive_retinopathie":"0","erhoehter_augeninnendruck":"0","linsentruebung":"0","kurzsichtigkeit":"0","weitsichtigkeit":"0","alterssichtigkeit":"0","sehhilfe_brille":"0","sehhilfe_linsen":"0","augen_vorsorgediagnostik_gewuenscht":null},"zahnheilkunde":{"zahnheilkunde_diagnosen":"","zahnheilkunde_beschwerden_symptome":"","zahnheilkunde_bemerkungen":"","letzte_zahnaerztliche_kontrolle":"","zahnheilkunde_diagnostik":"","zahnheilkunde_op_therapie":[{"jahr":"","ort":"","befund":""}],"zahnfleischbluten_entzuendungen":"0","zaehneknirschen":"0","zahnfleischrueckgang":"0","problem_kiefergelenk":"0","fehlbiss":"0","zahnersatz":"0","implantate":"0","fuellungen":"0","fuellung_gold":"0","fuellung_amalgam":"0","fuellung_kunststoff":"0","keramikkronen":"0","wurzelbehandlungen":"0","zahnregulierungen_kieferorthopaed":"0","zahnuntersuchung_gewuenscht":null,"prof_zahnreinigung_gewuenscht":null,"bleaching_gewuenscht":null},"atemwege_hno":{"atemwege_hno_beschwerden_symptome":"","atemwege_hno_bemerkungen":"","atemwege_hno_diagnostik":"","atemwege_hno_op_therapie":[{"jahr":"","ort":"","befund":""}],"chron_sinusitis_tinnitus":"0","copd_chronische_bronchitis":"0","asthma_bronchiale":"0","schwerhoerigkeit":"0","tinnitus":"0","halsschmerzen":"0","chron_schnupfen":"0","geschwollene_lymphknoten":"0","riechstoerung":"0","schwindel":"0","hno_untersuchung_gewuenscht":null,"lungen_untersuchung_gewuenscht":null},"sportmedizin_orthopaedie":{"sport_zeit_pro_woche":"","form_bewegung_sport":"","schulterschmerzen_sonstiges":"","rueckenschmerzen_sonstiges":"","tennisellenbogen_text":"","hand_sonstiges":"","huefte_sonstiges":"","knie_sonstiges":"","fuesse_einlagen":"","mittelfussbruch_ermuedungsbruch":"","sprunggelenk_fuesse_sonstiges":"","knochenbrueche_wann":"","knochenbrueche_lokalisation":"","sportunfaelle_wann":"","sportunfaelle_therapie":"","trainingstherapie_gewunscht_anzahl":null,"trainingstherapie_gewunscht_sonstige_text":null,"herzkreislaufmedizin_bemerkungen":"","aktuelle_beschwerden":"","durchgefuehrte_orthop_therapien":"","cortison_injektionen_wann":"","cortison_injektionen_wo":"","stosswellentherapie_wann":"","stosswellentherapie_wo":"","physiotherapie":"","tcm":"","med_trainingstherapie":"","magnetfeldtherapie":"","medikamente":"","sonstige":"","schulterschmerzen":"0","schulter_schleimbeutel":"0","schulter_verkalkung":"0","schulter_arthrose":"0","rueckenschmerzen":"0","halswirbelsaeule":"0","halswirbelsaeule_bandscheibenvorfall":"0","halswirbelsaeule_op":"0","brustwirbelsaeule":"0","brustwirbelsaeule_bandscheibenvorfall":"0","brustwirbelsaeule_op":"0","lendenwirbelsaeule":"0","lendenwirbelsaeule_bandscheibenvorfall":"0","lendenwirbelsaeule_op":"0","iliosakralgelenk":"0","iliosakralgelenk_bandscheibenvorfall":"0","iliosakralgelenk_op":"0","tennisellenbogen":"0","hand":"0","ganglion":"0","fingerarthrosen":"0","karpaltunnelsyndrom":"0","huefte":"0","hueftarthrose":"0","huefte_schleimbeutel":"0","leistenschmerzen":"0","knie":"0","meniskusschaden":"0","knorpelschaeden":"0","kreuzbandverletzung":"0","kniearthrose":"0","kniegelenkserguss":"0","sprunggelenk_fuesse":"0","sprunggelenk_fuesse_arthrose":"0","baenderrisse":"0","achillessehnenbeschwerden":"0","spreiz_send_plattfuesse":"0","fersensporn":"0","muskelverletzungen":"0","muskelkraempfe":"0","sehnenverletzungen":"0","knochenbrueche":"0","knochenbrueche_op":"0","osteoporose":"0","rachitis":"0","vitamin_d_mangel":"0","rheuma":"0","sportunfaelle":"0","trainingstherapie_gewunscht_fahrrad":null,"trainingstherapie_gewunscht_golf":null,"trainingstherapie_gewunscht_sonstige":null,"cortison_injektionen":"0","stosswellentherapie":"0","orthopaedische_untersuchung_gewuenscht":null,"sportmedizinische_untersuchung_gewuenscht":null,"trainingstherapie_gewunscht":null,"physiotherapie_gewunscht":null,"osteopathie_gewunscht":null,"kaeltetherapie_gewuenscht":null,"hoehentherapie_gewuenscht":null,"trainingstherapie_gewunscht_radio":null},"nerven_neurologie":{"nerven_neurologie_diagnosen_sonstiges":"","nerven_neurologie_beschwerden_symptome":"","nerven_neurologie_bemerkungen":"","dopplersono_carotiden_jahr":"","dopplersono_carotiden_wiederholung_geplant":"","dopplersono_carotiden_befund":"","nerven_neurologie_diagnostik":"","nerven_neurologie_op_therapie":[{"jahr":"","ort":"","befund":""}],"schlaganfall":"0","polyneuropathie":"0","multiple_sklerose":"0","morbus_parkinson":"0","demenz":"0","migraene":"0","kopfschmerzen":"0","epilepsie":"0","schwindel":"0","taubheit":"0","kraftverlust":"0","laehmungen":"0","demenzcheck_gewuenscht":null,"neurologische_untersuchung_gewuenscht":null,"dopplersono_carotiden_gewuenscht":null},"schmerz":{"sonstiger_schmerz":"0","keine_schmerzen":"0"},"frauengesundheit_gynaekologie":{"geburten_anzahl":"","fehlgeburten_anzahl":"","zyklusanamnese_sonstiges":"","gynaekologie_bemerkungen":"","brustkrebs_screening_jahr":"","brustkrebs_screening_wiederholung_geplant":"","brustkrebs_screening_befund":"","gynaekologischer_check_jahr":"","gynaekologischer_check_wiederholung_geplant":"","gynaekologischer_check_befund":"","gynaekologie_diagnostik":"","gynaekologie_op_therapie":[{"jahr":"","ort":"","befund":""}],"geburt":"0","fehlgeburt":"0","sectio":"0","dammriss_dammschnitt":"0","brustkrebs":"0","gebaermutterkrebs":"0","eierstockkrebs":"0","brustkrebs_screening_gewuenscht":null,"gynaekologischer_check_gewuenscht":null,"hormonsprechstunde_gewuenscht":null},"nephrologie_urogenitaltrakt_female":{"nephrologie_urogenitaltrakt_diagnosen":"","haeufiges_wasserlassen_wie_oft":"","naechtliches_wasserlassen_wie_oft":"","nephrologie_urogenitaltrakt_beschwerden_symptome":"","nephrologie_urogenitaltrakt_bemerkungen":"","nephrologie_urogenitaltrakt_diagnostik":"","nephrologie_urogenitaltrakt_op_therapie":[{"jahr":"","ort":"","befund":""}],"niereninsuffizienz":"0","nierensteine":"0","chronische_harnwegsinfekte":"0","urininkontinenz":"0","abgeschwaechter_harnstrahl":"0","schmerzen_wasserlassen":"0","haeufiges_wasserlassen":"0","naechtliches_wasserlassen":"0"},"psyche":{"psyche_diagnosen":"","psyche_beschwerden_symptome":"","psyche_op_therapie":[{"jahr":"","ort":"","befund":""}],"psyche_bemerkungen":"","psyche_froehlich":"0","psyche_gluecklich":"0","psyche_ausgeglichen":"0","psyche_traurig":"0","psyche_depressiv":"0","psyche_aggressiv":"0","psyche_einsam":"0","erschoepft":"0","psychologisches_gespraech_gewuenscht":null,"coaching_beratung_gewuenscht":null},"dermatologie_aesthetik":{"dermatologie_aesthetik_bemerkungen":"","dermatologie_aesthetik_beschwerden_symptome":"","dermatologie_aesthetik_wuensche":"","hautkrebsscreening_jahr":"","hautkrebsscreeninge_wiederholung_geplant":"","hautkrebsscreening_befund":"","dermatologie_aesthetik_diagnostik":"","dermatologie_aesthetik_op_therapie":[{"jahr":"","ort":"","befund":""}],"psoriasis":"0","neurodermitis":"0","basaliom":"0","melanom":"0","dermatologische_diagnostik_gewuenscht":null},"schlafmedizin":{"schlafmedizin_schlafqualitaet":"1","schlafmedizin_bemerkungen":"","schlafmedizin_wuensche":"","schlafmedizin_schlaflabor_untersuchung_wann":"","schlafmedizin_diagnostik":"","schlafmedizin_op_therapie":[{"jahr":"","ort":"","befund":""}],"schlafmedizin_schlafapnoe":"0","schlafmedizin_beatmungsgeraet":"0","schlafmedizin_unterkieferprotrusionsschiene":"0","schlafmedizin_einschlafstoerungen":"0","schlafmedizin_durchschlafstoerungen":"0","schlafmedizin_naechtliches_wasserlassen":"0","schlafmedizin_schnarchen":"0","schlafmedizin_apnoe":"0","schlafmedizin_lumbalgie":"0","schlafmedizin_muskelkraempfe":"0","schlafmedizin_morgenmuedigkeit":"0","schlafmedizin_zappelbeine":"0","schlafmedizin_sekundenschlaf":"0","schlafmedizin_nachtschweiss":"0","schlaflaboruntersuchung_gewuenscht":null,"schlafmedizinische_beratung_gewuenscht":null},"infektion_reisemedizin_impfung":{"infektionen_chronisch_sonstige":"","infektions_reisemedizin_impfung_bemerkungen":"","infektions_reisemedizin_impfung_wuensche":"","impfungen_influenza_letzte_impfung":"","impfungen_sonstige":"","herpes":"0","infektionen_hepatitis_b":"0","infektionen_hepatitis_c":"0","infektionen_hiv":"0","infektionen_tuberkulose":"0","infektionen_infektioese_durchfaelle":"0","infektionen_resistente_keime":"0","malaria":"0"},"nephrologie_urogenitaltrakt":{"urogloische_diagnostik_gewuenscht":null},"gewuenschte_diagnostik_therapie":{"trainingstherapie_gewunscht_anzahl":"","trainingstherapie_gewun2018-11-27T09:06:57.467671307Z scht_sonstige_text":"","wuensche_bemerkungen":"","trainingstherapie_gewunscht_fahrrad":"0","trainingstherapie_gewunscht_golf":"0","trainingstherapie_gewunscht_sonstige":"0"}}'
  WHERE
      "TABLE_WITH_JSON_STRING_FIELD"."ID" = 129444104;
  </code></pre>