Set each procedure parameter on its own line, and remove some tabs. See http://www.heidisql.com/forum.php?t=21166

This commit is contained in:
Ansgar Becker
2016-04-27 18:08:00 +00:00
parent 24208cc039
commit dec6f9ee63

View File

@ -534,8 +534,9 @@ end;
function TfrmRoutineEditor.ComposeCreateStatement(NameOfObject: String): String; function TfrmRoutineEditor.ComposeCreateStatement(NameOfObject: String): String;
var var
ProcOrFunc: String; ProcOrFunc, tmp: String;
i: Integer; i: Integer;
Params: TStringList;
begin begin
case comboType.ItemIndex of case comboType.ItemIndex of
0: ProcOrFunc := 'PROCEDURE'; 0: ProcOrFunc := 'PROCEDURE';
@ -545,23 +546,26 @@ begin
if comboDefiner.Text <> '' then if comboDefiner.Text <> '' then
Result := Result + 'DEFINER='+DBObject.Connection.QuoteIdent(comboDefiner.Text, True, '@')+' '; Result := Result + 'DEFINER='+DBObject.Connection.QuoteIdent(comboDefiner.Text, True, '@')+' ';
Result := Result + ProcOrFunc+' '+DBObject.Connection.QuoteIdent(NameOfObject)+'('; Result := Result + ProcOrFunc+' '+DBObject.Connection.QuoteIdent(NameOfObject)+'(';
Params := TStringList.Create;
for i:=0 to Parameters.Count-1 do begin for i:=0 to Parameters.Count-1 do begin
tmp := '';
if ProcOrFunc = 'PROCEDURE' then if ProcOrFunc = 'PROCEDURE' then
Result := Result + Parameters[i].Context + ' '; tmp := tmp + Parameters[i].Context + ' ';
Result := Result + DBObject.Connection.QuoteIdent(Parameters[i].Name) + ' ' + Parameters[i].Datatype; tmp := tmp + DBObject.Connection.QuoteIdent(Parameters[i].Name) + ' ' + Parameters[i].Datatype;
if i < Parameters.Count-1 then Params.Add(tmp);
Result := Result + ', ';
end; end;
if Params.Count > 0 then
Result := Result + CRLF + #9 + implodestr(','+CRLF+#9, Params) + CRLF;
Result := Result + ')'+CRLF; Result := Result + ')'+CRLF;
if comboReturns.Enabled then if comboReturns.Enabled then
Result := Result + #9 + 'RETURNS '+comboReturns.Text+CRLF; Result := Result + 'RETURNS '+comboReturns.Text+CRLF;
Result := Result + #9 + 'LANGUAGE SQL'+CRLF + #9; Result := Result + 'LANGUAGE SQL'+CRLF;
if not chkDeterministic.Checked then if not chkDeterministic.Checked then
Result := Result + 'NOT '; Result := Result + 'NOT ';
Result := Result + 'DETERMINISTIC'+CRLF Result := Result + 'DETERMINISTIC'+CRLF
+ #9 + UpperCase(comboDataAccess.Text)+CRLF + UpperCase(comboDataAccess.Text)+CRLF
+ #9 + 'SQL SECURITY ' + UpperCase(comboSecurity.Text)+CRLF + 'SQL SECURITY ' + UpperCase(comboSecurity.Text)+CRLF
+ #9 + 'COMMENT ' + esc(editComment.Text)+CRLF + 'COMMENT ' + esc(editComment.Text)+CRLF
+ SynMemoBody.Text; + SynMemoBody.Text;
end; end;