Home » Developer & Programmer » Forms » Insert thru Forms6i
icon3.gif  Insert thru Forms6i [message #260388] Sun, 19 August 2007 07:39 Go to next message
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
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: 65154
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.

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
Messages: 21148
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
Messages: 10180
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Populate block using cursor
and my feelings about it.
Another one of my rants.

Next Topic: Tabs and Executing queries
Goto Forum:

Current Time: Wed Aug 23 09:02:06 CDT 2017

Total time taken to generate the page: 0.05712 seconds