Hi Everyone,
I have a CODE field in my database which is of datatype NUMBER. I created a parameter of type VARCHAR2 as user can either enter number or text to get values within a range.
I tried two things but I get error for both. I did the parameter comparison in my oracle stored procedure itself and it looks like this
When I run my report and enter number 5 I get the results. But if I enter UN or SC I get an error that says
"Failed to retrieve data from database - Database Connection Error: 'ORA-01722:invalid number"
Then I tried to do the same comparison in Record Selection. This is what I have for that
I get an error in this formula that says "A number is required here" and it highlights {?CODE}.
I am totally confused as to how to accept String and number for a parameter and compare it to a number field in the database. I am using Crystal XI and Oracle 10g.
Thanks!
I have a CODE field in my database which is of datatype NUMBER. I created a parameter of type VARCHAR2 as user can either enter number or text to get values within a range.
Code:
pCODE IN VARCHAR2;
I tried two things but I get error for both. I did the parameter comparison in my oracle stored procedure itself and it looks like this
Code:
(C.CODE = pCODE OR pCODE IS NULL) OR
(pCODE = 'UN' AND (C.CODE) > 10) OR
(pCODE = 'SC' AND (C.CODE) BETWEEN 1 AND 10)
When I run my report and enter number 5 I get the results. But if I enter UN or SC I get an error that says
"Failed to retrieve data from database - Database Connection Error: 'ORA-01722:invalid number"
Then I tried to do the same comparison in Record Selection. This is what I have for that
Code:
({C.CODE} = {?CODE} OR {?CODE} = '') OR
({?CODE} = "UN" AND {C.CODE} > "79") OR
({?CODE} = "SC" AND {C.CODE} IN "60" TO "69")
I get an error in this formula that says "A number is required here" and it highlights {?CODE}.
I am totally confused as to how to accept String and number for a parameter and compare it to a number field in the database. I am using Crystal XI and Oracle 10g.
Thanks!