views:

136

answers:

2

Helo,

I am using oracle 10g and the output coming when SELECT command is in a zig zag format. How I can arrange coulumns in correct order? Is there any command?

+2  A: 

If you are using sqlplus you can control output formatting via "COLUMN" commands.

I suspect the zigzagging has something to do with the size of your terminal and the length of the columns you are selecting.

If you first format each column to an appropriate length and then do your select, you should see better output. You can refine it from there.

Google "sqlplus reference" you will find more details about how to use sqlplus.

ok. But in postgresql, it will come in correct format as given below. pki_under_clearance_id | uvc_code | dt_uc_date | vc_order_type | f_amount | txt_remarks | vc_invoice_no | dt_invoice_date | fki_branch_id | fki_financial_period_id------------------------+----------+------------+---------------+----------+-------------+---------------+-----------------+---------------+------------------------- 0 | _BLANK | 2008-01-01 | | 0 | | | | 76 | 17
+2  A: 

And perhaps you might be interested in reseting, "pagesize" and "linesize" parameters.

SQL> set pagesize 30
SQL> set linesize 90
Guru