Avatar of NiceMan331
NiceMan331 asked on

serial in form

hi
i have one form master & details
details is based on table : det_trans
it contain column : line_no which should contain the serial number of each tabular entry
describ is the last field in det_trans
i put in post_text_item of that field this code

      :det_trans.line_no:=:system.cursor_record;

then it saved ok
but sometimes , only sometimes , when i update one or more record in that details
it send me message : unable to update record
i checked all codes , i quess there is mistake in my previous code

is there any other code i use it to give that serial ?
Oracle Database

Avatar of undefined
Last Comment
NiceMan331

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
MarkusId

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
NiceMan331

GOOD IDEA
i will try it
because i'm not always posting descrit
ASKER
NiceMan331

post_record not solve the problem

add the output of the 'show-error'-key (that may show the reason, why the record could not be updated).

how to use it ?
MarkusId

Hi,

The key for showing Oracle Forms errors is depending on system settings, version and key mappings. You might try the combinations Shift+F1 or  Ctrl+Shift+E (maybe Ctrl+F1 shows the key mappings).
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
ASKER
NiceMan331

yes
it display an error that : constraint GL_PK vioilated
actually i'm not the owner of that  table
but when i view the constraint of it , i found the constraint gl_pk
but i don't know what is the column contain the primary key
it shows null as per the attached image
ASKER
NiceMan331

sorry it fail to attached
any how here is its definition
constraint name : GL_PK
constraint type : primary key
owner : null
search condition : null
refernce table : null
MarkusId

Could you please post the output of following query:

select column_name, table_name from all_cons_columns where constraint_name = 'GL_PK';

Open in new window


Is this the master- or the detail-table?
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
ASKER
NiceMan331

year , period , tr_code , tran_no , line_no
table name : gen_ledgers
it is details table for master table name : master_gen_ledger

the first 4 columns :  year , period , tr_code , tran_no are the links between master & details


PROCEDURE Compl_Detail IS
BEGIN
      :GEN_LEDGERS.year:=:MASTER_GEN_LEDGER.year;
            :GEN_LEDGERS.period_no:=:MASTER_GEN_LEDGER.period_no;
                  :GEN_LEDGERS.tr_code:=:MASTER_GEN_LEDGER.tr_code;
                        :GEN_LEDGERS.TRAN_NO:=:MASTER_GEN_LEDGER.TRAN_NO;
      :gen_ledgers.line_no:=:system.cursor_record;
         
END;

before , i used to call that procedure post_text_item of : describt , as i mentioned before
but after your advice , i call it now on : post_insert  of the record level (gen_ledgers)

till now i didn't face any problem after changing the trigger , but let investigate the old records having problem ,  how to request the message inside the trigger to show the value of each 5 records mentioned above ?
MarkusId

Do you mean you want to show the values of each field?

message('Year: ' || :gen_ledgers.year); synchronize;
message('Period No.: ' || :gen_ledgers.period_no); synchronize;

And so on...
ASKER
NiceMan331

yes , but not for all records
i would like this message to retrieve only for records making the primary key  vioileted
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
ASKER
NiceMan331

still waiting
any replay ?