The UNIX and Linux Forums  

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
To convert multi format file to a readable ascii format gaur.deepti UNIX for Dummies Questions & Answers 5 03-25-2008 12:03 PM
Convert UTF8 Format file to ANSI format rajreddy UNIX for Dummies Questions & Answers 9 05-25-2007 05:26 AM
Convert UTF8 Format file to ANSI format rajreddy UNIX for Advanced & Expert Users 1 05-24-2007 03:40 AM
convert mmddyy date format to ccyyddd format?? Bhups Shell Programming and Scripting 2 09-27-2006 08:30 PM
change the empty function from the old format to the new format powah Shell Programming and Scripting 0 06-23-2005 09:17 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-18-2002
Registered User
 

Join Date: Mar 2002
Location: Memphis
Posts: 28
Question How to format this?

Hi, All:

I got a output from run a script as follows:

____________________________________________________
SQL*Plus: Release 8.0.5.0.0 - Production on Thu Jul 18 11:25:1 2002

(c) Copyright 1998 Oracle Corporation. All rights reserved.


Connected to:
Oracle8 Enterprise Edition Release 8.0.5.1.0 - Production
PL/SQL Release 8.0.5.1.0 - Production

SQL> SQL> SQL>
PRIM_T PRIM_T_OFFSET PRIM_T_SIZE PRIM_T_MARKER
------ ------------- ----------- -------------
AA0318 149363 14821 2337 *

SQL> Disconnected from Oracle8 Enterprise Edition Release 8.0.5.1.0 - Production
PL/SQL Release 8.0.5.1.0 - Production
BLOCK_01022001 *
____________________________________________________

This is only part of the output, a lot same thing I didn't list here. What I really want to do is to have that two line with * formated like below:

BLOCK_01022001: AA0318 149363 14821 2337

Could anyone give me a help?

Thanks in advance!

yun
Forum Sponsor
  #2  
Old 07-18-2002
sTorm's Avatar
Registered User
 

Join Date: Jan 2002
Location: Switzerland, Zurich
Posts: 32
Since this output is from a script you should ask in the Shell Programming and Scripting Q & A forum.
__________________
regards,
sTorm
  #3  
Old 07-18-2002
Registered User
 

Join Date: Jul 2002
Location: Belgium
Posts: 20
This is not really a matter of unix, but one ofsql .
you should make your sql script look like the following :
  • set hea off;
  • set echo off;
  • set pagesize 0;
  • spool outputfile;
  • select whatever you need
  • from whatever
  • where whatever;
  • spool off;

This way you'll get an outputfile which contains only the line(s) you need and it's much eassier to work with this data then.

From where does this "BLOCK_01022001" thing come ?
Is it a fixed value ?
  #4  
Old 07-19-2002
sTorm's Avatar
Registered User
 

Join Date: Jan 2002
Location: Switzerland, Zurich
Posts: 32
Oops, sorry for the wrong information.
__________________
regards,
sTorm
  #5  
Old 07-19-2002
Registered User
 

Join Date: Feb 2002
Location: metalink.oracle.com
Posts: 13
If you need to combine output results from two absolutly different scrips (if you can't combine it in the one), then I think you have to do something like this:

-----
scra:

sqlplus -s /nolog <<EOF
connect ...
@you_script_1_or_just queries
EOF
-----
scrb:

sqlplus -s /nolog <<EOF
connect ...
@you_script_2_or_just queries
EOF
---

to identify you string for output in both queries use any unique values in select, like "select 'UNIQ1', * ....."

main:

result=`scra | grep UNIQ1``scrb | grep UNIQ2`

echo $result

-------------------

I think, that other way to solve the problem - only combine all results in one sql-script. And I think it really possible, all depends of your tasks.
  #6  
Old 07-19-2002
Registered User
 

Join Date: Feb 2002
Location: metalink.oracle.com
Posts: 13
P.S. To combine all tasks in one query you can use PL/SQL procedure, which will generate table with report, and you just will print report in you script
  #7  
Old 07-19-2002
Registered User
 

Join Date: Mar 2002
Location: Memphis
Posts: 28
Smile Thank you!

Plelie and Colf:

Thank you so much! What you recommend methods is great, I'll give a try. "BLOCK_01022001" is a fixed table name.

yun
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:34 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0