nol1085@dsacg2.dsac.dla.mil (Gregory S. Elich) (02/08/91)
I am just beginning to teach myself to use Oracle, and I've run into a problem that I'm unable to solve. I've built a small phone directory database. I'm using SQL*Calc to build the input data. However, when typing extension numbers, I found that SQL*Calc blanks out any leading zeros, so that extension 0566 becomes 566. I tried checking /layout/modify-styles to see which option does Not "blank when 0" (option 5). Then, I selected layout/style. The prompt says "enter number of layout/modify-styles style setting (1-8)", so I enter "5" at this point. Then, when I enter 0566, SQL*Calc still blanks out the leading zero. How can I prevent this? My version of Oracle is 5.1, and my SQL*Calc is version 1.1. -- Gregory Elich gelich@dsacg2.dsac.dla.mil AV 850-9753 ATT 614-238-9753 Defense Logistics Agency Systems Automation Center DSAC-OLA, P. O. Box 1605, Columbus, OH 43216
cindy@SSD.CSD.HARRIS.COM (Cindy Walters) (02/11/91)
In article <2922@dsacg2.dsac.dla.mil> nol1085@dsacg2.dsac.dla.mil (Gregory S. Elich) writes: > > [...], I found that SQL*Calc blanks out any leading zeros, > so that extension 0566 becomes 566. I tried checking /layout/modify-styles > to see which option does Not "blank when 0" (option 5). Then, I selected > layout/style. The prompt says "enter number of layout/modify-styles style > setting (1-8)", so I enter "5" at this point. Then, when I enter 0566, > SQL*Calc still blanks out the leading zero. How can I prevent this? > My version of Oracle is 5.1, and my SQL*Calc is version 1.1. I believe that the "blank when 0" refers to the value of the cell, not to the value of a leading zero. If you enter "0" (zero) in one of your cells with the "style 5" setting, you should notice that you see the "0" appear in the cell. If you set another field/column/row style to setting "1" (Blank when 0 = Y), the zero entered in the cell will be blanked out. One way around your dilemma would be to enter the "0566" as "text", instead of a number. You can do this by typeing "'0566" - i.e., type a single quote before typing the number. This indicates to SQL*Calc that the entry should be treated as 'text' and not a number. You may also want to change the justification for this field/column/row (depending upon your application) to Text-Right alignment, so it matches your numeric entries (use: /layout/column/align/<return>, to right-justify text in the column). I'm not sure if mathematical operations on a mixed numeric/text column will work correctly, but this should not be a problem for your phone extensions ;-) Hope this helps :-) ====================================================================== Cynthia M. Walters Internet: cindy@travis.csd.harris.com Harris Computer Systems UUCP: ...!uunet!travis!cindy 2101 W. Cypress Creek Road -------------------------------------- Ft. Lauderdale, FL 33309-1892 | R e m a i n C a l m !!! | Tel: (305) 973-5118 -------------------------------------- Fax: (305) 977-5580 ======================================================================= Disclaimer: Any opinions expressed here are my own, and in no way reflect the opinions or policies held by Harris. ======================================================================