dbr.editable with inLogin parameter

(2 posts) (2 voices)


No tags yet.

  1. spyhunter88, Member

    Hi Team,

    By the default the edit report inside dbr.editable always gets edit value in the last parameter. So when I define it like:
    CREATE PROCEDURE sp_DBR_update_Index(inID int, inCol varchar(50), inValue varchar(50), inLogin varchar(50))

    Then I pass the edit value into inValue parameter.
    select 'dbr.editable', 'Email', 'sp_DBR_update_Index', 'inID=ID', 'inCol="abc", 'inValue=Email';

    Then inLogin also retrieve Email instead of current user.

    Another problem when I use is dbr.editable always requires parameter even it's optional. If I remove the inCol="abc", also set inCol parameter is optional but the main report can not make it editable and show and error about required inCol parameter. I must set it to another random value to avoid that.

  2. myDBR Team, Key Master

    the editable value is always the last parameter and it will be automatically added. So no need to add it to dbr.editable. Also, the automatic parameter (as the name says) is automatic, so you do not need to add it either.

    In your sp_DBR_update_Index-procedure, the last value is inLogin, which is probably not the editable value and as it is the last one, it will get the edited value.

    So, if your sp_DBR_update_Index updates the inValue with key inID the procedure definition should look something like this:

    CREATE PROCEDURE sp_DBR_update_Index(
    inID int,
    inLogin varchar(50),
    inValue varchar(50)
    begin update mytable
    set value = inValue, user_updating = inLogin
    where id = inID; end;

    and your dbr.editable call should simply look like:

    select 'dbr.editable', 'Email', 'sp_DBR_update_Index', 'inID=ID';

    There is no support for optional parameters in dbr.editable as you just pass the key and the edited value which are needed to do the update. You can pass additional columns if you like, but you must define a value for them (value from result set, from parameter or a constant).

    myDBR Team


You must log in to post.