Insert thru Forms6i [message #260388] |
Sun, 19 August 2007 07:39 |
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 #260413 is a reply to message #260388] |
Sun, 19 August 2007 11:08 |
|
Littlefoot
Messages: 21823 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').
|
|
|
|