Problems with Server Side Processing Sql Server

Problems with Server Side Processing Sql Server

victorvvictorv Posts: 3Questions: 1Answers: 0

when I use the datatables with a view of a table in the database does not execute the query and follow the process to make me realize that SQL is generated internally:
'SELECT TOP 10 f120_id_cia,f120_id,f120_descripcion
FROM vw_tbl_prod
WHERE f120_descripcion NOT IN
(
SELECT f120_descripcion FROM
(
SELECT TOP 0 f120_id_cia,f120_id,f120_descripcion
FROM vw_tbl_prod

            ORDER BY  f120_id
                asc
        )
        as [virtTable]
    )
    ORDER BY  f120_id
                asc: Array'

we can see here that in the end added the sentence ': Array' which do not allow the sentence is carried out well, by taking this decision the query window of SQL server and delete the final fragment if executed properly confirming to the problem is in the text fragment.
try to solve the problem by deleting the text of the query before running sql_qwery:
$ sQuery = str_replace ("Array", "", $ sQuery);

It does not work, but do not understand how the text reappears when running: sqlsrv_query ($ gaSql ['link'], $ sQuery).

anyone know how I can solve this problem, please

Answers

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    How are you building your query? Please show your server-side script.

  • victorvvictorv Posts: 3Questions: 1Answers: 0
    edited October 2015

    I use the code of this page: https://datatables.net/development/server-side/php_mssql_odbc

    only updated with data to use into my server...

    /* Tables */
    $sTable = "vw_tbl_prod";

    /* Columns */
    $aColumns = array('f120_id_cia', 'f120_id', 'f120_descripcion');

    /* Indexed column (used for fast and accurate table cardinality) */
    $sIndexColumn = "f120_descripcion";

    please help me ...
    I think the problem is in the use of views because I have no problem when the information is used from tables ...

This discussion has been closed.