If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > SQL*Plus info

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-22-03, 12:22
Norman Norman is offline
Registered User
 
Join Date: Jan 2003
Posts: 6
SQL*Plus info

Hello everyone.. I'm doing some scripting through SQL Plus and I had this query (which I forgot to save) that created teh following Header before each row:


INFO_1
--------------------------------------------------
INFO_2
--------------------------------------------------
INFO_3 APRF
-------------------------------------------------- --------------
MESSAGE_DATE
-------------------

Which looks like it cuts the column off at 81.. And it puts this BEFORE each record.. this is what I want.. but now.. it's doing:



INFO_1
--------------------------------------------------
INFO_2
--------------------------------------------------
INFO_3 APRF MESSAGE_DATE
-------------------------------------------------- -------------- -------------------


Which as you can see is not cutting, and it's also only doing that on PAGE break.. I'ms ure it's something with the SQL (Which is included)
Any help would be GREAT.. Thanks

select info_1,info_2, info_3, aprf, message_date
from aibridge_text_message
where
message_date >= '01/01/2003 00:00:00'
and message_date <= '01/30/2003 23:59:59'
order by info_1, message_date
Reply With Quote
  #2 (permalink)  
Old 01-22-03, 12:41
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Re: SQL*Plus info

Looks like you need SET PAGESIZE <number> LINESIZE 80 to format the output.

You can also use COLUMN command:

COLUMN message_date NEWLINE
__________________
Tony Andrews
http://tinyurl.com/tonyandrews

Last edited by andrewst; 01-22-03 at 12:43.
Reply With Quote
  #3 (permalink)  
Old 01-23-03, 06:29
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Re: SQL*Plus info

You might be interested in Tom Kyte's PRINT_TABLE code, which prints query output in a vertical format like this:

SQL> @print_table "select * from emp where deptno = 10"
EMPNO : 7782
ENAME : CLARK
JOB : MANAGER
MGR : 7839
HIREDATE : 09-jun-1981 00:00:00
SAL : 2450
DEPTNO : 10
AGE : 42
-----------------
EMPNO : 7839
ENAME : KING
JOB : PRESIDENT
HIREDATE : 17-nov-1981 00:00:00
SAL : 5000
DEPTNO : 10
AGE : 42
-----------------
EMPNO : 7934
ENAME : MILLER
JOB : CLERK
MGR : 7782
HIREDATE : 23-jan-1982 00:00:00
SAL : 1300
DEPTNO : 10
AGE : 42
-----------------

PL/SQL procedure successfully completed.

(The data column lines up nicely in reality!)

If interested, go to asktom.oracle.com and search for PRINT_TABLE.
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
  #4 (permalink)  
Old 01-23-03, 10:23
Norman Norman is offline
Registered User
 
Join Date: Jan 2003
Posts: 6
WOW.. thanks guys.. I'll definately checkout that Script..

Dave
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On