Skip to main content
ExLibris
  • Subscribe by RSS
  • Ex Libris Knowledge Center

    SUBSTRB vs. SUBSTR

    • Article Type: Q&A
    • Product: Aleph
    • Product Version: 22

    Question

    The ./upgrade_express_2101_2201/source/1001/z304_insert_records.sql and the./upgrade_express_2101_2201/source/1003/z308_insert_records.sql use "SUBSTRB" instead of "SUBSTR" in their SQL queries of the new fields which allow multi-byte characters in the v22 z304 (patron address) and z308 (patron IDs) tables. Should "SUBSTRB" also be used (instead of SUBSTR) in the customer's own SQL queries of patron addresses, ID's, and foreign vendor addresses?

    Answer

    In all fields which may potentially have multi-byte-characters it is better to use SUBSTRB instead of SUBSTR. SUBSTR calculates lengths using characters as defined by the input character set. SUBSTRB uses bytes instead of characters.


    • Article last edited: 3/6/2014
    • Was this article helpful?