If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Sprocs??????

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-19-07, 15:03
Brett Kaiser Brett Kaiser is offline
Window Washer
 
Join Date: Nov 2002
Location: Jersey
Posts: 10,303
Sprocs??????

Does mySQL have them?

got a sample syntax?
__________________
Brett
8-)

It's a Great Day for America everybody!

dbforums Yak CorralRadio 'Rita
dbForums Member List
I'm Good Once as I ever was

The physical order of data in a database has no meaning.
Reply With Quote
  #2 (permalink)  
Old 09-19-07, 15:33
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
avast, ye lazy landlubber, have ye no internet connection? can ye not reach the mysql.com site?

here ye go, ye flea-bitten scurvy knave...

http://dev.mysql.com/doc/refman/5.0/...rocedures.html
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 09-19-07, 15:35
mike_bike_kite mike_bike_kite is offline
vaguely human
 
Join Date: Jun 2007
Location: London
Posts: 2,519
Yes - from version 5 upwards.

Procedures look like this :
Code:
drop procedure if exists db_log_action;
$

create procedure db_log_action(
        IN      in_user_id      int,
        IN      in_logType      varchar( 20 ),
        IN      in_logMsg       varchar( 200 )
)
begin
        if in_logType != 'test' and in_logMsg != 'Searching for logs' then
                insert  db_Log ( id, logType, updTime, msgTxt )
                values ( in_user_id, ifnull(in_logType,'error'),
                        now(),ifnull( in_logMsg,'EMPTY') );
        end if;
end
$
Functions work well too:
Code:
drop function if exists db_return_hello
$

create function db_return_hello(
        in_name          varchar(250) ) returns varchar(250)
begin
        declare v_str   varchar(250);

        set v_str = concat( 'Hello ', in_name );

        return v_str;
end;
$
Mike
Reply With Quote
  #4 (permalink)  
Old 09-20-07, 10:42
Brett Kaiser Brett Kaiser is offline
Window Washer
 
Join Date: Nov 2002
Location: Jersey
Posts: 10,303
Thanks guys

I'll go look at the link Rudy, but where can mySQL be installed?

Does it need a server?
__________________
Brett
8-)

It's a Great Day for America everybody!

dbforums Yak CorralRadio 'Rita
dbForums Member List
I'm Good Once as I ever was

The physical order of data in a database has no meaning.
Reply With Quote
  #5 (permalink)  
Old 09-20-07, 10:51
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
if you are developing, i would recommend installing it on your C drive

i managed to do it, and it was dead easy

but please don't ask me for particulars, i am ~so~ not a DBA
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #6 (permalink)  
Old 09-20-07, 14:44
mike_bike_kite mike_bike_kite is offline
vaguely human
 
Join Date: Jun 2007
Location: London
Posts: 2,519
If you have a server or web space on a server then you'll probably find it already has mysql. There usually an admin page to turn it on and set an admin password.

It's not diffiicult to put on your own PC but then it's more of a game writing web apps (assuming that's what you want to do) if the db's on your PC. You can pull the exe from their site.

Good luck

Mike
Reply With Quote
  #7 (permalink)  
Old 09-21-07, 04:21
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,262
if you are planning unsing MySQL one thing to bear in mind is the MySQL does have one really really annoying feature... the Windows variant, like most Microsoft applications is case insensitive, whereas the other versions are case sensitive..

so you can develop an app happily on a MS hosted MySQL server, and find it passes all manner of testing.. but you come to grief on a Linux or other server, becaue of CaPiTaLiSaTiOn
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #8 (permalink)  
Old 09-27-07, 10:01
aschk aschk is offline
Registered User
 
Join Date: Mar 2007
Location: 636f6d7075746572
Posts: 770
If you want a development environment on your pc then google XAMPP
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On