MySQL import of a stored procedure using Lazarus lazarus / 16-Databases ---------------------------------------------------------------------- malmax71 · 2018-03-13 07:46 Hello. When writing a utility for updating its software, the task is to update the database. The database contains stored procedures and functions. Accordingly, the SQL script contains constructions of the form: Code: SQL  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i DELIMITER $$CREATE FUNCTION ...BEGIN  ...  RETURN ...; END$$ I tried to use the TSQLScript component, but it gave an error to this construct. Actually the question: Is it possible to load such SQL scripts with Lasarus? ---------------------------------------------------------------------- mangakissa · 2018-03-13 12:16 You need TSQLQuery. This function returns a kind of dataset. You can also use out parameters. These will be placed into the prarams property. ---------------------------------------------------------------------- malmax71 · 2018-03-13 13:31 Quote from: mangakissa on March 13, 2018, 01:16:21 pmYou need TSQLQuery. This function returns a kind of dataset. You can also use out parameters. These will be placed into the prarams property. I don't need returns a kind of dataset. I need execute SQL script, containing many different queries. Queries type UPDATE, ALTER etc. consist 1 string ended semicolon, is not a problem. But query type CREATE FUNCTION consist many strings whith semicolons and it cause an error in components TSQLQuery or TSQLScript. ---------------------------------------------------------------------- rvk · 2018-03-13 14:06 Quote from: malmax71 on March 13, 2018, 08:46:36 amActually the question: Is it possible to load such SQL scripts with Lasarus? Yes, it is. ---------------------------------------------------------------------- mangakissa · 2018-03-14 07:28 QuoteThe database contains stored procedures and functionsQuoteI don't need returns a kind of dataset. I need execute SQL script, containing many different queries. Queries type UPDATE, ALTER etcThese are two different things. First you're talking about a 'stored procedure' which is executed by TSQLQuery. If you want to execute several query in sequence, TSQLscript is your man. But you cant combine stored procedures and queries in a script ---------------------------------------------------------------------- rvk · 2018-03-14 09:20 Quote from: malmax71 on March 13, 2018, 02:31:52 pmBut query type CREATE FUNCTION consist many strings whith semicolons and it cause an error in components TSQLQuery or TSQLScript. You need to fiddle with the "Terminator" property. TSQLScript doesn't 'understand' DELIMITER.