MYSQL trigger syntax for CONCATPerformance of a Trigger vs Stored Procedure in MySQLMySQL using trigger...
What can I do to encourage my players to use their consumables?
Boss asked me to sign a resignation paper without a date on it along with my new contract
What dissuades people from lying about where they live in order to reduce state income taxes?
Is it possible to map from a parameter to a trajectory?
How can guns be countered by melee combat without raw-ability or exceptional explanations?
How to get a 2D Plot from a 3D Listplot?
Given a total recursive function, can you always compute its fixed-point?
What if I miss a connection and don't have money to book next flight?
How to draw a node with two options using TikZ graphs in LaTeX
GPSD issues on 16.4
What would be some possible ways of escaping higher gravity planets?
How can I differentiate duration vs starting time
Buying a "Used" Router
Did ancient Germans take pride in leaving the land untouched?
Lubuntu 18.10 File Manager: How to view directory tree structure?
Why "rm -r" is unable to delete this folder?
Promise.all returning empty objects
Was Opportunity's last message to Earth "My battery is low and it's getting dark"?
How do I add a strong "onion flavor" to the biryani (in restaurant style)?
Is there any danger of my neighbor having my wife's signature?
Was there a pre-determined arrangement for the division of Germany in case it surrendered before any Soviet forces entered its territory?
Why is it that Bernie Sanders is always called a "socialist"?
Putting a vertical line in each Histogram using GraphicsGrid
Is practicing on a digital piano harmful to an experienced piano player?
MYSQL trigger syntax for CONCAT
Performance of a Trigger vs Stored Procedure in MySQLMySQL using trigger instead of checkHow to commit transaction on an after update event trigger?Cannot insert row into table after creating a triggerOracle: Trigger to store username after INSERT into column of same tableWhat is missing in my trigger?How to execute AFTER INSERT TRIGGER with an auto-incremented (seq.NEXTVAL) column value in Oracle PL/SQL?Mysql trigger to update if date match and insert if no match all BEFORE INSERTWhat is wrong with this mysql trigger?Need help in creating MySQL trigger
I am creating a trigger which should be really easy, but I cannot get past the set @code line? What am I doing wrong? There is an ID column in the wp_users table.
CREATE TRIGGER affiliate_insert
AFTER INSERT
ON wp_users FOR EACH ROW
BEGIN
set @code = CONCAT('SOCIALBIKER',new.`ID`);
INSERT INTO `wp_pmpro_affiliates`
(
`code`, `name`, `affiliateuser`, `trackingcode`, `cookiedays`, `enabled`, `visits`
)
VALUES
(
@code,
NEW.`user_email`,
``,
30,
1,
''
);
END;
mysql trigger
New contributor
add a comment |
I am creating a trigger which should be really easy, but I cannot get past the set @code line? What am I doing wrong? There is an ID column in the wp_users table.
CREATE TRIGGER affiliate_insert
AFTER INSERT
ON wp_users FOR EACH ROW
BEGIN
set @code = CONCAT('SOCIALBIKER',new.`ID`);
INSERT INTO `wp_pmpro_affiliates`
(
`code`, `name`, `affiliateuser`, `trackingcode`, `cookiedays`, `enabled`, `visits`
)
VALUES
(
@code,
NEW.`user_email`,
``,
30,
1,
''
);
END;
mysql trigger
New contributor
add a comment |
I am creating a trigger which should be really easy, but I cannot get past the set @code line? What am I doing wrong? There is an ID column in the wp_users table.
CREATE TRIGGER affiliate_insert
AFTER INSERT
ON wp_users FOR EACH ROW
BEGIN
set @code = CONCAT('SOCIALBIKER',new.`ID`);
INSERT INTO `wp_pmpro_affiliates`
(
`code`, `name`, `affiliateuser`, `trackingcode`, `cookiedays`, `enabled`, `visits`
)
VALUES
(
@code,
NEW.`user_email`,
``,
30,
1,
''
);
END;
mysql trigger
New contributor
I am creating a trigger which should be really easy, but I cannot get past the set @code line? What am I doing wrong? There is an ID column in the wp_users table.
CREATE TRIGGER affiliate_insert
AFTER INSERT
ON wp_users FOR EACH ROW
BEGIN
set @code = CONCAT('SOCIALBIKER',new.`ID`);
INSERT INTO `wp_pmpro_affiliates`
(
`code`, `name`, `affiliateuser`, `trackingcode`, `cookiedays`, `enabled`, `visits`
)
VALUES
(
@code,
NEW.`user_email`,
``,
30,
1,
''
);
END;
mysql trigger
mysql trigger
New contributor
New contributor
New contributor
asked 3 mins ago
Steve NewtonSteve Newton
101
101
New contributor
New contributor
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Steve Newton is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f230608%2fmysql-trigger-syntax-for-concat%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Steve Newton is a new contributor. Be nice, and check out our Code of Conduct.
Steve Newton is a new contributor. Be nice, and check out our Code of Conduct.
Steve Newton is a new contributor. Be nice, and check out our Code of Conduct.
Steve Newton is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Database Administrators Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f230608%2fmysql-trigger-syntax-for-concat%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown