Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Powerbuilder calls Oracle Package function of des3decrypt.

Status
Not open for further replies.

nepoh

Programmer
Sep 30, 2009
5
AU
Hi,
We have an existing oracle package function to decrypt password. The function name is decrypstring which used the dbms_obfuscation_toolkit. My problem occur when I tried to access the function in Powerbuilder.

I created global external function in Powerbuilder as follows:

public long function decryptstring(string input_str, ref string output_str, ref string sqlmsg) RPCFUNC ALIAS for "packagename.decryptstring"


I invoke the function by:
long ll_rtn
string ls_output
string ls_msg
string ls_input

ls_output = space(500)
ls_msg = space(500)
ls_input = 'inputword'

ll_rtn = SQLCA.decryptstring(ls_input, ls_output, ls_msg)

....


When I tried to save the code in PB, I got an error msg "unknown function name."

Not quite sure where I miss something. Or is there any other way where I can invoke the package function with return value?

Can anybody please help? Thanks.


Nepoh
 
From the PB Help:

RPC declarations are always associated with a transaction object. You declare them as local external functions. The Declare Local External Functions dialog box has a Procedures button (if the connected database supports stored procedures), which gives you access to a list of stored procedures in the database.

Where you able to see the item in the list ?

Matt

"Nature forges everything on the anvil of time
 
Hi Matt,

Thanks for the information. I missed the part where I need to associate the external function to the transaction object. All is goo now. Thanks to you.

Nepoh
 
Hi Matt,

Are you able to help me... the mentioned external function I've got in Powerbuilder that calls oracle function of des3decrypt of dbms_obfuscation_toolkit, is giving me a wrong output. Although the des3encrypt is working fine but the des3decrypt is not. Do you know any issues that causing problem in powerbuilder with regards to dbms_obfuscation_toolkit?

thanks.

Nepoh
 
I noticed that there was a thread with similar question with me but it's already closed. thread144-1142055. Can I possibly re-open the issue? Thanks.
 
I am not familiar with that toolkit. Recheck the paramaters you send to the method (type, size, etc.). Is there a way in Oracle to trace the function call to see what is being passed back and forth?

Matt

"Nature forges everything on the anvil of time
 
Hi Matt,

Thanks for your reply. The decrypt/encrypt function in oracle is an existing one. it's working fine when called in oracle forms. but if invoke in powerbuilder, the result is different.

I will try to recreate the function and try to check the value it generated especially the hextoraw convertion. Hopefully I will be able to trace the issue.

Thanks. Hopefully I can find the answer to the problem I've got.

Nepoh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top