Deleting DB Rows - Mydbr Report

(4 posts) (2 voices)


No tags yet.

  1. senthilselvan, Member

    Hi i trying to create a basic deleting option through DBR and i'm struck with the following.
    basically i want to delete particular row with popup confirmation.

    Error : Invalid column name '$(mydbr_selected_cell).parent().remove();'.

    if object_id('sp_DBR_delete_Test_Group','P') is not null
    drop procedure sp_DBR_delete_Test_Group
    create procedure sp_DBR_delete_Test_Group
    @labid varchar(10)
    begin delete
    where LAB_ID = @LABID select 'dbr.javascript', "$(mydbr_selected_cell).parent().remove();"; end

  2. myDBR Team, Key Master

    The SQL Server setting QUOTED_IDENTIFIER that is causing this. When the setting is ON, the string inside the double quotation marks in treated as a column name. If it is OFF, the string is treated as a literal.

    Easiest solution is simply to use single quotation marks:

    select 'dbr.javascript', '$(mydbr_selected_cell).parent().remove();';

    To turn off the QUOTED_IDENTIFIER, you can add following line to user/defaults.php:

    $mydbr_defaults['db_connection']['sqlsrv_server_init'] = ''SET ANSI_WARNINGS OFF;SET ARITHABORT OFF;SET ANSI_NULLS ON;QUOTED_IDENTIFIER OFF;',

    or use

    $mydbr_defaults['db_connection']['sql_server_init'] = ''SET ANSI_WARNINGS OFF;SET ARITHABORT OFF;SET ANSI_NULLS ON;QUOTED_IDENTIFIER OFF;',

    if you still use dblib instead of sqlsrv-driver.

    myDBR Team

  3. senthilselvan, Member

    Thanks .

    i'm trying to get the source code for the below header which is available in your DEMO Section
    but not getting the exact code . please help me with reference source codes to load the
    data from particular table and selected row should be deleted after the pop-up confirmation .

    'Editing example 3' - Samples for different editing capabilities in a simple list.

    Thank you

  4. myDBR Team, Key Master

    What is the exact source code that you are missing?

    Are you referencing the Editable report?

    The content of the "Editing Example 3" is fetched in sp_DBR_film_editing and the report doing the deletion (fake in the demo) is the sp_DBR_film_editing_del. Source code for both of them is shown in the "Show how this report is done"-section.

    myDBR Team


You must log in to post.