Crystal Reports XI Check Dependencies

I have a command query in my report:

"select column_name1, column_name2 from table where column_name3 = {?P_NUMBER}"

column_name3 is a number field in my database. And the parameter P_NUMBER is a number the user enters. The parameter has no quotes around it. When I run the Report Check Dependencies I get the following error: "Data Source: Verify for table Command failed. Possible report corruption.". Now if I put quotes around this parameter I no longer get the error.

This error also occurs if the parameter is a Date parameter field. Which I can not put quotes around. So I wanted to know what the solution to getting rid of these error messages would be?

Also the report seems to be running correctly.

Thanks.
LVL 1
alayannaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PCIIainCommented:
The verify cannot pass the parameter, so when you put quotes around it it tests against the empty string (which is valid).

 Have you tried assigning a default value to the parameter? That might get ti pass something to the query and therefore not fail.
0
alayannaAuthor Commented:
That allows the query to pass the Check Dependency validation.

But if I don't want that parameter to have a default value then it is still going to fail the check. And I just don't want to chalk it up as error that should be ignored. That just doesn't seem good practice to me.
0
PCIIainCommented:
I'm afraid that is hobsons choice.
Pass the check with a default value, or live with failing the check.
(Unless you can conceive of a sql script which will not return an error if the space for the parameter value is empty. )
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

mlmccCommented:
How did you add the parameter to the command?
Is it a command or report parameter?

mlmcc
0
alayannaAuthor Commented:
mlmcc,

I added the parameter to the command during the creation of the command.
0
mlmccCommented:
SO you are showing the command?

Did you add the parameter to the SQL by selecting it?

mlmcc
0
PCIIainCommented:
Parameters in commands are pretty much done as text replacement directly in the query. Therefore, in order to avoid using defaults you have to do one of two things.

1. Write a query which will still parse correctly and return column headings when the space where the parameter goes is empty.
2. Move the parameter to the select clause of your report. This may slow down the execution of the report however, as if Crystal doesn't pass the parameter to the end query, the database will return all the data and crystal will have to filter itself, which is obviously slower.

Personally, I'd  put defaults in place which are out of bounds (i.e. a date which will never have any data), this will then parse, but if the user runs the report and doesn't fill them in then no data is returned.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
DB Reporting Tools

From novice to tech pro — start learning today.