Setting Default values for a checkbox input from a table

(3 posts) (2 voices)
  1. wattsm, Member

    I have a checkbox parameter input which draws values from a table:

    SELECT factor, description FROM db_wh_repo.wh_bs3_factors ORDER BY id;

    Which returns results like:

    'Avg_Post_Project_Rating','Average Post Project Rating (over all 8 criteria)'
    'Pitches_Won','SP has been selected in the past'
    ...

    And I would like to set some defaults to this so I created a default parameter query:

    SELECT 'Avg_Post_Project_Rating';

    But this does not seem to work, am I missing something here?

    Thanks,
    Martin

  2. myDBR Team, Key Master

    A default for a string parameter is a comma separated list of strings. Now that you just set one default, you just need to return a string, but you need to enclose it in quotation marks.

    So with single default you do:

    select '"Avg_Post_Project_Rating"';

    If you would set two defaults, you would use:

    select '"Avg_Post_Project_Rating","Pitches_Won"';

    --
    myDBR Team

  3. wattsm, Member

    Ah - of course, thank you for the quick response.

    Note - I had to use double quotes for the whole list and single quotes to separate each term like this:

    SELECT "'Avg_Post_Project_Rating','Swap_Outs','Average_Pitch_Rating','Blur_History','Credit_Check'";

    Works like a charm, thanks.


Reply

You must log in to post.