Passign a generated varable to another report.

(2 posts) (2 voices)

Tags:

No tags yet.

  1. hubcarter, Member

    Am I able to pass a declared variable to another report and if so what is the format? (reason for my asking is my logic is currently failing...).

    I am attempting to pass a declared variable but the linked Procedure, after loading, gives error: Could not execute the report. There was an error in the report. Data too long for column 'vType' at row 1

    Main Stored Procedure:

    CREATE PROCEDURE sp_DBR_ICM()
    BEGIN
    DECLARE vItype varchar(20);
    IF vClass=99 THEN
    SET vItype='REGRENT';
    ELSE
    SET vItype='REGSTOCK';
    END IF;
    select 'dbr.report', 'sp_DBR_IVNI','inline','vType=(vItype)';

    And the linked procedure is :
    CREATE PROCEDURE sp_DBR_IVNI(vType varchar(20))

    Malcolm C. HUB

  2. myDBR Team, Key Master

    Hi,
    myDBR works by parsing the *output* of the report procedure. What happens inside the procedure (logic, variables, querys executed) is not visible to myDBR nor is it needed. This gives myDBR reports the performance edge (no data is moved back and forth; the processing is done close to the data) and all features of the database can automatically be utilized.

    To use a variable value as a parameter to another report, just include it to the query. You can hide it if you do not want to show it to user.

    So in your case, just use:

    select 'dbr.report', 'sp_DBR_IVNI','inline','vType=vItype';
    select 'dbr.hidecolumn, 'vItype'; select ..., vItype as 'vItype'
    from ...

    --
    myDBR Team


Reply

You must log in to post.