•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 402,095 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,451 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser: Programming Forums
Views: 262 | Replies: 3
![]() |
•
•
Join Date: Oct 2006
Posts: 62
Reputation:
Rep Power: 2
Solved Threads: 0
How can I create a trigger to UPDATE this for me when a new record is inserted.
I want to create a column called "fullthumb" where by default it has the words "http://example.com/thumbs/" and add the words in "thumb" column.
In syntax:
I know the general syntax of CREATE TRIGGER is :
but I am new at mysql...Can someone help me create trigger with the above syntax
I want to create a column called "fullthumb" where by default it has the words "http://example.com/thumbs/" and add the words in "thumb" column.
In syntax:
UPDATE files SET
fullthumb = CONCAT('http://example.com/thumbs/', thumb);I know the general syntax of CREATE TRIGGER is :
CREATE TRIGGER trigger_name trigger_time trigger_event ON tbl_name FOR EACH ROW trigger_statement
but I am new at mysql...Can someone help me create trigger with the above syntax
Last edited by peter_budo : Mar 13th, 2008 at 7:52 pm. Reason: Keep It Organized - please use [code] tags for easy readability
•
•
Join Date: Dec 2007
Posts: 112
Reputation:
Rep Power: 1
Solved Threads: 13
Hi welbyobeng,
I have just realised that this is not possible with TRIGGER. There is a limitationthat you can not use the same table to read/write who invoked the trigger.
So you have to implement this when you are inserting the new record. Is there any problem to save the fullpath at the time of insertion?
I have just realised that this is not possible with TRIGGER. There is a limitationthat you can not use the same table to read/write who invoked the trigger.
So you have to implement this when you are inserting the new record. Is there any problem to save the fullpath at the time of insertion?
![]() |
•
•
•
•
•
•
•
•
DaniWeb MySQL Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- PHP/MySQL Programmer Position (Web Development Job Offers)
- PHP MYSQL Developer Position Available (Web Development Job Offers)
- SQL Server vs MYSQL vs MSQL (i'm stopping now) (MS SQL)
Other Threads in the MySQL Forum
- Previous Thread: Correct database design?
- Next Thread: MySQL User Limit?


Linear Mode