1 Reputation Point
Ranked #4K
- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
100% Quality Score
- Upvotes Received
- 2
- Posts with Upvotes
- 1
- Upvoting Members
- 2
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
0 Endorsements
Ranked #44.2K
First the table [CODE]create table customer( no int NOT NULL auto_increment, cust_id varchar(15) NOT NULL, cust_name varchar(50), cust_address text(150), cust_phone int, cust_email varchar(30), PRIMARY KEY(no));[/CODE] Then the trigger [CODE]DELIMITER | CREATE TRIGGER trig BEFORE insert on customer FOR EACH ROW BEGIN set new.cust_id=concat(new.cust_name,new.no); END; DELIMITER |[/CODE] Then the insert query … |
|
Hello, I am using a code to generate an id for a table.But it is giving 'Conversion from type dbnull to type integer is not valid' exception. Now I know that this is due to the table being an empty set.But it works properly if there is already a row … |