Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Everett.

Asked: April 07, 2016 - 7:41 pm UTC

Last updated: July 05, 2019 - 5:34 am UTC

Version: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0-64 bit Production With the Partitioning, Automatic Storage Management and OLAP options. Connected through my university with PortaPutty and Nova.

Viewed 1000+ times

You Asked

Hello,
I'm having problems with my data not being aligned and neatly displayed when I perform a SELECT statement. The data is skewed and not aligned with the columns. I've tried statements with the COLUMN and HEADING commands but with no success. Any assistance you can provide would be greatly appreciated. Thank you very much.

Sincerely,
Everett

CREATE TABLE movie_stores (movie_store_id CHAR(8) PRIMARY KEY,
movie_store_name VARCHAR2(20) NOT NULL,
account_number VARCHAR2(10) NOT NULL,
street VARCHAR2(30) NOT NULL,
city VARCHAR2(30) NOT NULL,
state CHAR(2) NOT NULL,
zip_code CHAR(5) NOT NULL,
primary_phone VARCHAR2(12) NOT NULL);

INSERT INTO movie_stores (movie_store_id, movie_store_name, account_number, street, city,
state, zip_code, primary_phone)


VALUES ('WE831957', 'Walker Entertainment', '563WE962', '984 Torro Lane', 'Jubilee', 'KS',
'49826', '583-028-2859');

SELECT * FROM movie_stores;


and Connor said...

I'm not entirely sure what you mean.

For example, on my laptop here I get the following:

DATA_ALIGNMENT

Some things to check

set linesize 200
set pagesize 100

because SQL PLus doesnt know the window size of your terminal - it works on internal definitions.

Then if you want columns to be spaced greater than the default, then you can things like:

col movie_store_id format A20

and so forth.

Hope this helps.

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Everett, April 10, 2016 - 7:00 am UTC

Unfortunately, I'm still running into the same issue but thank you for your assistance. It was greatly appreciated.
Connor McDonald
April 11, 2016 - 3:38 am UTC

Try "set tab off"