in reply to Re: When using § symbol am not getting any value
in thread When using § symbol am not getting any value

This is query am trying to execute, having problem with this § symbol. If this symbol is not present am getting the values correctly. But when I used this symbol records not getting correctly. I suppose not to ignore the symbol in this query.

SELECT DISTINCT a.area_code, t.trans_text AS Area_Name, a.area_sakey, +a.sort_order_num AS Area_Sort_Num FROM BL_trans t, pmon_cfg_fac pcf, +BL_station s, BL_equip e, BL_department d, BL_area a, BL_plant p, pmo +n_cfg_fac_type pcft , bl_gen_row_col_value grcv WHERE a.area_sakey = +d.area_sakey AND d.department_sakey = e.department_sakey AND e.equip_ +sakey = s.equip_sakey AND s.station_sakey = pcf.station_sakey AND a.a +rea_name_text_sakey = t.text_sakey AND a.plant_sakey = p.plant_sakey +AND p.plant_code = 'DAGEE' AND t.lang_code || NULL = '0X0409' AND pcf +.facility_type_id = pcft.facility_type_id AND s.station_sakey=grcv.ge +n_row_sakey AND grcv.gen_table_code='BL_STATION' AND grcv.appl_code=' +PMON' AND grcv.appl_col_code='SUPPLIER_ACCESS_LIST' AND (grcv.text_va +lue like '%B43P §%' or grcv.text_value like '%CXM7A§%' or grcv.text_v +alue like '%P73KA§%') AND pcft.qas_flag <> 'Y' ORDER BY a.sort_order_ +num, a.area_code

Replies are listed 'Best First'.
Re^3: When using § symbol am not getting any value
by Corion (Patriarch) on Apr 26, 2012 at 08:36 UTC

    The "§" sign can be encoded as different byte values depending on the encoding the component uses ("code page" is another term you might be familiar with).

    You have to find out (and make the same) all the different places where the encoding matters:

    • Find out what encoding your database driver uses.
    • Find out what encoding the database column values are in.
    • Find out what encoding your SQL string in your Perl script uses.
    • Find out what encoding your console uses to display strings. You can eliminiate that by replacing all bytes above \x7f with hexdumps in the output from your Perl script.
    • Find out what encoding your HTML page declares. You can eliminiate that if you are not outputting HTML.
    • Find out what encoding your HTML page is written in. You can eliminiate that if you are not outputting HTML.
    • Find out what encoding your browser thinks the HTML page is in. You can eliminiate that if you are not outputting HTML.

    My suggestion is to pull all places to input and output Unicde encoded as UTF-8, but that is not always possible. But at least declare in your ETL scripts and every place that reads or writes data what encoding is expected on input and what encoding is created on output.