The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Output format - comparison with I/p file velappangs Shell Programming and Scripting 1 04-03-2008 06:31 AM
Getting output parameter in sqlplus risshanth UNIX for Dummies Questions & Answers 1 04-01-2008 01:32 PM
sqlPlus output with new line character decci_7 UNIX for Advanced & Expert Users 2 03-08-2008 04:54 PM
format output Tornado Shell Programming and Scripting 7 11-19-2006 06:17 AM
Format the output of file getdpg Shell Programming and Scripting 9 01-24-2006 12:50 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-19-2007
deepakgang deepakgang is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 38
Exclamation File Format issue: Output of sqlplus

Hi,

I am using a query like below in my shell script :

{
{
echo "set echo off"
echo "set head off"
echo "whenever sqlerror exit -1;
select NUMBER ||','||
FNAME ||','||
LOC ||','||
NUM ||','||
DESC ||','||
ID ||','||
INC ||','||
to_char(start_date,'dd-mm-yyyy') ||','||
to_char(end_date,'dd-mm-yyyy')
from emp_details
where .....
} | sqlplus -s testuser/testpass@testdb > EmpDetails.txt
}


As I need a comma separated file.

When the file is created, a sample lines looks like below:

2514,MY_TEST_NAME_IS,351,23728929,THIS_IS_A_TEST VALUEQ,47265,Y,01-04-2008,01-01
-2027

As you can see there is an extra carriage return coming after "01-01" and the "-2027" is going to the next line. This is happening with all the outout lines. Any data after a particular length is going to the next line.
How can I remove this formatting issue?

Thanks
Deepak
  #2 (permalink)  
Old 10-19-2007
ermur ermur is offline
Registered User
  
 

Join Date: Jul 2007
Location: La Paz, Bolivia
Posts: 15
Set Lines

Hi Deepak

The parameter you are looking for is the SET LINESIZE. It sets the number of characters as page width of the query results.

In you example, put this line after 'echo "set head off"':

echo "SET LINESIZE 300"

Regards,

Er
  #3 (permalink)  
Old 10-25-2007
deepakgang deepakgang is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 38
Hi Er,

It worked Thanks for the help.

Deepak
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:15 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0