Solved

SSRS unnamed parameters error

Posted on 2009-07-09
5
1,572 Views
Last Modified: 2013-12-06
I am working on a report in SSRS using ISeries data. I can run the query below using unnamed parameters inside the Query Designer but when i preview my report I'm getting the following error (see attachment). If I change the query to use hard coded values instead of parameters it runs fine. Is it an ODBC driver problem? My data I'm trying to send doesn't look too big and I wouldn't think it would run in Query Designer if that was truely an issue.



SELECT   *  FROM         DATADN.EXPENSE

WHERE     (PEMP = ?) AND (PVDATE = ?)

Open in new window

param-error.docx
0
Comment
Question by:farminsure
  • 2
  • 2
5 Comments
 
LVL 4

Expert Comment

by:LewisPower
ID: 24823718
Hi farminsure,

The unnamed parameters must have a value prior to run the SQL command. Are you sure these parameters have a value ? This sound to be more your problem in my mind than beeing and OBCD issue.

Just remind that your saying it work if it's hard coded value. Usually, ODBC always work or never work... Not alternatively...

Lewis
0
 

Author Comment

by:farminsure
ID: 24824037
I have default values set for all 4 of my parameters. When I preview, the parameters are getting filled in correctly and then the error appears. See attached.

param-error-2.docx
0
 
LVL 34

Accepted Solution

by:
Gary Patterson earned 500 total points
ID: 24824880
This is usually a field size issue.  Make sure the field sizes in your program (especially the four parameter fields) match the database field sizes.  Running an ODBC trace (configure that on the ODBC DSN) might help isolate the problem field.

If you need more help, post the ODBC trace, plus the EXPENSE table layout, including field types and lengths (DSPFFD on the AS/400 output would be great).

- Gary Patterson
0
 

Author Closing Comment

by:farminsure
ID: 31601820
The default value in one of my parameters was 6 chars long and the database field is only 5 chars. Thanks for your help!
0
 
LVL 34

Expert Comment

by:Gary Patterson
ID: 24825478
Happy to help.

- Gary Patterson
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by Valentino Vranken. Introduction: The first step of creating a SQL Server Reporting Services (SSRS) report involves setting up a connection to the data source and programming a dataset to retrieve data from that data source.  The data…
Just about everyone has an old PC laying around.  Ask anyone in the IT industry, whether they are a professional or play in it as a hobby.  From outdated Desktops to cheap "throwaway" laptops, they are all around and not as hard to "fix up" as you m…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now