Hi,

i think i understand the new option "ROWID support for DML" but am not 100% sure.

1) Table has key based on one column: define the primary key in the datasource and code this:

if api_datasource.getCurrentRowID('DATASOURCENAME') is not null then api_datasource.deleteCurrentRow('DATASOURCENAME'); end if;

2) Table has key based on more than one column: leave Primary Key empty and check checkbox "Use Oracle Row ID" and code this:

*if api_datasource.getCurrentRowID('DATASOURCENAME') is not null then

api_datasource.deleteRowByOraRowID('DATASOURCENAME',

api_datasource.getOraRowID('DATASOURCENAME',api_datasource.getCurrentRowID('DATASOURCENAME'))); end if*

Is this correct?

I noticed that when i have a table with a one column key, i can use both ways. What will happen when i use the first method on a table with a key based on multiple columns?

Kind regards, Jan Willem

asked 09 Sep '15, 09:46

Jan%20Willem%20Vermeer's gravatar image

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


Hi Jan,

If you want to delete the current row

api_datasource.deleteCurrentRow('DATASOURCENAME');

will always going to work regardless of the datasource definition using the Oracle ROWID.

Similarly,

api_datasource.getOraRowID('DATASOURCENAME');

will return the current row's Oracle ROWID. The second input parameter defaults to current row in the datasource.

Kind Regards,
Yalim

link

answered 10 Sep '15, 07:02

Yalim%20Gerger's gravatar image

Yalim Gerger ♦♦
1.8k5
accept rate: 15%

Ok, but then i do not understand the advantage of the rowid-setting anymore.

Can you explain the differences between DML's based on the primary key or with the ROWID?

Kind regards, JW

link

answered 10 Sep '15, 07:38

Jan%20Willem%20Vermeer's gravatar image

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

If a datasource definition uses the PK to issue DML, the update statement Formspider issues looks something like this:

update emp set first_name='Yalim' where emp_id=5;

(assuming emp_id is the PK of the datasource definition.)

If the datasource definition uses Oracle ROWID to issue DML then the update statement looks like this:

update emp set first_name='Yalim' where rowid=<Oracle rowid value>;

This enables you to issue DML to tables, views which have multi-column PK's.

In Formspider, you can also find/locate a row in a datasource using four different methods: (i.e. API_DATASOURCE package functions and procedures usually have four different versions that support four different ways to access/manipulate a row in a datasource)

You can access/find/set a row using

1) The Formspider RowId (not to be confused with the Oracle ROWID). This always works for every datasource.

2) Datasource RowNumber. Nth row in the datasource. This always works too.

3) Datasource Definition PK value. This is meaningful only if you've specified a PK for the Datasource Definition.

4) Oracle ROWID. This is only meaningful if you checked the relevant checkbox in the datasource definition.

Usually once you get the Formspider RowId one way or the other, you move forward with that value.

Hope this helps.

Kind Regards, Yalim

link

answered 10 Sep '15, 08:24

Yalim%20Gerger's gravatar image

Yalim Gerger ♦♦
1.8k5
accept rate: 15%

edited 10 Sep '15, 08:25

Hi Yalim, so, if i have a table with multi-column key, i only have to set the checkbox "use rowid" for updates and nothing more. What happens when the primary key field is also set? What comes first: the rowid or the primary key?

KR, JW

(10 Sep '15, 08:59) Jan Willem V...

Hi Jan,

If the "Use Oracle ROWID" checkbox is checked, Formspider will use Oracle ROWID to issue DML statements even if you select a Primary Key.

Kind Regards,
Yalim

(11 Sep '15, 02:08) Yalim Gerger ♦♦
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:

×13
×6
×5

Asked: 09 Sep '15, 09:46

Seen: 2,449 times

Last updated: 11 Sep '15, 02:09


© Copyright Gerger 2017