How can I show my query results on one line?

时间:2016-04-04 18:01:07

标签: oracle-sqldeveloper

How do I move this line? I can't view the results properly right now.

enter image description here

1 个答案:

答案 0 :(得分:2)

The default line size in SQL Developer (and SQL*Plus) is 80 characters. Your output exceeds that so it's wrapping each row in the result set into multiple lines in the script output window.

The first fix is to increase the linesize:

set linesize 200

... or any suitable number. You just need it to be wide enough for your data. If you make it too big you may have to scroll sideways to see all of the columns, though that depends on their data types.

You can also make the columns narrower, but only really if you know that all of the values in them are shorter than the minimum:

column name format a20
column friend format a20

If you make that to narrow individual values will still wrap onto the next line.

Most, but not all, SQL*Plus set commands work in SQL Developer too. (You might want to investigate set pagesize, for example). You can also use an SQL Developer-specific command:

set sqlformat ansiconsole

which automatically eliminates a lot of whitespace for you; but you may still need to set linesize.


Dave Michener suggested you were (only) referring to the vertical dotted line in the screenshot, which is reasonable as that's what your arrow points to. But that is just a visual guideline, and has no real effect; it's more useful in the worksheet so you can see when a line of code gets too long.

Although it's displayed in the script output window as well, it does even less there, and it's completely independent of the linesize setting. You can move the line from the preferences:

enter image description here

But if you increase that and leave linesize at the default 80, the output will still be wrapped as it was before. You'll just have more whitespace between the output and the line.

相关问题