Home » Developer & Programmer » Forms » same record appeared twice
same record appeared twice [message #681781] Mon, 31 August 2020 02:02 Go to next message
haider_1pk
Messages: 117
Registered: March 2009
Location: PAKISTAN
Senior Member
/foru/forum/fa/14371/0/Dear Friends

I am facing the problem of same record appeared twice after committed record,only in oracle forms 6i.
and not in others developing tools (e.g oracle 10g forms or 11g forms).
Kindly guide me , Why it is happened in oracle forms 6i.
Pictures are attached.

CREATE TABLE "INVOICE"
( "INVOICE_ID" NUMBER(6,0) NOT NULL ENABLE,
"CUSTOMER_ID" NUMBER(6,0) NOT NULL ENABLE,
"TYPE" VARCHAR2(12 BYTE),
"SUMMERY_ID" NUMBER(6,0),
"WDATE" DATE,
"SALES_MAN_ID" NUMBER(4,0) NOT NULL ENABLE

CONSTRAINT "INVOICE_ID_PK" PRIMARY KEY ("INVOICE_ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ENABLE,
CONSTRAINT "CUS_PKPK" FOREIGN KEY ("CUSTOMER_ID")
REFERENCES "CUSTOMERS" ("CUSTOMER_ID") ENABLE
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 1212416 NEXT 573440 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;

CREATE TABLE "INVOICE_DETAILS"
( "INVOICE_ID" NUMBER(6,0) NOT NULL ENABLE,
"PRODUCT_ID" NUMBER(7,0) NOT NULL ENABLE,
"QTY" NUMBER(8,0) NOT NULL ENABLE,
"DISCOUNT" NUMBER(8,0),
"BATCH_NUMBER" VARCHAR2(15 BYTE) NOT NULL ENABLE,
"RATE" NUMBER(6,2),
CONSTRAINT "INVOICE_DETAILS_INVOICE_FK1" FOREIGN KEY ("INVOICE_ID")
REFERENCES "INVOICE" ("INVOICE_ID") ENABLE
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 3932160 NEXT 1941504 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;


Thanks

Haider
  • Attachment: 2.gif
    (Size: 209.59KB, Downloaded 89 times)
Re: same record appeared twice [message #681782 is a reply to message #681781] Mon, 31 August 2020 02:14 Go to previous messageGo to next message
Michel Cadot
Messages: 67560
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Quote:
TABLESPACE "SYSTEM" ;

/forum/fa/14373/0/ Aaargh!

  • Attachment: bomb.png
    (Size: 1.89KB, Downloaded 213 times)
Re: same record appeared twice [message #681789 is a reply to message #681782] Mon, 31 August 2020 11:57 Go to previous messageGo to next message
Littlefoot
Messages: 21623
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Nothing you posted suggests that there's anything wrong (as far as Oracle is concerned). Screenshot says that "1 record was applied and saved". One, not two.

On the other hand, yes - I see, two records that look the same. What does
select * from invoice_details where invoice_id = 1
return?

Also, why does the INVOICE_DETAIL table not have a primary key? If it did, Oracle would have raised an error if there was a duplicate. Try to
alter table invoice_detail add constraint pk_invdet primary key (invoice_id, product_id);
and see what happens when you run the form.
Re: same record appeared twice [message #681798 is a reply to message #681789] Tue, 01 September 2020 01:16 Go to previous messageGo to next message
haider_1pk
Messages: 117
Registered: March 2009
Location: PAKISTAN
Senior Member
Thanks for Reply.
Dear Sir,

I could not add primary key as you said because I am using foreign key in invoice_details table.But i have added a primary key in new column named T.
The problem is still there when i used the committed key, It show the error of primary key but not all the time because sometimes it saves the record.
(I am facing this problem in only Forms 6i)
Re: same record appeared twice [message #681799 is a reply to message #681798] Tue, 01 September 2020 01:24 Go to previous messageGo to next message
haider_1pk
Messages: 117
Registered: March 2009
Location: PAKISTAN
Senior Member
And according to my observation one thing more that it happens only when I launch Forms first time i.e Records show double after saving. But during saving records second time in form it will works properly.
Re: same record appeared twice [message #681822 is a reply to message #681799] Wed, 02 September 2020 08:08 Go to previous messageGo to next message
haider_1pk
Messages: 117
Registered: March 2009
Location: PAKISTAN
Senior Member
waitting to your replay. Still problem is not resolve.
Re: same record appeared twice [message #681830 is a reply to message #681822] Wed, 02 September 2020 15:21 Go to previous messageGo to next message
Littlefoot
Messages: 21623
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I don't know what is going on. If it were a higher Forms version, I'd suggest you to run the form in debug mode. In 6i, you'll have to put MESSAGE calls everywhere to trace form's execution and see what is happening. Or, enable trace; see if this document helps.
Re: same record appeared twice [message #681873 is a reply to message #681781] Sat, 05 September 2020 00:38 Go to previous messageGo to next message
haider_1pk
Messages: 117
Registered: March 2009
Location: PAKISTAN
Senior Member
still problem is there
Re: same record appeared twice [message #681888 is a reply to message #681873] Sat, 05 September 2020 14:20 Go to previous messageGo to next message
Farhan ud din
Messages: 32
Registered: October 2018
Location: malakand
Member

First delete data from the table
Then add primary key to the invoice details table
And
Check your form code or share it
Re: same record appeared twice [message #681892 is a reply to message #681888] Sun, 06 September 2020 06:06 Go to previous message
haider_1pk
Messages: 117
Registered: March 2009
Location: PAKISTAN
Senior Member
I did it many time and create table one by one but the problem still remain I couldn't understand what it happen.
Previous Topic: set_block_property default where ,, why we use that much apostrophe
Next Topic: Oracle 12c forms and report suitable server machine
Goto Forum:
  


Current Time: Wed Dec 02 09:15:42 CST 2020