views:

24

answers:

1

I'm porting some stored procedures from Informix to MySQL, but I have two stored procedures on Informix that have same name and different parameters.

In MySQL, I can't create two SP with the same name, and also can't create a SP with default values in parameters.

so, do someone out there know any hackery or black magic that may help me solve this problem?

thanks.

+1  A: 

We had the same problem porting a number crunching app from informix to mysql.

The problem was 'solved' by adding the parameter count to the procedure name...

INFORMIX                     MySQL
-------------------------    ---------------------------
min(int a, int b)         => min2(int a, int b)
min(int a, int b, int c)  => min3(int a, int b, int c)

This worked because the calling application (Perl Scripts) always knew exactly how many parameters there were ..

lexu
I was trying to avoid to have to change code in .net (where I call the stored procedures). If I can't find a way I guess I have no choice.
sergiogx
I know what you are talking about .. my thinking exactly... but we had to 'find' a solution..
lexu