Trigger for multiple table [closed] - oracle

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
I need to create a trigger that dont let enter dates before the actual date in all the tables of the database.
CREATE OR REPLACE TRIGGER t_date
BEFORE INSERT ON ?
FOR EACH ROW
So how can i refer to all the tables that have DATE as data type?

You can't.
A trigger can be defined on only one table. If you want to enforce the rule on every table in the schema, you would need to create a separate trigger on each table in the schema.

Related

How to relation with two table when column value is a array in Laravel [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed last month.
Improve this question
I need all reports with all officers included in the participants column.
please check the attached image.
https://prnt.sc/CRoELD48J-L5
You should really have a participant pivot table with report_id and officer_id, and create proper relationships.
What you're asking for is possible through loops and lazy loading, but it will be extremely slow and unoptimized.

Table in Spring [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
now I teaching Spring, and create simple project.
In my program I have User and Ore(Iron, Coal) but i think in future i add new ore or same goods.
And I don't know how implement many column.
If I create 50 different resources, these are 50 fields in the User class, but this is very inconvenient, how can I create such a relationship in the database. So that many resources can be added quickly.
I thought about design patterns, but I don't know which one is better to choose.
The project is built on Spring, PostgreSQL, MVC
You are misunderstanding the concept of a database. You don't add a column for each entry. Instead, look at your items, ores in this case, what do they have in common?
Could be something like
Id, OreName
Or could be somwthing complex like:
Id, OreName, price + a bunch of other columns with relations
It all depends on your requirements. I highly recommend you check out a database design video. Those would help you tremendously.

Updating the Oracle database through GET/ POST responses [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I am consuming a rest api through POSTMAN via "Get Product" and get the JSON formatted responses. Now I want to store them in my schema in the Oracle database. How would I go ahead? Please help me with any suggestions? Thank you in Advance!
Create a JSON table, and insert your response JSON there.
CREATE TABLE MY_JSON_TABLE (
id NUMBER NOT NULL,
json_data CLOB,
CONSTRAINT my_json_table_pk PRIMARY KEY (id),
CONSTRAINT json_chk CHECK (json_data IS JSON)
);

Is there any way to call trigger explicity in oracle? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
Can trigger can be explicitly called ?
I got question like
Trigger can be
a)Implicit
b)Explicit
c)Both
Is there any way to call Trigger Externally ?
From the first paragraph of the overview of triggers (emphasis added):
Like a stored procedure, a trigger is a named PL/SQL unit that is stored in the database and can be invoked repeatedly. Unlike a stored procedure, you can enable and disable a trigger, but you cannot explicitly invoke it.
So no, a trigger cannot be explicitly called.

How to access a table in linq [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I need to clone a table of a database which exists in a different servers.
e.g.On server A there is a database called EmployeeDataBase which has a table t1 which I need to copy to the database called EmployeeDataBase which exists on Server B.
How to do it using linq query.
My application uses linq to entity.
Thanks
If the tables have the same definition you can use the same mappings, just you need to create different contexts using the appropriate connection strings.
var ctxSource = new EmployeeDataBaseContext("[source connection]");
var ctxDestination = new EmployeeDataBaseContext("[destination connection]");
ctxDestination.t1.InsertAllOnSubmit(ctxSource.t1.ToList());
ctxDestination.SubmitChanges();
Check here the constructors you need.
Entity Framework is not the right technology for this kind of problem. You will be better off using raw ADO.Net. Maybe SqlBulkCopy can be of use: http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx

Resources