|
|
Re: MySQL to SQL [message #480335 is a reply to message #480330] |
Fri, 22 October 2010 08:39 |
Queztapotel
Messages: 3 Registered: October 2010
|
Junior Member |
|
|
CREATE OR REPLACE TRIGGER trigger1
AFTER INSERT ON table1
FOR EACH ROW
DECLARE
NOW(), -- TIME_STAMP
NEW.ID, -- BC_ID
NEW.BC_STATUS, -- BC_STATE
NEW.BUSINESS_PROCES_FK, -- BUSINESS_PROCESS_ID
1, -- BUSINESS_CASE_PRIORITY
NULL, -- BUSINESS_CASE_DURATION
NEW.CLIENT_FK -- CLIENT_ID
BEGIN
INSERT INTO table2(
TIME_STAMP,
BC_ID,
BC_STATE,
BUSINESS_PROCESS_ID,
BUSINESS_CASE_PRIORITY,
BUSINESS_CASE_DURATION,
CLIENT_ID
)
END;
[Updated on: Fri, 22 October 2010 08:40] Report message to a moderator
|
|
|
|
Re: MySQL to SQL [message #480341 is a reply to message #480338] |
Fri, 22 October 2010 08:56 |
Queztapotel
Messages: 3 Registered: October 2010
|
Junior Member |
|
|
Oh sorry i didn't saw that my originally post was deleted to. So, this is my MySQL Code and i would like to translate it into SQL suited for Oracle 10G.
|
|
|
Re: MySQL to SQL [message #480343 is a reply to message #480341] |
Fri, 22 October 2010 09:09 |
cookiemonster
Messages: 13958 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Then might I suggest that you actually describe what it does for those of us who don't know mysql. Cause to me it looks completely meaningless.
|
|
|
Re: MySQL to SQL [message #480365 is a reply to message #480335] |
Fri, 22 October 2010 13:03 |
|
Barbara Boehmer
Messages: 9100 Registered: November 2002 Location: California, USA
|
Senior Member |
|
|
CREATE OR REPLACE TRIGGER trigger1
AFTER INSERT ON table1
FOR EACH ROW
BEGIN
INSERT INTO table2
-- column names in table2 to insert into:
(TIME_STAMP,
BC_ID,
BC_STATE,
BUSINESS_PROCESS_ID,
BUSINESS_CASE_PRIORITY,
BUSINESS_CASE_DURATION,
CLIENT_ID)
VALUES
-- values, including :new values from table 1
-- to insert into table2:
(SYSTIMESTAMP,
:NEW.ID,
:NEW.BC_STATUS,
:NEW.BUSINESS_PROCESS_FK,
1,
NULL,
:NEW.CLIENT_FK);
END trigger1;
/
SHOW ERRORS
|
|
|