Deks Posted September 27, 2011 Share Posted September 27, 2011 Hi, i have little problems and i believe somebody with some experience will know how to help me. I have experience with PostgreSQL but am not that good in MySQL. My problem is stored functions and procedures. Here i have PostgreSQL code for stored function and i need to make it in MySQL. Can someone help please? CREATE OR REPLACE FUNCTION country_on_continents(varchar) RETURNS SETOF varchar AS' select country.name from country join continent on continent.id_continent=country.id_continent where continent.name_continent=$1' language sql; its easy one Also can someone tell me is there some replacement for PostgreSQL -- CREATE TYPE ---so i can RETURNS SETOF <name of type>? Quote Link to comment https://forums.phpfreaks.com/topic/247974-mysql-function-and-procedure/ Share on other sites More sharing options...
mikosiko Posted September 27, 2011 Share Posted September 27, 2011 Hi, ....... its easy one this is easier http://dev.mysql.com/doc/refman/5.1/en/create-procedure.html Quote Link to comment https://forums.phpfreaks.com/topic/247974-mysql-function-and-procedure/#findComment-1273324 Share on other sites More sharing options...
Deks Posted September 27, 2011 Author Share Posted September 27, 2011 Thanks. i saw that but didnt understand some things..but now after thinking my mind is clear Quote Link to comment https://forums.phpfreaks.com/topic/247974-mysql-function-and-procedure/#findComment-1273329 Share on other sites More sharing options...
Deks Posted September 27, 2011 Author Share Posted September 27, 2011 Hi, i have one more question. Can u in procedure make that she merge 2 or more varchar variables in 1? like in php: $a= 'name'; $b= '-name2'; echo $a.$b; thanks Quote Link to comment https://forums.phpfreaks.com/topic/247974-mysql-function-and-procedure/#findComment-1273340 Share on other sites More sharing options...
Deks Posted October 8, 2011 Author Share Posted October 8, 2011 Found solution Quote Link to comment https://forums.phpfreaks.com/topic/247974-mysql-function-and-procedure/#findComment-1277262 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.