is it possible to determine if a datasource is updateable or insertable?

asked 04 Aug '15, 11:14

apacheuk's gravatar image

apacheuk
1391223
accept rate: 0%

edited 05 Aug '15, 06:37

Yalim%20Gerger's gravatar image

Yalim Gerger ♦♦
1.8k5


Hi Simon,

You might be asking about two different things. I am not sure which one. So I'll answer for both of them. If you are asking about the "Issue DML for" checkboxes in the Datasource Definition Dialog... If you check one of these three boxes, Formspider will attempt to issue the corresponding DML to the underlying database object if the developer issues a api_application.doCommit call and the datasource based on the definition is dirty (i.e. has changes that can be posted to the database). So being insertable or updateable are not properties defined at the datasource but at its definition. Every datasource will inherit these properties.

Please note that the DML statements issues by Formspider may cause errors if the underlying database object is not updateable/insertable etc...

If you are asking about whether you can create rows, update rows or delete rows in a datasource...All datasources allow these operations. So you can create, edit and delete as many rows as you like in a datasource even if the "Issue DML for" checkboxes for its definition are unchecked.

Hope this helps.

Kind Regards,
Yalim

link

answered 05 Aug '15, 06:46

Yalim%20Gerger's gravatar image

Yalim Gerger ♦♦
1.8k5
accept rate: 15%

I am talking about the datasource definition, particularly those checkboxes, is there a api available to determine this?

link

answered 05 Aug '15, 07:10

apacheuk's gravatar image

apacheuk
1391223
accept rate: 0%

Hi Simon,

Formspider does not have public meta data API's but it has internal meta data API's. You can use them to find out if insert, update or delete is allowed on a particular datasource definition.

Please note that, these are internal API's. You can use them but we don't promise to keep these API's stable or backwards compatible. They are also less convenient to use compared to the public API's.

You can get the datasource definition using

function getdatasourceDef(in_datasourceDef_oid number) return t_bdf_datasourceDef%rowtype

in the bdf_datasourcedef_qry package.

You will need the datasource definition ID to run the function. You can obtain this using the following function in the same package:

function getId(in_name_tx varchar2, in_application_id number) return number

Now for the function above to work you need the ID of the application the datasource definition is in. :-). (I told you the internal API's are not very convenient to use. :-) ) You may know this ID in your development environment but it will change in the production environment. So to get the application ID you can run the following function in the bdf_application_qry package:

function getId(in_name_tx varchar2, in_user_oid number:=null) return number

You can leave the in_user_oid parameter as null.

The bdf_datasourcedef_qry.getDataSourceDef function returns a record. The three column names you are interested in are called: deleteallowed_yn, insertallowsed_yn, updateallowed_yn

Just out of curiosity, why do you need this information in the application?

Kind Regards,
Yalim

link

answered 10 Aug '15, 07:04

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:

×64
×13
×9
×6
×3

Asked: 04 Aug '15, 11:14

Seen: 880 times

Last updated: 10 Aug '15, 07:04


© Copyright Gerger 2017