Professional Web Applications Themes

Help with Store procedure - MySQL

Hi gurus, here is a snippet of the procedure, don't know if mysql support labels as SQL Server and Oracle and i can't find more doc about error control in mysql. So if anyone can tell me more hints about this topic i would really appreciate DECLARE error_check INT DEFAULT 0; DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET error_check = 1; START TRANSACTION INSERT INTO child_table (child_id,parent_id) VALUES (1,1); <--- Constraint Error Parent Id does not exits IF error_check = 1 THEN GOTO ERROR_LABEL END IF; <-- not sure about this COMMIT; ERROR_LABEL: IF error_check = 1 THEN ROLLBACK; END IF;...

  1. #1

    Default Help with Store procedure

    Hi gurus,
    here is a snippet of the procedure, don't know if mysql support
    labels as SQL Server and Oracle and i can't find more doc about error
    control in mysql. So if anyone can tell me more hints about this topic
    i would really appreciate


    DECLARE error_check INT DEFAULT 0;
    DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET error_check = 1;


    START TRANSACTION

    INSERT INTO child_table (child_id,parent_id) VALUES (1,1); <---
    Constraint Error Parent Id does not exits
    IF error_check = 1 THEN GOTO ERROR_LABEL END IF; <-- not sure about
    this

    COMMIT;

    ERROR_LABEL:
    IF error_check = 1 THEN
    ROLLBACK;
    END IF;

    lala4life Guest

  2. #2

    Default Re: Help with Store procedure

    On 31 Jan, 12:53, "lala4life" <com> wrote: 

    The stuff that you couldn't find in the docs wouldn't be this would
    it?
    http://dev.mysql.com/doc/refman/5.1/en/conditions-and-handlers.html

    Captain Guest

  3. #3

    Default Re: Help with Store procedure

    On Jan 31, 10:15 am, "Captain Paralytic" <com>
    wrote: 





    >
    > The stuff that you couldn't find in the docs wouldn't be this would
    > it?http://dev.mysql.com/doc/refman/5.1/en/conditions-and-handlers.html[/ref]


    Is the same that i read. don't say anything about labels.

    lala4life Guest

Similar Threads

  1. Store Procedure Oracle
    By Hatichitic in forum Coldfusion Database Access
    Replies: 2
    Last Post: April 18th, 06:48 AM
  2. Return value from store procedure
    By Ken Schaefer in forum ASP
    Replies: 9
    Last Post: August 23rd, 09:58 AM
  3. Access database from store procedure
    By in forum ASP Database
    Replies: 1
    Last Post: July 21st, 11:09 AM
  4. Store Procedure plus parameter where condition..
    By Boris Condarco in forum Microsoft SQL / MS SQL Server
    Replies: 0
    Last Post: July 8th, 01:54 PM
  5. Store Procedure Help
    By Karsten Farrell in forum Oracle Server
    Replies: 3
    Last Post: January 11th, 04:53 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139