I am trying to create a view for the following query.
SELECT DISTINCT
products.pid AS id,
products.pname AS name,
products.p_desc AS descri
The error message is in "QueryBrowser.pas", part of mysql-gui-tools.
procedure TQueryBrowserForm.SQLCreateViewClick(Sender: TObject);
// ...
begin
if Assigned(ActiveResultset) and (ActiveResultset.ResultSet.query.query_type = MYX_QT_SELECT)then
// ...
else
ShowError('Creation error', _('A view can only be created from a active resultset of SELECT command.'), []);
end;
It is triggered by a) not having an active result set and b) the query having the wrong type.
Does removing the "DISTINCT" make any difference? In any case, this is a bug in QueryBrowser, rather than one MySQL. Creating the view directly in MySQL should suffice as a work-around.