I don’t know how to handle that kind of situation. I need to invoke PL/SQL function from oracle DB that has parameter which has to be passed as a variable.
For example:
I have PL/SQL function called “test” with one parameter and crystal’s built-in function “CurrentCEUserName” and I’d like to do something like that:
test(CurrentCEUserName)
And use a result for funther processing.
I’ve found in CR documentation that there is no possbility to pass a variable to SQL expression, is there any other solution (maybe using visual basic) for this issue?
you could instead create a stored procedure in your database which you use as your data source. crystal reports should then automatically create parameter values to match any parameter values you have defined in your stored procedure.
your stored procedure could do the call to the function
You wouldnt be able to pass the CECurrentUser or any Crystal reports value into a PLSQL function parameter list. That CECurrentUser value is generated with the report and wont have any meaning with the SQL.
If you are trying to do row level security on the data by passing a username, then why not drive it from the database login?
I haven’t had a need for it but couldn’t you do that through a sub-report? The main report could evaluate the current user and then pass that to the sub-report?