Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

execute mysql procedure from Oracle

3193178May 11 2016 — edited May 12 2016

I have a procedure in mysql that encrypts a table when executed. I can do it successfully from mysql.

I need to be able to execute this from our Oracle server. We have a datalink and I am able to select from mysql successfully.

can you help me get this done?

i did this from MYSQL:

DROP PROCEDURE iwireless.encrypt_table;

DELIMITER //

CREATE procedure schema1.encrypt_table( OUT encrypted_value INT )

BEGIN

    SET SQL_SAFE_UPDATES=0;

    UPDATE schema1.zTestEncryption

        SET     

            first_name = AES_ENCRYPT(first_name, 'password'),

            encrypted = 1           

    where encrypted = 0;

    SET SQL_SAFE_UPDATES=1;

   SET encrypted_value = '1';

END; //

DELIMITER ;

CALL schema1.encrypt_table (@variable_name);

SELECT @variable_name;

@variable_name

----------------------

1

I try to do this from Oracle and i am doing it all wrong....help.

var D NUMBER(1);

Execute schema1."encrypt_table"(D)@Datalink1;

SELECT D from SYS.DUAL;

Error:

ORA-00904: "D": invalid identifier

00904. 00000 -  "%s: invalid identifier"

*Cause:   

*Action:

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 9 2016
Added on May 11 2016
7 comments
799 views