MySQL Forums
Forum List  »  Perl

Binding OUT variables in Perl
Posted by: jphekman
Date: May 16, 2006 09:23AM

So far as I can tell, DBD::mysql does not support binding OUT parameters. I'm hoping you guys can help me with a workaround.

I'm doing an Oracle->mySQL conversion. I have some complex stored functions which return values from tables. Now, MySQL doesn't currently support functions querying tables at all, so I tried changing these functions to stored procedures, with the idea that the return values would be put into OUT variables. This works in the mysql command line just fine, but then I tried to get it working in Perl. Turns out Perl doesn't yet support binding these variables. (In DBD::oracle it's something like bind_param_out()).

I also tried a workaround where I put the return value into the primary key of another table, with the idea that LAST_INSERT_ID() would then return it, but turns out that doesn't work, since it's not an autoincremented ID and as a result LAST_INSERT_ID() doesn't save it.

I also considered putting the return value somewhere and querying that table for it, but then of course you have concurrency issues.

Help! Any ideas for me? Thanks!

Jessica

Options: ReplyQuote


Subject
Written By
Posted
Binding OUT variables in Perl
May 16, 2006 09:23AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.