Solved

serial in form

Posted on 2013-12-22
11
335 Views
Last Modified: 2014-01-27
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 ?
0
Comment
Question by:NiceMan331
  • 7
  • 4
11 Comments
 
LVL 9

Accepted Solution

by:
MarkusId earned 500 total points
ID: 39735537
Hi,

There can be a lot of reasons for that - it might be useful to know, why this error happens. So please also add the output of the 'show-error'-key (that may show the reason, why the record could not be updated).

Furthermore, do you always enter the describ-item? Because only then, the post-text-item-trigger is triggered. It may be useful to move that code to the POST-RECORD-trigger.

Best wishes
Markus
0
 

Author Comment

by:NiceMan331
ID: 39735893
GOOD IDEA
i will try it
because i'm not always posting descrit
0
 

Author Comment

by:NiceMan331
ID: 39737432
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 ?
0
 
LVL 9

Expert Comment

by:MarkusId
ID: 39737933
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).
0
 

Author Comment

by:NiceMan331
ID: 39739241
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
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:NiceMan331
ID: 39739275
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
0
 
LVL 9

Expert Comment

by:MarkusId
ID: 39741692
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?
0
 

Author Comment

by:NiceMan331
ID: 39743175
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 ?
0
 
LVL 9

Expert Comment

by:MarkusId
ID: 39746147
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...
0
 

Author Comment

by:NiceMan331
ID: 39749474
yes , but not for all records
i would like this message to retrieve only for records making the primary key  vioileted
0
 

Author Comment

by:NiceMan331
ID: 39764384
still waiting
any replay ?
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
oracle query help 18 99
Insert and update a row at the same time 4 52
Oracle and DateTime math 6 26
Can anyone please tell me what does below Stored Procedure does? 4 19
This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now