case Sentsitive problem at searching

case Sentsitive problem at searching

rodrick26rodrick26 Posts: 5Questions: 0Answers: 0
edited January 2012 in DataTables 1.8
Thanx for this excelent plug-in. It is really cool.

I have a issue with case sentsitive searching.
I am using server-side processing (oracle database) and everything work like a charm, but "not" case sensitive searching is not working.
I know this plug-in is not case sensitive by default, but is not working for me.

Any clue about this?


This is my code:
DataTables-1.8.2
[code]
$('#table01').dataTable( {
"bProcessing": true,
"bServerSide": true,
"bAutoWidth": true,
"sAjaxSource": "scripts/server_processing_moviles.php",
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"iDisplayLength": 25,

"aoColumnDefs": [{ "sClass": "center", "aTargets": [ 0, 1, 2, 3, 4, ] }],

"oLanguage": {
"sProcessing": "Procesando...",
"sLengthMenu": "Mostrar _MENU_ registros por página",
"sZeroRecords": "No se encontraron resultados",
"sInfo": "Mostrando _START_ - _END_ de _TOTAL_ registros",
"sInfoEmpty": "Mostrando 0 - 0 de 0 registros",
"sInfoFiltered": "(filtrado de un total de _MAX_ registros)",
"sSearch": "Buscar:",
"oPaginate": {
"sFirst": "<<",
"sPrevious": "<",
"sNext": ">",
"sLast": ">>"
}
},
} );
} );

[/code]

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    If you are using server-side processing, as your code suggests, the the filtering is entirely done by your server-side script ("scripts/server_processing_moviles.php"). You might need to use ILIKE in your SQL to do a case insensitive filter.

    Allan
  • rodrick26rodrick26 Posts: 5Questions: 0Answers: 0
    Thanks for the answer Allan.

    I did not figure out that is a server-side issue.
    Sadly ILIKE does not work for Oracle. I found some commands, with those you can be case insensitive and accent insensitive.

    ALTER SESSION SET NLS_COMP=LINGUISTIC;
    ALTER SESSION SET NLS_SORT=BINARY_CI;
    ALTER SESSION SET NLS_SORT=BINARY_AI;

    Now I am looking where to executed them in this code:
    http://www.datatables.net/development/server-side/php_oracle

    Could you give me a clue?
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    I've not used Oracle, so you might be better asking in an Oracle forum, rather than this one. However they look like SQL commands, so I would guess they would apply to a transaction - so you might need to wrap the SQL up in a single transaction and then execute them just inside.

    Allan
  • rodrick26rodrick26 Posts: 5Questions: 0Answers: 0
    edited January 2012
    Thanks for the help again. It's working!!!.
    I put this code just before the "//Execute selects" on the php_oracle server-side code.
    ( http://www.datatables.net/development/server-side/php_oracle)
    I hope this is useful to someone.

    [code]
    $stid = oci_parse($conn, 'ALTER SESSION SET NLS_COMP=LINGUISTIC');
    oci_execute($stid);
    $stid = oci_parse($conn, 'ALTER SESSION SET NLS_SORT=BINARY_CI');
    oci_execute($stid);
    $stid = oci_parse($conn, 'ALTER SESSION SET NLS_SORT=BINARY_AI');
    oci_execute($stid);

    //Execute selects
    [/code]

    This plug-in is just awesome. Thanks for this great work Allan.
This discussion has been closed.