User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 429,741 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,067 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 1736 | Replies: 17
Reply
Join Date: Aug 2007
Posts: 167
Reputation: tanha is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
tanha tanha is offline Offline
Junior Poster

Re: UDF in MySQL

  #11  
May 11th, 2008
Thanks again for the replying and nice saying...
Reply With Quote  
Join Date: Aug 2007
Posts: 167
Reputation: tanha is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
tanha tanha is offline Offline
Junior Poster

Re: UDF in MySQL

  #12  
May 14th, 2008
Hi tesuji,
Hope doing fine, I tried much, but still I am lost how to write UDF for MySQL, I don't like to write complex function now, I need just one sample example written in C/C++, and then use that in MySQL working...

I need this example and guide as my start point...

Therefore kindly request you, if possible post here a sample UDF written in C, and then the steps how to use of that in MySQL...
That would be very kind of you...
Thanks
Last edited by tanha : May 14th, 2008 at 1:15 pm.
Reply With Quote  
Join Date: Aug 2007
Posts: 167
Reputation: tanha is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
tanha tanha is offline Offline
Junior Poster

Re: UDF in MySQL

  #13  
May 28th, 2008
Hi, Hi, Hiiiiiiiiiiiiiiiiiiiiiiii everyone,

to be honest I studied much, but still I dont know how to create UDF in MySQL, so there should be some one did this for him/her self, plz any idea ???
Reply With Quote  
Join Date: Aug 2007
Posts: 167
Reputation: tanha is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
tanha tanha is offline Offline
Junior Poster

Re: UDF in MySQL

  #14  
May 29th, 2008
Just I need a simple UDF in MySQL something like uppercase firstletter ...
Reply With Quote  
Join Date: Aug 2007
Posts: 167
Reputation: tanha is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
tanha tanha is offline Offline
Junior Poster

Re: UDF in MySQL

  #15  
Jun 3rd, 2008
Although this post is viewed by more than 800 persons, still not solved. As I mentioned I am using WAMP package, whuch has mysql verion 5.0.4 and also PhpMyAdmin and I dont know what is wrong with the following procedure:

  1. CREATE PROCEDURE procedure1 /* name */
  2. (IN parameter1 INTEGER) /* parameters */
  3. BEGIN /* start of block */
  4. DECLARE variable1 CHAR(10); /* variables */
  5. IF parameter1 = 17 THEN /* start of IF */
  6. SET variable1 = 'birds'; /* assignment */
  7. ELSE
  8. SET variable1 = 'beasts'; /* assignment */
  9. END IF; /* end of IF */
  10. INSERT INTO table1 VALUES (variable1);/* statement */
  11. END /* end of block */
Last edited by peter_budo : Jun 4th, 2008 at 3:00 am. Reason: Keep It Organized - please use [code] tags
Reply With Quote  
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,475
Reputation: peter_budo is a jewel in the rough peter_budo is a jewel in the rough peter_budo is a jewel in the rough peter_budo is a jewel in the rough 
Rep Power: 11
Solved Threads: 298
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: UDF in MySQL

  #16  
Jun 4th, 2008
Originally Posted by tanha View Post
Although this post is viewed by more than 800 persons, still not solved.

Any idea how many people of this 800 are actually daniweb members? Or how many come accross this post by google search? You do not know, neither me...
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Reply With Quote  
Join Date: Apr 2008
Posts: 295
Reputation: tesuji is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 41
tesuji tesuji is offline Offline
Posting Whiz in Training

Re: UDF in MySQL

  #17  
Jun 4th, 2008
Hi tanha,

till this day you have been asking for UDF sample. Now you post stored procedure. I HOPE you have not mistaken UDF for stored procedure. As for UDFs, I have sent you some information how such thinks can be done with MySQL, and as you may have seen it's really a heavy job there as compared to standard SQL 1999 UDF's where it s absolutely simple. You have got such a SQL1999 sample from me. Back to your stored procedure, I believe it's also a good idea to tell us the respective error message you might have received when trying to execute this procedure.

krs,
tesu

Originally Posted by tanha View Post
Although this post is viewed by more than 800 persons, still not solved. As I mentioned I am using WAMP package, whuch has mysql verion 5.0.4 and also PhpMyAdmin and I dont know what is wrong with the following procedure:

  1. CREATE PROCEDURE procedure1 /* name */
  2. (IN parameter1 INTEGER) /* parameters */
  3. BEGIN /* start of block */
  4. DECLARE variable1 CHAR(10); /* variables */
  5. IF parameter1 = 17 THEN /* start of IF */
  6. SET variable1 = 'birds'; /* assignment */
  7. ELSE
  8. SET variable1 = 'beasts'; /* assignment */
  9. END IF; /* end of IF */
  10. INSERT INTO table1 VALUES (variable1);/* statement */
  11. END /* end of block */
Reply With Quote  
Join Date: Aug 2007
Posts: 167
Reputation: tanha is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
tanha tanha is offline Offline
Junior Poster

Re: UDF in MySQL

  #18  
Jun 5th, 2008
Yes, you are right that it is not that what I wanted ... and I tried much to know writing a sample UDF in C/C++ and then implement it in MySQL, but I could not....

about the procedure problem, I dont know how tell MySQL that those semicolons ';' are not separate statements, but MySQL consider each line which terminate with semicolons as separate statement and execute it, this cause the error ...

NOTE:
if again, possible to help me writing UDF in C/C++ , that would be very kind of u

Thanks
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MySQL Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the MySQL Forum

All times are GMT -4. The time now is 3:05 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC