Originally posted by jam26
Linking of Schemas
Collapse
X
-
-
He means lots of triggers per table. If you have a few triggers per table, that is acceptable.
Pilgrim.Comment
-
Originally posted by Pilgrim333He means lots of triggers per table. If you have a few triggers per table, that is acceptable.
Pilgrim.
@OP,
Its question of, if there are 10 tables in each schema used by application, then 10 * 15 = 150 tables and creating 150 triggers one each for a table is ofcourse not smart way of implementing.
And again you are going to connect to database from an application, and insert a record in the table which in turn will fire a trigger. So you need to make sure if this way you are reallly getting unique value and not the old value.Comment
-
@OP
The whole idea of the trigger is that the trigger will fetch from the sequence and not the application. The unique values should not be a problem.
The whole idea of triggers is that, no matter from which interface you want to access the tables, everything is done on the database side, so the interface need not worry about unique values, bussiness rules etc. This is the Oracle way of solving the problem you are encountering.
As i stated before, he has to test the code in the trigger before implementing. Furthermore, if you have a system that has 150+ tables, then 150+ triggers should be no problem at all. If it is, then your system is way too big for your budget.
Pilgrim.Comment
-
Originally posted by Pilgrim333@OP
The whole idea of the trigger is that the trigger will fetch from the sequence and not the application.
As i stated before, he has to test the code in the trigger before implementing. Furthermore, if you have a system that has 150+ tables, then 150+ triggers should be no problem at all. If it is, then your system is way too big for your budget.
Comment
-
Originally posted by amitpatel66If there was no application at all then the sequence was working perfeclty from sqlplus
Originally posted by amitpatel66Budget does not come in to play here. The application is already available. It need to be customized by including the functionality of having a auto number generation across multiple schemas of a database. And yes why not an application have more than 150 tables if there are 15 schemas involved. Its just an assumption and nothing else which can be clarified if @OP answers the question of letting know to how many tables are used in each schema by the application.
The application should not be customized, the autonumbering should happen at the database side. Even if the database has a 1000+ tables.
Pilgrim.Comment
-
It doesnt make sense creating 150 odd triggers. What if in future, number of table increases, one cannot keep creating a trigger.
If and only if the number of tables are less (totalling all the tables across 15 schemas that are used by an application) and there will not be any new table inclusion in future then creating a trigger is acceptable. Again it have to be tested before it could work.Comment
-
Originally posted by Pilgrim333There is no problem with the sequence, with or without the application.
Pilgrim.Comment
-
Originally posted by amitpatel66There is a problem with the sequence when accessed from application, then what are be discussing here for so so long??
So, there is no problem with the sequence when accessed from the application, because the application is not accessing the sequence.
Pilgrim.Comment
-
Originally posted by Pilgrim333The application is not accessing the sequence, the poster just updated the autokey of the application once with the value of the sequence and expected that it would automatically link it with the sequence.
Pilgrim.
Anyways I can utilize this time and rethink of any other solution for this issue rather just increasing the size of this thread, becuase its important that @OP understands what I am trying to say.Comment
-
It isn't accessed from the application by the autokey.
@OP
Meanwhile, in googley land...
It seems that this problems is something more people have. Someone posted it on his blog, hopefully it will help you, and you need not go through all the trouble of making (all) the triggers.
Maximo and unique id's
Pilgrim.Comment
-
Hi,
I don't know what you mean. It is possible to use the sequence for numbering in tables in another database. The sequence can be used through a database link. Syntax for that is:
Code:select <sequenceschema>.<seqname>.nextval@<dblink> from Dual ;
Pilgrim.Comment
Comment