SQLPlus formatting question

From: <aldark_at_eircom.net>
Date: 10 Jun 2005 05:34:10 -0700
Message-ID: <1118406850.360342.41000_at_z14g2000cwz.googlegroups.com>



Hi,
I'm doing an sqlplus script which outputs data for use with a cobol program - SQLPlus Release 9.2.0.4.0 on Solaris 7.

The numbers have to be fully filled out with leading zeroes e.g. if the field length is 7 then the value 5.25 would be "0005.25"

The problem is that SQLplus wants to keep the first character of the field for use as the number's sign e.g. display a - for negative numbers. So If I use the column format "0999.99" then the number 5.25 will be shown as " 005.25"

One solution is to use the format S999.99 which outputs a + for positive numbers and - for negative, then replacing all +'s with 0's. However, SQLPlus treats the length of S999 as 3 and 0999 as 4 - causes problems for precision etc.

The script sets the following :-
SET NEWPAGE 0
SET SPACE 0
SET COLSEP ''
SET PAGESIZE 0
SET ECHO OFF
SET FEEDBACK OFF
SET VERIFY OFF
SET HEADING OFF
SET MARKUP HTML OFF
SET TERMOUT OFF Has anybody a solution for this? Received on Fri Jun 10 2005 - 14:34:10 CEST

Original text of this message