Home » SQL & PL/SQL » SQL & PL/SQL » Output packed desimal
Output packed desimal [message #39502] Fri, 19 July 2002 12:24 Go to next message
Shanae
Messages: 2
Registered: July 2002
Junior Member
I am using the utl_file function to create a flat file read in by a COBOL program is expecting numbers to be packed decimal and character fields to be in hex. I have gotten the character converted to hex, but I can't figure out how to convert the numbers so they are packed in the file. Any ideas would be greatly appreciated.

Thanks

Shane
Re: Output packed desimal [message #39503 is a reply to message #39502] Fri, 19 July 2002 12:56 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
what do you mean by
how to convert the numbers so they are packed in the file?
any how you can convert numbers to decimal like this.

select to_char(1/100, '0.99') from dual;
select to_char(2200/100, '09.99') from dual;

I am not very clear about packged decimals??? forgot the basic math!!
Re: Output packed desimal [message #39519 is a reply to message #39502] Mon, 22 July 2002 05:34 Go to previous message
Shanae
Messages: 2
Registered: July 2002
Junior Member
packed decimal format: two digits per byte, except for the last byte, which contains a digit and sign.
therfor the number 12345 is stored as in hex as "12 34 5C" rather than "31 32 33 34 35"
Previous Topic: trigger on update
Next Topic: Copy from Long to Long Raw with PL/SQL
Goto Forum:
  


Current Time: Wed Apr 24 15:12:02 CDT 2024