Hi all,

I have a master details form. I am inserting multiple rows into the detail table. Before committing the data I need to dynamically insert the columns of detail table with some data. (Eg. the foreign key has to be assigned with the primary key of the master table.) In Oracle Forms I need to give my code in the pre_insert trigger and it will take care of calling this code for every row being inserted. What is the formspider equivalent of this behavior?

I need to execute a procedure for every row that is being inserted into the details table. The procedure may contain a single line of code which will be executed for every row being inserted into the detail table. Example:

detailTable.foreignkey := masterTable.primarykey;

Kindly help.


asked 01 Mar '14, 19:02

grajan777's gravatar image

accept rate: 10%

Hi George,

The way i do this is that i just update the detailTable datasource row just after i create it. Say you have a create_new_row procedure that insers a row into the detailTable datasource, something like

   l_row_id := api_datasource.api_datasource.createrow ('detailDatasource');

   -- set new row to current
   api_datasource.setcurrentrowbyid(in_datasourcename_tx => 'detailDatasource'
                                   ,in_row_id => l_row_id 

Then just add a line to update the detail table foreign key column:

api_datasource.setcolumnvalue (in_datasourcedotcolumn_tx => 'detailDatasource.fk_column '
                              ,in_value_nr => api_datasource.getcolumnvaluenr('masterDatasource.pk_column')

Hope it helps,


answered 02 Mar '14, 08:54

Michiel%20A's gravatar image

Michiel A
accept rate: 13%

edited 02 Mar '14, 08:55

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 01 Mar '14, 19:02

Seen: 1,332 times

Last updated: 02 Mar '14, 08:55

Related questions

© Copyright Gerger 2017