Variables in mydbr commands

(8 posts) (2 voices)

Tags:

No tags yet.

  1. john, Member

    So i am trying to link to a local file, have that part working with the complete path supplied in the command but link is the same for every row of data. Accessing link works via right click and save as.
    Here is the command that works
    [code]
    select 'dbr.url', 'file://server/path/Data/Book6.xlsx','[http]';
    [code]

    Various errors when trying to put variables from the result set into the mydbr command.
    Here are three failed attempts

    1) does concat but does not expand variables
    select 'dbr.url', concat('file://server/path/Data/', 'TimecardFilename'),'[TimeCard]';
    concats as
    "file://server/path/Data/timecardfilename"

    2) this wont save the report procedure
    [timecardfilename]

    3) Full path including schema and table. This gives error "Unknown table 'test.time1' in field list" at report run
    test.time1.TimecardFilename

    There is another location I would like to use variables from the result set in the mydbr code.

  2. myDBR Team, Key Master

    1) Adding ColumnRef to dbr.url's base URL is in the TODO and will be possible in next release. The syntax you are using does not match the dbr.url-command where the second parameter is the URL name.

    2) Did not quite understand what you are trying to do? Save what with [timecardfilename]?

    3) Can you show the code you are using? What should "test.time1.TimecardFilename" mean?

    There is another location I would like to use variables from the result set in the mydbr code.

    What do you mean by this?

    --
    myDBR Team

  3. john, Member

    I did post the wrong working code, it was missing 3 /
    This works when right clicking and choosing save as (link under icon at end of row)
    select 'dbr.url', 'file://///server/Z/Data/folder/Book6.xlsx','[link text]';

    same as above column [tfn] text is link, also works
    select 'dbr.url', 'file://///dl-pc/Z/Data/focus/Book6.xlsx','[link text]', '[tfn]';

    1.) If i can't pass values to a url like I can to a linked report in this release that is probably why i can't do it.
    WRT not matching command syntax. I looked at the command references and this is what i found, seems to match my command

    select 'dbr.url', external_url_base, 'URL name', [ColumnReference, ] [embed_target, ] [parameter_name=ColumnReference/ParameterReference, ...]

    2) I am just trying to get a link to a local file system. filename is a field in the result set and path is static.

    3) If the feature won't be available till a future release then no point in posting code right now. I think.....let me know if I am wrong.
    "test.time1.TimecardFilename"
    This is the reference to the field that has the filename
    test = schema or db
    time1 = table
    TimecardFilename = Field in table time1 with filename in it.

    4) I remember wanting to do this with a differenct feature I was trying to implement but i couldn't do it and either worked around it or it is not done. But i can't recall where that was as i moved on to building other items. Your product is great.

  4. myDBR Team, Key Master

    For 1) and 2). The next version will have the ability to add dynamic content to base URL.

    The syntax error you had was that your command:

    select 'dbr.url', concat('file://server/path/Data/', 'TimecardFilename'),'[TimeCard]';

    has ColumnReference ([TimeCard]) as the second parameter, whereas the dbr.url-command's second parameter is 'URL name'

    3) It is easier to help if you show the code you have used. The syntax "db.table.column" is perfectly valid. If you have a problem with it, please show how you are using it.

    --
    myDBR Team

  5. john, Member

    1) 2) We seem to have passed a value to Javascript in the car image example. Thoughts on having java build the link ?

    56.select v.name into v_car
    57.from car_variants v
    58.where v.manufacturer_id = inManufacturer and v.model_id = inModel and v.id=inVariant;
    59.
    60.select 'dbr.title', v_car;
    61.
    62.select 'dbr.purehtml', '<div id="car_image"></div>';
    63.select 'dbr.javascript',concat('get_first_google_image("',v_car,'")');
    64.
    65.CALL sp_DBR_doc_Source('sp_DBR_connected_parameters');
    66.
    67.END

    ----------------------
    Syntax,
    Some how we got confused, there is no issues here. my column is 'TimecardFilename'. URL to display is 'TimeCard'

    3) Sorry, here is the code, thanks for asking
    The First line works (but static link)
    The Second line Doesn't work;
    quoting with "" gives literal in concat
    quoting with [] sp_DBR wont save
    not quoting gives this error, The error text is in a pink box. The html report displays other queries on the page above this one.
    Unknown table 'test.time1' in field list

    select 'dbr.url', 'file://///server/Z/Data/Book6.xlsx','[link text]';
    select 'dbr.url', concat('file://///server/Z/Data/Book6.xlsx', test.time1.TimecardFilename),'[TimeCard]';

  6. myDBR Team, Key Master

    1) 2)
    Just wait for the next update. It will include the functionality.

    3)

    select 'dbr.url', concat('file://///server/Z/Data/Book6.xlsx', test.time1.TimecardFilename),'[TimeCard]';

    This is not valid SQL as in SQL when you query from a table:

    select TimecardFilename
    from test.time1

    or
    select test.time1.TimecardFilename
    from test.time1

    Yours is:
    select test.time1.TimecardFilename

    You are missing the from-statement.

    --
    myDBR Team

  7. john, Member

    So just checking, I recently updated not sure if this feature is available in this release?

  8. myDBR Team, Key Master

    Yes,
    see "Extending the external_url_base in dbr.url" example from documentation.

    --
    myDBR Team


Reply

You must log in to post.