No parameters available error

(11 posts) (2 voices)

Tags:

No tags yet.

  1. SteveD, Member

    I have a somewhat confusing error that has suddenly appears after we migrated our database from SQL Server 2005 to SQL Server 2008 (although I can't think how it could be related to this).

    I have a report that uses a total of eleven parameters, the first 3 of which are hidden from the user.

    Parameter 4 is a popup box which uses the value of parameter 2 to populate itself, the code for this routine is as follows:
    CREATE PROCEDURE sp_DBR_puLocations @mydbr_param2 int, @inLogin varchar(30) AS BEGIN declare @SQL varchar(max) declare @DB varchar(50) SET @DB = (select vUDB from mydbr..bmslookup where vUName = @inLogin) SET @SQL = @DB + 'qselStorageLocationsByWarehouse ' + cast(@mydbr_param2 as varchar)

    CREATE TABLE #tmp( LocationID int NOT NULL, Location varchar(50) NOT NULL, LocationAbbreviation varchar(max) NOT NULL ) insert into #tmp execute (@SQL) select LocationID, Location from #tmp drop table #tmp

    END

    Parameter 5 is another popup box, and this one is populated dependent on the users selection for parameter 4, the code for this is as follows:
    CREATE PROCEDURE sp_DBR_puBins @mydbr_param4 int, @inLogin varchar(30) AS BEGIN declare @SQL varchar(200) declare @DB varchar(50) SET @DB = (select vUDB from mydbr..bmslookup where vUName = @inLogin) SET @SQL = 'SELECT BinID, Bin FROM ' + @DB + 'tblBin WHERE Active = 1 AND StorageLocationID = ' + cast(@mydbr_param4 as varchar) execute (@SQL) END
    This code however fails. Instead of the user being presented with a popup box there is instead just a statement saying No parameters available.

    As stated initially, this worked perfectly when we were on SQL Server 2005, but since the move to SQL Server 2008 it no longer does, and I can't see any reason why it wouldn't.

    Thanks in advance.

  2. myDBR Team, Key Master

    Not likely that the move from the SQL Server 2005 to SQL Server 2008 has caused this.

    You did not say if the problem comes directly when report is run or after user has changed any of the parameters.

    Make sure that you have the latest build and log what parameters are passed to parameters. That should give you better idea what is going on.

    --
    myDBR Team

  3. SteveD, Member

    Not likely that the move from the SQL Server 2005 to SQL Server 2008 has caused this.

    I agree, and yet it did!

    You did not say if the problem comes directly when report is run or after user has changed any of the parameters.

    Both, it is there when the report first loads, and changing param 4 doesn't resolve the issue.

    Make sure that you have the latest build and log what parameters are passed to parameters. That should give you better idea what is going on.

    Does myDBR have a logging feature?

    I am on the latest build myDBR build btw.

  4. myDBR Team, Key Master

    Does myDBR have a logging feature?

    You can use a log table of your own and insert the parameter value to it inside the parameter procedure.

    --
    myDBR Team

  5. SteveD, Member

    I have sort of gotten to the bottom of this, the report which contains a total of 10 parameters is called and only passed 2, so when I try to reference parameter 3 the report errors because param 3 wasn't passed.

    The problem is that param 3 is from a popup list containing a list of options that the user must choose from. If I call the report and pass a third parameter then that popup list is no longer displayed on the report (and the user hence can't change it).

    I need param4 on the report to reference param3, but I don't want to pass a value to param3, or if I do I still need the report to display it to allow the user to overwrite the passed value.

  6. myDBR Team, Key Master

    Steve,
    A parameter that is passed with a report call, can be user editable as well.

    When you use notation 'my_param=myref', the my_param parameter is fixed and cannot be changed by the user. If you however use notation 'my_param<=myref', the my_param will be visible and can be edited by the user.

    --
    myDBR Team

  7. SteveD, Member

    Oh FFS this is getting really annoying now!!!!!!!

    So, when I pass the third parameter using the = method
    select 'dbr.report', 'sp_DBR_Add_Location', 'popup', 'iWare=[war]', 'iItemID=[iid]', 'iLocation=[iLID]';
    then I have the situation where my fourth parameters function
    CREATE PROCEDURE sp_DBR_BinsLookup @iLocation int, @inLogin varchar(30)
    a popup whose list of options depends on the third parameter (@iLocation) displays fine, but the popup for the third parameter is hidden from the report.

    If I amend the report to pass the third parameter using the <= method like so
    select 'dbr.report', 'sp_DBR_Add_Location', 'popup', 'iWare=[war]', 'iItemID=[iid]', 'iLocation<=[iLID]';
    The the third parameter now displays OK, but the fourth parameter instead of displaying the drop down list is back to not displaying a drop down list and instead just displays the message No parameters available.

  8. SteveD, Member

    Just as an FYI, I have checked that param3 is working correctly, if I pass 36 as iLocation when calling the report then the popup for param3 displays "ADWICK PARK" and if I pass 39 then it displays "BRICKWORKS" which are both correct as the popup for param3 is just
    select LocationID, Location from tblLocations
    In tblLocations LocationID 36 corresponds to the Location "ADWICK PARK" and LocationID 39 corresponds to the Location "BRICKWORK", so param3 is passing correctly.

    It is just when the procedure for populating param4 tries to access the third parameter (either by name, by absolute location mydbr_param3 or by relative location mydbr_param_prev1) that param4 returns No parameters available.

    I have even changed the popup for param3 to
    select LocationID, LocationID from tblLocations
    and ammended the procedure for param4 to take a varchar variable incase it was picking up on the text displayed rather than the actual value, but the error is the same.

  9. myDBR Team, Key Master

    It should be now fully fixed. You can run the updater to get the latest build.

    Thank you for reporting the issue.

    --
    myDBR Team

  10. SteveD, Member

    Updated to latest build, no change however. Regardless of how param4 tries to reference param3 (by name, mydbr_param3, mydbr_param_prev1) I still get the No parameters available message.

  11. myDBR Team, Key Master

    Steve,
    in order to clear this out could you please create a package which contains all the relevant info for us to duplicate the environment. This way it is easier for us to see what might be causing your problems.

    1) Source codes for all the procedures involved (including parameter queries)
    2) Screenshots of the report parameter settings
    3) Screenshots of the parameter query definitions
    4) "Output as SQL" output for the report that includes the 'dbr.report', 'sp_DBR_Add_Location'

    Please send the package to suppot email.
    --
    myDBR Team


Reply

You must log in to post.