在 TOAD 7 中格式化 sql 查询。
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22756704/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Format sql query in TOAD 7.
提问by murtaza.webdev
In toad's older version i can easily able to format the query in
在蟾蜍的旧版本中,我可以轻松地将查询格式化为
Toad's Query editor by
Toad 的查询编辑器
right click > Format Code.
But in newer version of Toad 7 i can't able to find this Format option. Can any one help me from where i can Format My Query.
但是在较新版本的 Toad 7 中,我无法找到此格式选项。任何人都可以帮助我从哪里可以格式化我的查询。
(how to FORMAT QUERY in TOAD 7?)
(如何在 TOAD 7 中格式化查询?)
回答by SriniV
TOAD FOR ORACLE
甲骨文蟾蜍
SHIFT+CTRL+F should help you
SHIFT+ CTRL+F 应该可以帮助你
To format a statement Select the statement you want to select and click ?
on the Edit toolbar.
格式化语句 选择要选择的语句并单击?
编辑工具栏上的 。
To format an entire script Click ?
on the Edit toolbar.
格式化整个脚本 单击?
编辑工具栏上的 。
Tip:You can also right-click the script and select Formatting Tools | Format Code.
提示:您也可以右键单击脚本并选择格式工具 | 格式代码。
See the documentation
查看文档
TOAD FOR MYSQL
用于 MYSQL 的蟾蜍
Format SQL
格式化 SQL
Use the formatter to modify the layout of SQL in the Editor, including inserting headers, adding or removing extra lines, and changing the case for keywords.
使用格式化程序在编辑器中修改 SQL 的布局,包括插入标题、添加或删除额外的行以及更改关键字的大小写。
To format SQL
格式化 SQL
Click Paint shaped box
on the Editor toolbar to format the contents of the Editor window. You can also format a partial statement in the Editor by selecting it before applying formatting.
单击Paint shaped box
编辑器工具栏上的 以格式化编辑器窗口的内容。您还可以通过在应用格式化之前选择它来在编辑器中格式化部分语句。
See documentation
查看文档
回答by typoerrpr
Just to add, in Toad 5 for SQLServer, the button to format code is "2 yellow triangles pointing right". In my fresh installation, this button is on the toolbar, beside the dropdown box to select the db environment.
补充一点,在 Toad 5 for SQLServer 中,格式化代码的按钮是“2 个指向右侧的黄色三角形”。在我的全新安装中,此按钮位于工具栏上,在选择 db 环境的下拉框旁边。
If you want to assign a shortcut, find it at Tools | Options | Environment | Keyboard | Editor | Tools | FormatCode.
如果要分配快捷方式,请在工具 | 中找到它。选项 | 环境 | 键盘 | 编辑 | 工具 | 格式代码。
Hope it helps, it took very long to find these buttons. Wish they'd make the controls the same as Toad for Oracle..
希望它有所帮助,找到这些按钮花了很长时间。希望他们能让控件与 Toad for Oracle 相同。
回答by Binyamin
You can format from the menu bar: Editor > Format Code > choose the exact format from the format list.
In case anyone's interested, for toad 8 for MySQL, there is an OOTB hot-key. Simply select the code you want to format, and press Alt+Ctrl+F.
您可以从菜单栏中进行格式化:编辑器 > 格式化代码 > 从格式列表中选择确切的格式。
如果有人感兴趣,对于 MySQL 的 toad 8,有一个 OOTB 热键。只需选择要格式化的代码,然后按Alt+ Ctrl+ F。
回答by harun ugur
In toad you can easily able to format the query by this shortcut ;
在蟾蜍中,您可以通过此快捷方式轻松地格式化查询;
Toad's Query editor;
Toad 的查询编辑器;
SHIFT+CTRL+F