O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

Stored Procedures in MySQL

3.880 visualizações

Publicada em

  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m77EgH } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m77EgH } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • If you want to download or read this book, Copy link or url below in the New tab ......................................................................................................................... DOWNLOAD FULL PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... .........................................................................................................................
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • If you want to download or read this book, copy link or url below in the New tab ......................................................................................................................... DOWNLOAD FULL PDF EBOOK here { http://bit.ly/2m6jJ5M } .........................................................................................................................
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • ..............ACCESS that WEBSITE Over for All Ebooks ................ ......................................................................................................................... DOWNLOAD FULL PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } .........................................................................................................................
       Responder 
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui
  • Seja a primeira pessoa a gostar disto

Stored Procedures in MySQL

  1. 1. Stored Procedures in MySQLMichele Catalano I 06.10.2011 © Mayflower GmbH 2011
  2. 2. CREATE PROCEDUREI CREATE PROCEDURE name ([IN|OUT|INOUT] varname type …) Variablen definition DEFINER Manuelles definieren des Besitzers der Prozedur (default Ersteller) DETERMINISTIC Bei identischen Input gleicher Output. CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA Definiert der Sprache bzw. ob Daten nur gelesen oder auch manipuliert werden. SQL SECURITY (DEFINER | INVOKER ) Definiert mit welchen Rechten die Prozedur ausgeführt wird. BEGIN … END Block mit der eigentlichen ProzedurI delimiter Mayflower GmbH I 2
  3. 3. Grundlagen Flow ControlI IF .. ELSEIF … ELSE … ENDIFI CASE … (WHEN … THEN) … ELSE … END CASEI label: LOOP … END LOOPI [label:] REPEAT … UNTIL … END REPEATI [label:] WHILE … DO … END WHILE [label]I LEAVE labelI INTERATE label Mayflower GmbH I 3
  4. 4. DECLARE HandlerI DECLARE HANDLER TYPE CONTINUE Weiter ausführen des Codes im BEGIN...END Block EXIT Abbrechen der Ausführung des Codes im BEGIN...END Block CONDITION SQLSTATE sqlstate_value Abfangen eines bestimmten SQLSTATE Wert SQLWARNING Abfangen alle SQLSTATS die mit 01 beginnen NOT FOUND Abfangen alle SQLSTATS die mit 02 beginnen SQLEXCEPTION Abfangen alle SQLSTATS die mit 00, 01 und 02 beginnen Mayflower GmbH I 4
  5. 5. DECLARE VariablenI DECLARE VARIABLE var_name, [var_name]... type [DEFAULT value]I var_name ist alphanumerischI type ist ein valider SQL Feld Type (z.B. CHAR, VARCHAR)I value ist der Standard Wert welche der variable beim deklarieren zugewiesen wird. Mayflower GmbH I 5
  6. 6. GRUNDLAGEN CURSORI DECLARE name CURSOR FOR sqlstatement Deklarieren des CURSORS für denn SQL BefehlI OPEN name Öffnen des CURSORSI FETCH name INTO Iterieren über die Ergebnisse des CURSORS Um das Ende der Daten zu erkennen muss unbedingt ein HANDLER für NOT FOUND definiert werden.I CLOSE name Schließen des CURSORS Mayflower GmbH I 6
  7. 7. RECHTEI CREATE PROCEDUREI ALTER PROCEDUREI DROP PROCEDUREI CALL Ohne diese Recht kann keine Prozedur ausgeführt werden!!I Wenn die Prozedur mit SQL SECURITY INVOKER erstellt wurde muss der Caller auch alle rechte für die in der Prozedur verwendeten SQL Statements haben! Mayflower GmbH I 7
  8. 8. VorteileI Sehr Mächtige DatenmanipulationsmöglichkeitI Interessante Möglichkeit zusammen mit TriggerI Gut nutzbar für komplexes ReportingI Einfaches Hilfswerkzeug für Datenbank redesignI Abfragen von Daten für die der Caller nicht direkt die Rechte hat. Mayflower GmbH I 8
  9. 9. NachteileI Einbindung in ein Continues Integrations Umgebung nicht gegeben.I Testbarkeit eigentlich nicht vorhandenI Kein DebuggingI Mischung von Daten und LogikI Schlecht ein schätzbare Last auf Datenbankservern für Performance TunningI Unsicherheit im zusammenspiele mit Master/Slave bin logI Ein Caller kann durch die Prozedur auch auf Daten für die er keine Zugriffsrechte hat zugreifen. Mayflower GmbH I 9
  10. 10. QuellenverweiseI MySQL Manual: http://dev.mysql.com/doc/refman/5.1/en/stored-programs-defining.html http://dev.mysql.com/doc/refman/5.1/en/sql-syntax-compound-statements.html http://dev.mysql.com/doc/refman/5.1/en/stored-programs-logging.html http://dev.mysql.com/doc/refman/5.1/en/stored-programs-security.html http://dev.mysql.com/doc/refman/5.1/en/call.html http://dev.mysql.com/doc/refman/5.1/en/stored-routines-privileges.html http://dev.mysql.com/doc/refman/5.1/en/stored-program-restrictions.html Mayflower GmbH I 10
  11. 11. Vielen Dank für Ihre Aufmerksamkeit! Referent Michele Catalano michele.catalano@mayflower.de +49 89 242054 1 12 1 Mayflower GmbH Mannhardtstrasse 6 80538 München25.10.2011 Mayflower GmbH 11

×