Validation on an Attribute Comparing another Attribute of another Iterator - jdeveloper

JDev 11.1.1.5.0
I have two tables in the form, one read only A and one editable B.
There is an attribute called terms in the table B and an attribute called limit in table A.
I want to validate the key-in of terms in table B for which it should not be greater than the value of limit in table A.

You can create custom validation on EntityObjectImpl of table B
do below steps in your code
1-Create object of EntityObjectImpl of table A
2-Get value of attribute limit in table A
3-Compare the value of two attribute and handle your validation

Related

Oracle Forms: have a specific column on some rows not store a value in the database?

Requirements
Here are the simplified requirements. The end goal is to be able to display data about an item, or print labels using the saved data. The solution is being created in Oracle Forms Builder
Attribute Definition form
Designed to define attributes.
Attribute configuration details are stored in an attribute
definition table
Attributes can be either a manually entered
values, or SQL driven
SQL Example: Case Weight (uses the Item's
Case UOM conversion rate multiplied by the item's unit weight)
Manual Example: Color of item
When SQL driven, a select statement is saved in the attribute configuration
Tokens like :INVENTORY_ITEM_ID are used in the SQL, and will be replaced with
values by the form when the SQL is evaluate.
Item Attribute Assignment form
Designed to link attributes to an item
Form includes a list of attributes assigned to an item
Records that link the attribute to the item are saved in the
database
Records store the attribute ID, Item ID and the attribute
value (if applicable)
List should be in a single block.
The form
allows additional assignments of attributes (which defined in first
form)
Items can have SQL and Manual type attributes assigned to
them.
Form allows "manual" values to be updated at any time by the
user
Form derives SQL values, displays them in the "value" field,
but the value field should be disabled so the user can't edit it.
Upon querying an item or assigning a new attribute
SQL values should be derived/evaluated
Manual entered values should be pulled
from the tables "value" column
Problem
We don’t want the form to save the SQL derived values to the table.
Is there a way to have a specific column on some rows not store a value in the database? These would be the rows that contain the SQL derived values, which are displayed in the disabled value cell, and derived when an item is queried, or an attributes is assigned.
It is possible, but you really should implement table handlers for your Forms, rather than relying on Oracle Forms to do your DML for you.
By "implement table handlers", I mean, set the block's "DML Data Target Type" property to "Use Transactional Triggers".
Then, code the ON-INSERT, ON-UPDATE, etc triggers for your block to call PL/SQL (passing in the appropriate values to insert, update, etc from your block).
In your PL/SQL, you can insert each column exactly where and how you want it, or don't insert a column at all, which is what you're after here.
If you are using the Oracle e-Business Suite, this is documented in the Oracle Applications Developer's Guide, chapter 10 ("Using PL/SQL in Oracle E-Business Suite: Coding Item, Event, and Table Handlers").

how adding a fields to relationship Table in pivot table method using laravel

I want to design an online store. For each category of productions, we would have its own fields.
Connections between tables of fields and categories are done and displayed in the part of registration of productions.
At the end, the value of each field should be stored that it should contains the related table between table of fields and productions (in addition to/plus/+) the value of that field.
My problem is in this part and I want that this related table has an additional field that I could value it.
In the following figure, the picture of table and my connections are shown, if there is (any problem/ something wrong with it), I would appreciate you to help me.
View Relationship Images :
http://ir-up.ir/uploads/1416568805731.jpg
You'd simply need to add a withPivot when declaring the relationship:
return $this->belongsToMany('Role')->withPivot('foo', 'bar');
Extra attributes in pivot tables are covered in the docs, here - http://laravel.com/docs/4.2/eloquent#working-with-pivot-tables

Oracle forms hybrid validation

This is my first post ever and haven't come across any other questions related to this. I am attempting to try and create a hybrid validation type and add it to an existing oracle form. We have a super/subset type of thing going on. When one chooses something from a dropdown, there are 5 options. If 4 of those options are chosen, the data is pulled from one validation table dataset, table A. If the other option is chosen, it comes from a different table's dataset, table B. These (along with others items) are saved in Table C. Table C has a FK constraint regarding these validations. I have added another column to table C to attempt to bypass the FK constraint, but the field still tries to save in the FK column. I can't seem to figure out if I need to add a database trigger, an item level trigger, or a form level trigger to reroute the data to correct columns in the database. Thanks in advance for any help!
If your items are select lists, you would use an item level trigger (when-validate-item) on the superset list item to populate/repopulate the list for the subset item.
Alternatively, you could use a popup LOV on the subset item which has a query which is filtered by the value of the superset item.

Entity Framework 4.3 How to save a column value Mutually exclusive between records?

Is there any way i can save a specific column value mutually exclusive between records.
Ex : I have an Address table and i want to save "IsPrimaryAddress " column to true. So when i add the second Address record for the Same Person with IsPrimaryAddress value True, I want to update the other records which has the IsPrimaryAddress value to be null so that only one address will have IsPrimaryAddress value =True
That is your domain logic and you must implement it in your application. EF will not help you with domain logic - it is framework for data access. Database can handle this only if you create an insert/update trigger and that is pretty ugly way to implement your domain logic.

Dynamically setting MaxLength property of a DataColumn with DataAdapter

I have a datatable that I'm filling with SqlDataAdapter.Fill(). Is there a way to dynamically assign the MaxLength property to each string datacolumn to the maximum allowed by that column in the database?
So I googled for a while and found that the DataAdapter has another method besides Fill which is: FillSchema(), which includes the database schema into the DataTable. Since all I wanted to bring was the MaxLength property what I did was load the schema into another table and loop through the columns assigning the value to each one.
Of course if you wanted to keep all the constraints in the database within your table, then you'd need no loop and just load the schema into the datatable.
PedroC88's answer worked. To clarify the code needed for any newbies. Just above my adapters fill method, I wrote the fillschema method. The (SchemaType)2 argument is required. There are 2 different schematypes (1 and 2) and 2 is recommended as it applies existing table mappings (though I have no idea what this means).
myAdapter.FillSchema(dataTable, (SchemaType)2);
myAdapter.Fill(dataTable);
In this code 'myAdapter' is the name of my adapter and 'dataTable' is the name of my data table.

Resources