Home » Developer & Programmer » Forms » Trailing Space Automatic Trimming in Oracle Forms (Oracle Forms, 6i, Win XP)
Trailing Space Automatic Trimming in Oracle Forms [message #566875] Thu, 20 September 2012 09:49 Go to next message
infosuresh2k
Messages: 77
Registered: September 2009
Location: CHENNAI, INDIA
Member

Hi All,

We are using Oracle Forms 6i and back-end as Oracle 10g Database. We are facing a specific problem while working with Forms6i. I am giving the steps as showm below:

1. We have a table named TEST (a number not null, b char(1) not null).
2. When we insert a record throuhg SQL*PLUS like this:
insert into test values (1, ' '). The record is inserted in the table TEST successfully.
3. We checked the length of column b i.e. select length(b) from test, it is showing 1. This is the correct value because it has inserted a space in column 'b' of the table TEST. (That's what we want).

4. We created a form having data-block from table TEST and trying to insert the same record throuhg Forms9i.

5. There it gives an error of "Unable to INSERT record" becuase in form builder, it is trimming the spaces for column 'b' automatically and making it NULL. Since the column 'b' defined as NOT NULL in table TEST, hence generating the error. (Basically there in form builder, it is generating ORA-01400 error which is can not insert NULL value in NOT NULL column).

We would like to know why in form builder, space is automatically being trimmed to NULL..? We do not want this to happen. We want space to be inserted as space only. How can i implement this case, becuase we need this kind of functionality in our form builder application.

Thanks in advace for your help & support. Any tips would be highly appreciated.
Re: Trailing Space Automatic Trimming in Oracle Forms [message #566897 is a reply to message #566875] Thu, 20 September 2012 12:45 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
Sounds like a dumb thing to do; store a space in a column. When you do a select how are you to know if it is null or space?

What if you set a pre-insert trigger or something like it to set it to space if it is null? It will probably allow you to successfully save, but I would say it is much worse to have a space/trailing spaces in any column in a table.
Re: Trailing Space Automatic Trimming in Oracle Forms [message #566936 is a reply to message #566897] Fri, 21 September 2012 00:59 Go to previous message
infosuresh2k
Messages: 77
Registered: September 2009
Location: CHENNAI, INDIA
Member

i want this for generating credit card stmt.
say my table have name as 30 char length and credt card number as15 char length.

eg : name is suresh venkatesan(length is 18 char)
so i need to add 12(18+12=30 total) white spaces in the end of the name.
(suresh venkatesan            )

credit card number is xxxxxxxxxx(10 char length) then i have to 5(10+5=15) white spaces at the end of credit card number.
(xxxxxxxxxx     )

is it possible to do the above using oracle form?

[EDITED by LF: applied [pre] tags]

[Updated on: Mon, 24 September 2012 04:40] by Moderator

Report message to a moderator

Previous Topic: Form 10g 11i to R12 Date Issue
Next Topic: Problem running form in 'FORMS Builder'
Goto Forum:
  


Current Time: Wed Jul 03 10:44:28 CDT 2024