All Questions
Tagged with insert-update triggers
43
questions
0
votes
0
answers
234
views
Stored Procedure: Update or Insert data between two databases on the same mysql server
I am trying to create a procedure to Insert or update data into a user table in a different database on the same MariaDB server. I am using phpMyAdmin.
I have the following two tables:
Database 1: ...
0
votes
1
answer
251
views
Using IF inside an Oracle trigger to change the update value
I'm trying to change the value of the update field within an IF statement when the new value does not match the backup column value.
Can't figure it out, anybody done something like this before?
edit :...
1
vote
0
answers
27
views
What is the most efficient way to update the value of another table in MYSQL?
Scenario
1. Two tables exist called 'score_log' and 'games_played_count'
2. Computing the "count" of rows from score_log that uniquely describe the number of games that have been played by a ...
0
votes
1
answer
267
views
Error creating Trigger After Insert in Mysql
I'm stuck when creating my trigger in mysql (on phpmyadmin), and that's why I come to ask for your help
I have 2 tables : Assemblage and Bicyclette.
Tables Diagram:
Assemblage was built like this :
...
0
votes
1
answer
34
views
Insert the data by running trigger but after running the condition in Oracle
I am trying to insert data in the form of creating trigger. But before inserting the data into the table, I want to run one condition which is
want to delete the data with some condition. So I ...
-1
votes
1
answer
49
views
Trigger for inserting/updating columns is not working in Oracle
I have created a trigger in Oracle. What I want to this, whether a new row is inserted or any existing row is updated I want to Insert/Update particular column based on some conditions respectively.
...
-2
votes
1
answer
559
views
Update Balance column automatically in a balance ledger for different Customer IDs
I am using MariaDB Version 10.2.22
I have a ledger table which can be defined by the sql code below:
CREATE TABLE ledger (
tr_id int AUTO_INCREMENT NOT NULL COMMENT 'Transaction ID ( Primary Key)...
0
votes
0
answers
50
views
PLSQL Oracle10 Dialect mimic UPSERT functionality using trigger
I have a table with a primary key id, first name, last name, and a unique company id.
CREATE TABLE "EMPLOYEE"(
"ID" NUMBER(*,0) NOT NULL ENABLE,
"FIRST_NAME" VARCHAR2(255 BYTE),
"LASNT_NAME" ...
2
votes
2
answers
451
views
MYSQL UPDATE Table on INSERT into same table
it seems simple, but still a challenge. I simplified my issue as much as possible.
I have this test_table with one record:
id | cost_per_record
1 | 24
After an INSERT I want the table to ...
0
votes
1
answer
653
views
After update trigger to replace an empty string with null updates all the data in that column to null
I want to update the record of a particular user only. But the update trigger fires for all the users.
CREATE OR REPLACE FUNCTION replace_empty_username_with_null() RETURNS TRIGGER
LANGUAGE ...
0
votes
0
answers
18
views
Update statement gives error with some IDs and not others
Have a database that I restored from a backup on a new sandbox server. I ran a very innocuous update statement:
UPDATE insurance
SET plan_text='MS MEDICAID'
WHERE insurance_id=168331
I ...
0
votes
2
answers
789
views
Automatic update of select-table sql (trigger)
I am developing a small database of a a school, using MySQL.
I have a table for professors, with id, name and email, and a table for lectures,with id, name of lecture, and the edition of that class. ...
1
vote
2
answers
152
views
Create Oracle Update Trigger
Hi guys first time asking here in Stack Overflow.
So my question is as follows: When a row is inserted into table A reward points need to be calculated and they must be added to an earned points ...
0
votes
1
answer
108
views
Inserting a new row while updating a row in the same table using MySQL triggers
I'm trying to insert a row into a table after updating a row in this same table. I was trying to do this using a trigger. But I found that it's not possible to do that in this method.
What i'm trying ...
0
votes
0
answers
332
views
Postgres multiplication function added to field with database trigger
I have 2 tables (within the same POSTGRESQL database) called respectively Orders and Products. They look like this more or less:
Products:
-integer id (primary)
-text description
-numeric ...