Default Value Parameter Queries

(5 posts) (2 voices)
  1. astroshark, Member

    I am creating an editable report with an update-set-where sql statement, but when a user clicks on an edit button and it pops up the edit report I want the current values of the row the user selected when they click the edit button. I created the default value parameter query without the where clause, but it will only show the data from the very first row no matter what the user clicks. Is there a way I can set the 'ID' variable in the where clause of a default value parameter query? Everytime I do set a variable in the where clause it gives me an error:

    DB error (1054): Unknown column 'vKey' in 'where clause'
    SQL: select xxxx from xxxx where xxx = vKey

  2. myDBR Team, Key Master

    myDBR will by default show the same value user has clicked on. There is no need to set the default value.

    Can you show the dbr.editable code you are using? What is the editable type you are using?

    --
    myDBR Team

  3. astroshark, Member

    Oh because when a user clicks on the button it doesn't display any value. I use the dbr.report command to bring up the update report code, and would like all the data to be prefilled when the box pops up.

    SELECT 'dbr.report', 'sp_DBR_edit_report_request', '[edit]', 'hiddendiv', 'vKey=u', 'event=click';

    And in my edit report the command is as follows

    update table
    set column = variable
    where id = vKey

  4. myDBR Team, Key Master

    OK,
    when you use dbr.report (as opposed to dbr.editable), you can pass the values user can edit using '<=' notation:

    SELECT 'dbr.report', 'sp_DBR_edit_report_request', '[edit]', 'hiddendiv[]', 'in_id=id', 'in_usereditable<=data','event=click';
    
    SELECT 1 as 'id', 'data to be edited' as 'data', 'edit';

    When user clicks the 'edit'-column, the sp_DBR_edit_report_request-report will get two parameters: value from id-column which user cannot change and the value of data-column which will be shown in the parameter screen pre-filled with the data.

    The dbr.report can be used for editing if you plan to edit multiple columns at once (as record), if you want to edit a single column, the in-place editing with dbr.editable is far more straightforward for the end user.

    --
    myDBR Team

  5. astroshark, Member

    Awesome that worked thank you so much!


Reply

You must log in to post.