Only Case Sensitive search when serverSide: true

Only Case Sensitive search when serverSide: true

zajczajc Posts: 67Questions: 10Answers: 2
edited October 2023 in DataTables 1.10

When we are using serverSide: true (Oracle) the search is only Case Sensitive. When we are using serverSide: false, the search is Case Insensitive. We tried to use caseInsensitive: true but it is not working. Is there any workaround for serverSide: true? I know what the problem is. Created SQL have only case insensitive WHERE.

...category like :where_16

{
"name": ":where_16",
"value": "%facelija%",
"type": null
}

For Case Insensitive SQL should be correct

... UPPER(category) like UPPER(:where_16)

{
"name": ":where_16",
"value": "%facelija%",
"type": null
}

DataTables version 1.13.6
Editor version 2.2.2

Answers

  • zajczajc Posts: 67Questions: 10Answers: 2
    edited October 2023

    I added to OracleQuery.php the following lines and now the case insensitive search works:

    $stmt = oci_parse($conn, "ALTER SESSION SET NLS_COMP=LINGUISTIC");
    $res = oci_execute($stmt);
    
    $stmt = oci_parse($conn, "ALTER SESSION SET NLS_SORT=BINARY_CI");
    $res = oci_execute($stmt);
    
  • allanallan Posts: 61,628Questions: 1Answers: 10,091 Site admin

    That's for posting back. Yes, when server-side processing is enabled, it is up to the server-side script to decide how the search operation should be done. Looks like a good solution :)

    Allan

Sign In or Register to comment.