MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 21st, 2013, 09:58 PM
thuannguyen thuannguyen is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 3 thuannguyen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 52 sec
Reputation Power: 0
Pass parameter as cursor type into procedure in MySQL

Hi all,

I have a procedure that i want to pass a parameter as CURSOR type but i dont.

Ex: Create Procedure ABC(OUT p_cursor CURSOR)
Begin

End$$

Pls help me to do this.

Thanks.

Reply With Quote
  #2  
Old January 22nd, 2013, 05:08 AM
f_razzoli f_razzoli is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Location: Italy
Posts: 36 f_razzoli User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 37 m 48 sec
Reputation Power: 1
No you can't pass cursors as parameters.

What goal are you trying to achieve? Maybe I know a workaround.

Reply With Quote
  #3  
Old January 22nd, 2013, 07:10 PM
thuannguyen thuannguyen is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 3 thuannguyen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 52 sec
Reputation Power: 0
Thanks for your reply,

I just want to take some values that return over cursor and These values i'll use in my java program for purposes.

If you have any ideas or resolves, i want to know about it.

Thuan.

Reply With Quote
  #4  
Old January 23rd, 2013, 07:29 AM
f_razzoli f_razzoli is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Location: Italy
Posts: 36 f_razzoli User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 37 m 48 sec
Reputation Power: 1
Sorry, in MySQL Cursors only exist within Stored Procedure and they can't even be returned to another procedure.

I hope that this solution is acceptable:
* the procedure creates a view
* the applicazion queries that view.

Since views are always global (all users can access them), the view should have a name like:
CONCAT('my_view', CONNECTION_ID());
and you should DROP it (or use CREATE OR REPLACE VIEW).

I hope this helps.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > Pass parameter as cursor type into procedure in MySQL

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap