| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.oracle -> Re: How to write signed numeric?
/*****************************************************************************
l_body := SUBSTR(l_signed_value, 2, p_length - 1);
l_sign_end := SUBSTR(l_signed_value, 1, 1) ||
SUBSTR(l_signed_value, p_length + 1, 1);
SELECT DECODE(l_sign_end, '+0', '{', '+1', 'A', '+2', 'B', '+3', 'C',
'+4', 'D', '+5', 'E', '+6', 'F', '+7', 'G', '+8', 'H',
'+9', 'I', '-0', '}', '-1', 'J', '-2', 'K', '-3', 'L',
'-4', 'M', '-5', 'N', '-6', 'O', '-7', 'P', '-8', 'Q',
'-9', 'R') INTO l_last_digit FROM DUAL;
retval := l_body || l_last_digit;
'bounds');
> On Thu, 6 Apr 1995, Spencer H Moore wrote: > > mainframe system. Several of the fields are "signed numeric". I believe this > > means that the last byte of the field is an alphanumeric character such as > > "A", "J", "}", etc., depending upon the sign and value. > > > > Does anyone have an algorithm to convert a number to a "signed numeric" > > string in PL/SQL? I searched the FAQ and couldn't find anything (probably > > You will have better luck fixing things up on the COBOL side. COBOL > allows the use of SIGN IS SEPERATE [LEADING/TRAILING] so that the fields > can be signed without having the sign overpunch the last digit [harking > back to punched card terminology]. > > --Steve > > +----------------------------------------------------+ > | Steve Butler Voice: 206-464-2998 | > | The Seattle Times Fax: 206-382-8898 | > | PO Box 70 Internet: sbut-is_at_seatimes.com | > | Seattle, WA 98111 Packet: KG7JE_at_N6EQZ.WA | > +----------------------------------------------------+ > All standard and non-standard disclaimers apply. > All other sources are annonymous.Received on Wed Mar 24 2004 - 12:56:36 CST
![]() |
![]() |