ZSQLProcessor error when creating Stored Procedure
Posted: 27.08.2013, 02:32
Hello,
I'm having a problem when creating a stored procedure using the ZSQLProcessor Component.
My application has an option where I can dinamically create a new blank database. (This is necessary for this application)
Everything is working fine, except for the creation of the stored procedure.
The code in delphi:
Creating the database - works OK!
Creating the Tables - works OK!
Creating the Stored Procedures - Error!
"You have an error in your SQL syntax; Check the manual that corresponds to your SQL server version for the right syntax to use near '' at line 1"
I simplyfied the stored procedure as much as I could to see where is the error and even a simple procedure as follow gets an error:
(This is the script inside file procedures.sql that I'm loading in the ZSQLProcessor)
I know is empty - just for testing - and If I run this script in PHPmyAdmin it works perfectly... so, I'm not sure what is going on.
seems to be related with the delimiter or something... I have spend a couple of days trying to solve this
Any ideas and suggestions are higly appreciated !
I'm having a problem when creating a stored procedure using the ZSQLProcessor Component.
My application has an option where I can dinamically create a new blank database. (This is necessary for this application)
Everything is working fine, except for the creation of the stored procedure.
The code in delphi:
Code: Select all
{Creating the Database - Procedure that works fine and creates a new blank and empty database}
CrearBaseDeDatos(EmpresaID);
{Creating tables}
ZSQLProcessor1.LoadFromFile('C:\database.sql');
ZSQLProcessor1.Execute;
ZSQLProcessor1.LoadFromFile('C:\procedures.sql');
ZSQLProcessor1.Delimiter:='$$';
ZSQLProcessor1.Execute;
Creating the Tables - works OK!
Creating the Stored Procedures - Error!
"You have an error in your SQL syntax; Check the manual that corresponds to your SQL server version for the right syntax to use near '' at line 1"
I simplyfied the stored procedure as much as I could to see where is the error and even a simple procedure as follow gets an error:
(This is the script inside file procedures.sql that I'm loading in the ZSQLProcessor)
Code: Select all
CREATE PROCEDURE RecalcularCuentas( IN d04 datetime)
BEGIN
END$$
seems to be related with the delimiter or something... I have spend a couple of days trying to solve this
Any ideas and suggestions are higly appreciated !