Yalim, you told me that tables must have a unique key based on exactly one column to create master-detail applications.

In Tutorial 26 procedure populateEmployees manages the synchronisation between the master and detail. Currently that’s been done with column department_id. However, I can create as many bind variables as I wish, so when I have a table with a key consisting of 7 columns, I can create 7 bind variables. Is that correct? If YES, do I understand it correctly that the only reason for tables to have a key with one column is concurrency control (Tutorial 25).

Related question is: how does Formspider handle DML-statements – by ROWID or by that unique key?

asked 26 Sep '14, 06:57

Jan%20Willem%20Vermeer's gravatar image

Jan Willem V...
1231331
accept rate: 0%


Hi Jan-Willem,

In a Formspider datasource there can only be one primary key column. So if you have a table with a primary key that consist of multiple columns, then the thing to do is create a database view (with instead-of triggers) and in that view just concatenate the primary key columns into a single pk column in the view.

(so again a reason why i always create views with instead-of triggers for all my datasources)

Good luck,
Michiel A

link

answered 28 Sep '14, 05:44

Michiel%20A's gravatar image

Michiel A
5161546
accept rate: 13%

Hi Jan-Willem,

In a Formspider datasource there can only be one primary key column. So if you have a table with a primary key that consist of multiple columns, then the thing to do is create a database view (with instead-of triggers) and in that view just concatenate the primary key columns into a single pk column in the view.

(so again a reason why i always create views with instead-of triggers for all my datasources)

Good luck,
Michiel A

link

answered 28 Sep '14, 05:44

Michiel%20A's gravatar image

Michiel A
5161546
accept rate: 13%

Hi Jan,

when I have a table with a key consisting of 7 columns, I can create 7 bind variables. Is that correct?

Yes, it is correct.

If YES, do I understand it correctly that the only reason for tables to have a key with one column is concurrency control

No. Formspider uses the Primary Key to issue update and delete statements.

how does Formspider handle DML-statements – by ROWID or by that unique key?

I guess I just answered this question above. Formspider uses the Primary Key the developer specified to issue update and delete statements.

If you have multi-column primary keys, the way Michiel described in his answer is the way to go. Formspider cannot use ROWID as the column to use in update and delete statements. This might change in the upcoming versions. We might add support for this.

Kind Regards,
Yalim

link

answered 29 Sep '14, 03:11

Yalim%20Gerger's gravatar image

Yalim Gerger ♦♦
1.8k5
accept rate: 15%

Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

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

Tags:

×5
×5
×4
×1

Asked: 26 Sep '14, 06:57

Seen: 1,259 times

Last updated: 29 Sep '14, 03:11


© Copyright Gerger 2017