Results 1 to 8 of 8

Thread: Sprocs??????

  1. #1
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322

    Unanswered: 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.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    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
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    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

  4. #4
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    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.

  5. #5
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    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
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  6. #6
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    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

  7. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    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 on the Tiger 800 or the Norton

  8. #8
    Join Date
    Mar 2007
    Location
    636f6d7075746572
    Posts
    770
    If you want a development environment on your pc then google XAMPP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •