Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Oracle > Leading zero's in Oracle Forms tricky

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-30-04, 19:05
tfarino tfarino is offline
Registered User
 
Join Date: Jan 2004
Location: Las Vegas, NV USA
Posts: 38
Leading zero's in Oracle Forms tricky

I got a tough one, at least for me. In Oracle Forms 10g I am trying to take number from three items, and combine them into one item for a Job_id. Here is what its like:

Vessel Number 3 digits ex 156
Run Number - 3 digits ex 023
Segment Number 2 digits ex 01

What gets placed in the Job_id item on a PRE-INSERT is 156-023-01. That's what I want. Instead I get 156-23-1. Now, the run number and segment fields I setup a format mask like 099 to show the zero, but in the PRE-INSERT the zero's still go away. I've tried everything messing with the FORMAT MASK in job_id and nothing.

Any Suggestions.
Thank you,
Todd
__________________
Todd Farino
Timet Corporation
todd.farino@timet.com
Reply With Quote
  #2 (permalink)  
Old 09-30-04, 19:53
ss659 ss659 is offline
Registered User
 
Join Date: Jan 2004
Posts: 492
I really dont know forms well, but is there anyway you could throw an lpad in the query which pulls segment number?

Like
Code:
Select lpad(segment_number, 2, 0) from table

Just a stab here!
__________________
Oracle OCPI (Certified Practicing Idiot)
Reply With Quote
  #3 (permalink)  
Old 09-30-04, 20:28
JMartinez JMartinez is offline
Registered User
 
Join Date: May 2004
Location: Dominican Republic
Posts: 704
Try format Mask 'FM000' or as many/lesses zeros you need (FM fill mode).

Example:
Code:
SQL> ed Wrote file afiedt.buf 1 create table t ( 2 Vessel Number, 3 Run Number, 4 Segment Number 5* ) 6 / Table created. SQL> insert into t values (156,023,01); 1 row created. SQL> select * from t; VESSEL RUN SEGMENT ---------- ---------- ---------- 156 23 1 SQL> select to_char(vessel,'FM000') || '-' || to_char(run,'FM000') || '-' || to_char(segment,'FM00') 2 from t 3 / TO_CHAR(VESSE ------------- 156-023-01 SQL>
Reply With Quote
  #4 (permalink)  
Old 10-01-04, 12:14
tfarino tfarino is offline
Registered User
 
Join Date: Jan 2004
Location: Las Vegas, NV USA
Posts: 38
Thank you, I will give that a try today.

Todd
__________________
Todd Farino
Timet Corporation
todd.farino@timet.com
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On