PL/SQL function in CR

Hi all.

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?

Regards,
Radek


radekb30 (BOB member since 2008-12-18)

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


jesibl (BOB member since 2008-11-18)

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?


ABILtd :uk: (BOB member since 2006-02-08)

Because that’s not what I’m looking for? :slight_smile:
I did it outside crystal reports, thanks for help.

Regards,
Radek


radekb30 (BOB member since 2008-12-18)

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?


BDeLong (BOB member since 2008-01-15)

Hey Radek,

How did you manage to get this to work outside of Crystal?

Ryan


ryan.shirley (BOB member since 2010-09-21)