•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 375,201 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 2,254 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:
Views: 1404 | Replies: 17
![]() |
•
•
Join Date: Aug 2007
Posts: 141
Reputation:
Rep Power: 0
Solved Threads: 0
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
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.
•
•
Join Date: Aug 2007
Posts: 141
Reputation:
Rep Power: 0
Solved Threads: 0
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:
sql Syntax (Toggle Plain Text)
CREATE PROCEDURE procedure1 /* name */ (IN parameter1 INTEGER) /* parameters */ BEGIN /* start of block */ DECLARE variable1 CHAR(10); /* variables */ IF parameter1 = 17 THEN /* start of IF */ SET variable1 = 'birds'; /* assignment */ ELSE SET variable1 = 'beasts'; /* assignment */ END IF; /* end of IF */ INSERT INTO table1 VALUES (variable1);/* statement */ END /* end of block */
Last edited by peter_budo : Jun 4th, 2008 at 3:00 am. Reason: Keep It Organized - please use [code] tags
•
•
Join Date: Dec 2004
Location: London or Slovakia
Posts: 1,924
Reputation:
Rep Power: 9
Solved Threads: 221
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.
Publilius Syrus
(~100 BC)
If we helped you to solve your problem, answered your question please mark your post as SOLVED.
•
•
Join Date: Apr 2008
Posts: 290
Reputation:
Rep Power: 1
Solved Threads: 39
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
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
•
•
•
•
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:
sql Syntax (Toggle Plain Text)
CREATE PROCEDURE procedure1 /* name */ (IN parameter1 INTEGER) /* parameters */ BEGIN /* start of block */ DECLARE variable1 CHAR(10); /* variables */ IF parameter1 = 17 THEN /* start of IF */ SET variable1 = 'birds'; /* assignment */ ELSE SET variable1 = 'beasts'; /* assignment */ END IF; /* end of IF */ INSERT INTO table1 VALUES (variable1);/* statement */ END /* end of block */
•
•
Join Date: Aug 2007
Posts: 141
Reputation:
Rep Power: 0
Solved Threads: 0
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
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
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb MySQL Marketplace
Other Threads in the MySQL Forum
- Previous Thread: traveldb script
- Next Thread: postgreSQL downloafِ



Linear Mode