Home » Developer & Programmer » Forms » Insert thru Forms6i
icon3.gif  Insert thru Forms6i [message #260388] Sun, 19 August 2007 07:39 Go to next message
blaklite
Messages: 1
Registered: August 2007
Location: India
Junior Member

hi all,
I have table
create table cdofshps(
rngcode varchar2(3),
shcode varchar2(6),
cd_tdate date,
cd_tqty number(6,3) default 0,
cd_ttyp varchar2(1) default '-',
constraint CDPK primary key (rngcode,shcode,cd_tdate),
constraint CDFK foreign key (rngcode,shcode)
references shops
)
which is created successfully.
I wrote a simple query in forms6i which is as follows:
insert into cdofshps (rngcode,shcode,cd_tdate,cd_tqty) values
('SKP','T.S 32','02-aug-2007',0);
it gives me an error ora-01400: cannot insert null into
"my_schema"."cdofshps"."rngcode", although i have not given
any null value to rngcode.
This query executes without any problem on Sql Plus console.
PLz Help
Thanks
Blaklite
Re: Insert thru Forms6i [message #260396 is a reply to message #260388] Sun, 19 August 2007 09:27 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Please at least read the list of forums before posting.
There is a forum for Forms.

Regards
Michel
Re: Insert thru Forms6i [message #260413 is a reply to message #260388] Sun, 19 August 2007 11:08 Go to previous messageGo to next message
Littlefoot
Messages: 20888
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I'd say that it is not the INSERT statement that causes the error, but committing block record which contains empty 'mgcode' item.

Forms, usually, don't need an explicit INSERT statement; usually, you'd fill in items' values and save (commit) changes you have made.

Also, you have declared 'cd_tdate' as a DATE column. Why do you insert a STRING ('02-aug-2007') into it? It is a pure luck it didn't throw an error - don't rely on current NLS settings, always take control over dates and insert DATE into a DATE column, i.e. TO_DATE('02-aug-2007', 'dd-mon-yyyy').
Re: Insert thru Forms6i [message #260764 is a reply to message #260388] Mon, 20 August 2007 20:39 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Populate block using cursor
http://www.orafaq.com/forum/m/605/67467/?srch=populate+block+cursor+create_record#msg_605
and my feelings about it.
http://www.orafaq.com/forum/m/134237/67467/?srch=populate+block+cursor+create_record#msg_134237
Another one of my rants.
http://www.orafaq.com/forum/mv/msg/74947/213213/67467/#msg_213213

David
Previous Topic: Problem with starting multipule listeners
Next Topic: Developer 9i code problem
Goto Forum:
  


Current Time: Fri Dec 02 20:43:07 CST 2016

Total time taken to generate the page: 0.06419 seconds