Can someone explain what happens when you have a datasource with no primary key using DML. What are some of the repercussions. If you have a view which has no primary key (or it has but consists of 2 or more columns composite the primary key). You have instead of triggers on the view which handle the underlying DML. How does Formspider handle the data set consistency. I could understand that you would do a read back of the row after an insert for example if you have a primary key. But when you don't have a primary what happens to the data set?

asked 30 Mar '14, 00:38

Raymond's gravatar image

Raymond
24320
accept rate: 0%


Hi Raymond,

If you don't pick a primary key, for a Datasource Definition, Formspider does not issue DML statememts for datasources based on this definition.

Kind Regards,
Yalim

.

link

answered 30 Mar '14, 03:16

Yalim%20Gerger's gravatar image

Yalim Gerger ♦♦
1.8k5
accept rate: 15%

OK yes I found that out just after I posted the question. Looking at the demo app, you create a view with a dummy primary column key. But when I do that the primary key drop down does not show me my artificial primary key as an option.

(30 Mar '14, 03:19) Raymond

My view is a join between two tables. My dummy key is a column from each table like invoice_id'||' #' ||'line_item_id'

(30 Mar '14, 03:25) Raymond

Even if I try to create a new datasource in the srdemo app based on expertiseareas_v it will not show the exa_id column which is your dummy pk. Editing the existing datasource expertiseAreas does show the column exa_id. I am stumped.

(30 Mar '14, 03:43) Raymond

Ah figured it out you need to specify query and not select view.

(30 Mar '14, 03:45) Raymond

Nah that does not make sense sorry. I am still stumped

(30 Mar '14, 03:47) Raymond

Ok is this how it is suppose to work. You create the view with the dummy pk column. You create the datasource and then mark the column as "required", go back to primary key column and then it will show up as the primary key combo box will only show mandatory columns.

(30 Mar '14, 03:51) Raymond

Bingo! :-)

(30 Mar '14, 04:12) Yalim Gerger ♦♦
showing 5 of 7 show 2 more comments

As a workaround: create virtual or trigger-supported column is the base table and pass this column to the view http://stackoverflow.com/questions/11097839/how-to-create-a-not-null-column-in-a-view

link

answered 02 Apr '14, 06:13

Andrew%20Pouckatch's gravatar image

Andrew Pouck...
168
accept rate: 0%

As a workaround: create virtual or trigger-supported column is the base table and pass this column to the view [http://stackoverflow.com/questions/11097839/how-to-create-a-not-null-column-in-a-view]

link

answered 02 Apr '14, 06:14

Andrew%20Pouckatch's gravatar image

Andrew Pouck...
168
accept rate: 0%

edited 02 Apr '14, 06:14

The virtual column does not quite work for me as the view is join between three tables. But I got it all working ok now with an artificial composite key. The trick is to define then that column in the datasource as mandatory. The column will then show up in the primary key column drop down list box.

link

answered 02 Apr '14, 08:52

Raymond's gravatar image

Raymond
24320
accept rate: 0%

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:

×61
×5
×1

Asked: 30 Mar '14, 00:38

Seen: 2,019 times

Last updated: 02 Apr '14, 08:52


© Copyright Gerger 2017