Re: appending INT to a column name in a trigger
ok I read all I could find in mysql docs and tried again:
Here is part of the trigger. For the first row logName should be log_streamer_1, second row log_streamer_2 etc etc
FOR EACH ROW
BEGIN
DECLARE rowNum INTEGER;
DECLARE srowNum CHAR;
DECLARE logName CHAR;
SELECT id INTO rowNum FROM b04_reel_data limit 1;
SELECT CAST(rowNum AS CHAR) INTO srowNum;
SELECT CONCAT('log_streamer_',srowNum) INTO logName;
IF id<25 THEN
INSERT INTO logName (streamer_tension) VALUES (NEW.streamer_tension) ;
END IF;
.......Error Code: 1406. Data too long for column 'logName' at row 2
Subject
Views
Written By
Posted
2549
February 23, 2012 08:34AM
1324
February 23, 2012 08:07PM
1559
February 24, 2012 02:48AM
1358
February 24, 2012 02:54AM
Re: appending INT to a column name in a trigger
1491
February 24, 2012 03:36AM
1394
February 23, 2012 09:34PM
1610
February 23, 2012 09:47PM
1283
February 23, 2012 09:53PM
1731
February 24, 2012 03:43AM
2112
February 24, 2012 09:54AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.