Editing Report Issues

(2 posts) (2 voices)

Tags:

No tags yet.

  1. senthilselvan, Member

    Hi

    i'm trying to edit the row with multiple column values and i'm getting the following error'

    'Unknown column reference: Edit'

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in C:\wamp64\www\mydbr\lib\localization.php on line 177

    ( ! ) Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 16384 bytes) in Unknown on line 0

    the scripts also shared below . . need support to rectify the error .

    if object_id('sp_DBR_Patient_Demo_Update','P') is not null
    drop procedure sp_DBR_Patient_Demo_Update
    go
    create procedure sp_DBR_Patient_Demo_Update
    (
    @labid varchar(10)
    )
    AS

    BEGIN

    select 'dbr.report', 'sp_DBR_patient_demo_sorce', '[Edit]', 'popup', '@lab_id=lab_id',
    '@Gender<=Gender', '@Patient_Name<=Patient_Name'

    select
    lab_id as 'lab_id',
    Gender as 'Gender',
    Patient_Name as 'Patient_Name',
    'Edit',
    'Del'
    from patient_dtl

    end
    go

    if object_id('sp_DBR_patient_demo_sorce','P') is not null
    drop procedure sp_DBR_patient_demo_sorce
    go
    CREATE PROCEDURE sp_DBR_patient_demo_sorce(
    @lab_id varchar(10),
    @Gender varchar(1),
    @Patient_Name varchar(50))
    as
    BEGIN

    update patient_dtl
    set Gender = @Gender, Patient_Name = @Patient_Name
    where lab_id = @lab_id;

    select 'dbr.refresh';

    END
    go

  2. myDBR Team, Key Master

    Hi,
    couple of changes.

    When you pass the parameter names to dbr.report, you do not need to include the @. So, instead of '@lab_id=lab_id', just use 'lab_id=lab_id'.

    Secondly, the 'Unknown column reference ' error comes from the fact that SQL Server does not generate column names from a string, you need to give it name. The query should look like:

    select
    lab_id as 'lab_id',
    Gender as 'Gender',
    Patient_Name as 'Patient_Name',
    'Edit' as 'Edit,
    'Del' as 'Del
    from patient_dtl

    As for the memory error, what is the language you are using in myDBR and how many rows do you have in the patient_dtl-table?

    --
    myDBR Team


Reply

You must log in to post.