473,387 Members | 3,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Newbie with basic question about formatting

1
Here is my query:

Expand|Select|Wrap|Line Numbers
  1. SELECT departments.department_name AS "Department name", locations.STREET_ADDRESS AS "Mailing address", locations.city, locations.state_province, locations.postal_code
  2. FROM departments, locations
  3. WHERE departments.location_id = locations.location_id
  4. AND locations.country_id = 'US'
  5. ORDER BY department_name;
and here is what the output is like:

Expand|Select|Wrap|Line Numbers
  1. Department name                Mailing address
  2. ------------------------------ ----------------------------------------
  3. CITY                           STATE_PROVINCE            POSTAL_CODE
  4. ------------------------------ ------------------------- ------------
  5. Administration                 2004 Charade Rd
  6. Seattle                        Washington                98199
  7. IT                            2014 Jabberwocky Rd
  8. Southlake                      Texas                     26192
  9.  
  10.  
my query needs to list department names and mailing addresses of the departments located in the U.S. My current query accomplishes the result fine but the formatting is wrong because I need it to look like this (it's an sql excercise, I'm a newbie):

Expand|Select|Wrap|Line Numbers
  1. Department Name                Mailing Address
  2. ----------------------                -----------------------------------------------------
  3. Administration                     2004 Charade Rd, Seattle, Washington 98199
  4. IT                                2014 Jabberwocky Rd, Southlake, Texas 26192
  5.  
How can I do this?

Thanks for your time.

PS: it doesn't matter if the displayed data is folded because of the number of lines allowed.
Aug 5 '07 #1
2 1090
Mala232
16
Hi,

Use set linesize 100 or more number to fit in the screen

SQL> SET LINESIZE 100;
SQL> type your query here
Aug 5 '07 #2
debasisdas
8,127 Expert 4TB
SQL*PLUS has some default setting , as per that it can display 80 chars per line and 14 lines per page . After the specified value the display will move to next line / page. to change the default values

ex
--------

set line 120

(maximun 32767)

set pages 50
(maximum 50000)

u can also do the same from the menu by changing the environment variables.
Aug 6 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Ray | last post by:
Date problem. Using non American date formats with Microsoft Access and Visual Basic. I set my regional settings to English(Ireland) or English(United Kingdom) and my date appears in Access as...
2
by: | last post by:
Hi All, I am sending an email containing the string data for eg . string subject ="New client"; from my web service. I want that string data to be appearted as bold in the email. I know this...
2
by: notAclueabouthtml | last post by:
Hi all, Well, I think that I have bit off more than I can chew. I believe that I would benefit from a private tutor of sorts. but here goes. I am in charge of my kids middle school "giving fund"....
0
by: dokmanc | last post by:
I've reproduced the same simple example shown in this MS KB article. http://support.microsoft.com/kb/307021/ The example shows how to use an XLS file to appy formatting to an XML dataset and...
8
by: Markus Pitha | last post by:
Hello, first of all I have a question about types: When I have a method like this... TYPE getStringValue() { string str = "test"; return str; }
0
by: Rauf Sarwar | last post by:
Originally posted by dreimer You have to use ODBC/ADO etc to connect to the database. I don't know the exact syntax but you can search in comp.lang.visual.basic NG. Another suggestion.... dump...
6
by: raylopez99 | last post by:
Will ASP.NET 3.0 work under Visual Studio 2005? And what is a good newbie ASP.NET book? Subject: Will ASP.NET 3.0 work under Visual Studio 2005? And what is a good newbie ASP.NET book? My...
3
Lokean
by: Lokean | last post by:
Sorry for this newbie question, this is not my realm of expertese. I have searched google, tried several applications that claim they can do this, such as Mapforce, which I found confusing, to...
24
by: cplxphil | last post by:
Hi, Does anyone know if it's possible to post to a page without using a form? For example, if I want to pass a variable to another page without using a cookie, is there a way to pass it using...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.