Giter Site home page Giter Site logo

Comments (3)

abmusse avatar abmusse commented on May 14, 2024

Original comment by Kristopher Baehr (Bitbucket: krisbaehr, GitHub: krisbaehr).


@ThePrez When I run an SQL statement, I'd like to be able to specify case-sensitivity. For example, when providing a method for searching for companies by name, I'd like to be able to indicate whether the SQL query should be case-insensitive ('abc' = 'ABC'). Setting the SRTSEQ is the way RPGLE indicates to DB2 to do it, and that may happen at compile time.

SRTSEQ = *LANGIDSHR indicates that a shared-weight sort table is used for the language id. When using shared-weight, the end result is that 'abc' and 'ABC' are equivalent on an SQL statement's where clause.
SRTSEQ = *HEX is the default, at least for us. This indicates that a sort sequence table is not used. In this case 'abc' <> 'ABC' on the where clause.
The setting used for SRTSEQ may have an impact on the order by clause too, but I'm not sure.

Like I mentioned in the first post, we can perform case-insensitive searches like this manually, but it would be handy if we could set an option instead:
select *
from companies
where lower(name) = lower(searchCriteria)

If this is an option, it would be nice if it wasn't specified at the connection level since the connections get re-used in a pool.

Let me know if you need further clarification, I appreciate all you guys do.

from nodejs-idb-connector.

abmusse avatar abmusse commented on May 14, 2024

Original comment by Jesse G (Bitbucket: ThePrez, GitHub: ThePrez).


@krisbaehr , my best guess is to call setConnAttr() specifying SQL_ATTR_CONN_SORT_SEQUENCE to SQL_ATTR_JOB_SORT_SEQUENCE, but I'm not sure that will give you exactly what you're looking for. But of course, that's on a connection, not a statement. I thought SRTSEQ only applied to sorting, not case sensitivity when matching.

What is your use case? Are you just doing some % inside a select WHERE clause?

from nodejs-idb-connector.

dmabupt avatar dmabupt commented on May 14, 2024

Consulted some Db2 experts. This feature is not supported.

It depends on the user to handle the case-insensitive searching like

upper('a')
upper(?)
upper(:var1)

from nodejs-idb-connector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.