Can't return a record set in a given context lazarus / 16-Databases ---------------------------------------------------------------------- motaz · 2010-02-01 12:21 I want to call a procedure in MySql that inserts a record and return a record set. When I call it by SqlQuery1.Open I get can't open a non-select statement when I call it by SqlQuery1.ExecSql I get : can't return a record set in a given context any ideas? I'm using Lazarus 0.9.28.2 under windows ---------------------------------------------------------------------- Martin_fr · 2010-02-01 15:31 I don't know about the open/execute bits, but depending what you try to archive, there may be a completely different way. You can store the result in mysql user variables, and read them later (variables are per connection, so there is no interference from other connections => but you loose the data, if you disconnect) You can also use this to update data, and read the new values, in an atomic operation without the need for extra table locking.... ---------------------------------------------------------------------- motaz · 2010-02-02 09:10 Thanks Martin this is the solution that I do yesterday, but I wanted to know can lazarus call a procedure that contains execute and select at the same time I called the procedure with output parameters instead of record set like this: Adduser 'ausername', @x, @y then I call Open SQL to read x and y select @x, @y but I can read only @x value, I cann't read @y, I don't know why in MySQL Adim I can read both values ---------------------------------------------------------------------- LacaK · 2010-02-03 13:15 How can procedure in MySQL return recordset ? AFAIK mySQL CALL statement can return only output variables (and these variables can be later read by select @a, @b statement)