ref_language::set_data (public)
ref_language::set_data -label label [ -iso1 iso1 ] [ -iso2 iso2 ]
Defined in packages/ref-language/tcl/ref-language-procs.tcl
Add new ISO-639 language codes (3 chars and 2 chars) where they don't exist, update them otherwise.
- Switches:
- -label (required)
- -iso1 (optional)
- -iso2 (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- ref_language__set_data
Source code: if { $iso1 eq "" && $iso2 eq "" } { error "you need to provide either a 2 chars or a 3 chars language code" } else { if { $iso2 ne "" } { set exists_p [db_string get_lang {} -default 0] if { $exists_p } { db_dml update_lang {} } else { db_dml insert_lang {} } } if { $iso1 ne "" } { ref_language::set_iso1 -code $iso1 -name $label } }XQL Not present: PostgreSQL, Oracle Generic XQL file: <fullquery name="ref_language::set_data.get_lang"> <querytext> select count(*) from language_639_2_codes where iso_639_2 = :iso2 </querytext> </fullquery> <fullquery name="ref_language::set_data.update_lang"> <querytext> update language_639_2_codes set label = :label, iso_639_1 = :iso1 where iso_639_2 = :iso2 </querytext> </fullquery> <fullquery name="ref_language::set_data.insert_lang"> <querytext> insert into language_639_2_codes (iso_639_2, iso_639_1, label) values (:iso2, :iso1, :label) </querytext> </fullquery>packages/ref-language/tcl/ref-language-procs.xql